source: icGREP/icgrep-devel/icgrep/pablo/ps_while.cpp @ 4861

Last change on this file since 4861 was 4860, checked in by nmedfort, 4 years ago

Back up check in. Memory leaks should be fixed.

File size: 794 bytes
Line 
1#include <pablo/ps_while.h>
2#include <pablo/codegenstate.h>
3
4namespace pablo {
5
6While::While(PabloAST * expr, const std::initializer_list<Next *> nextVars, PabloBlock & body)
7: Statement(ClassTypeId::While, {expr}, nullptr)
8, mBody(body)
9, mNext(nextVars.begin(), nextVars.end(), reinterpret_cast<NextAllocator &>(mAllocator)) {
10    for (Next * variant : nextVars) {
11        variant->addUser(this);
12        this->addUser(variant);
13    }
14}
15
16While::While(PabloAST * expr, const std::vector<Next *> & nextVars, PabloBlock & body)
17: Statement(ClassTypeId::While, {expr}, nullptr)
18, mBody(body)
19, mNext(nextVars.begin(), nextVars.end(), reinterpret_cast<NextAllocator &>(mAllocator)) {
20    for (Next * variant : nextVars) {
21        variant->addUser(this);
22        this->addUser(variant);
23    }
24}
25
26}
Note: See TracBrowser for help on using the repository browser.