diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2016-10-09 20:11:37 -0600 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2016-10-09 20:11:37 -0600 |
commit | 2a2752adb4b32715926d3e565444fe2ea959f597 (patch) | |
tree | 2577d8aec38c34a47833c89ac5d41026754d6995 /src/chillASTs.cc | |
parent | 41d53b28284bb6b8a9ef45de4d596734f64c3971 (diff) | |
download | chill-2a2752adb4b32715926d3e565444fe2ea959f597.tar.gz chill-2a2752adb4b32715926d3e565444fe2ea959f597.tar.bz2 chill-2a2752adb4b32715926d3e565444fe2ea959f597.zip |
clean up
Diffstat (limited to 'src/chillASTs.cc')
-rw-r--r-- | src/chillASTs.cc | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/chillASTs.cc b/src/chillASTs.cc index 30965d9..1e670a7 100644 --- a/src/chillASTs.cc +++ b/src/chillASTs.cc @@ -421,7 +421,7 @@ void chillAST_FunctionDecl::cleanUpVarDecls() { } for (int i = 0; i < deletethese.size(); i++) { - chillAST_Node *par = deletethese[i]->parent; + chillAST_Node *par = deletethese[i]->getParent(); par->removeChild(par->findChild(deletethese[i])); } @@ -1405,9 +1405,7 @@ chillAST_Node *chillAST_UnaryOperator::constantFold() { returnval = I; } else { chillAST_FloatingLiteral *FL = (chillAST_FloatingLiteral *) getSubExpr(); - chillAST_FloatingLiteral *F = new chillAST_FloatingLiteral(FL); // clone - F->parent = FL->parent; - + chillAST_FloatingLiteral *F = (chillAST_FloatingLiteral*)(FL->clone()); // clone F->value = -F->value; returnval = F; } @@ -2045,12 +2043,12 @@ void findFunctionDeclRecursive(chillAST_Node *node, const char *procname, vector // this is where the children can be used effectively. // we don't really care what kind of node we're at. We just check the node itself // and then its children is needed. - int numc = node->children.size(); + int numc = node->getNumChildren(); for (int i = 0; i < numc; i++) { if (node->isSourceFile()) - if (node->children[i]->isFunctionDecl()) - chillAST_FunctionDecl *fd = (chillAST_FunctionDecl *) node->children[i]; - findFunctionDeclRecursive(node->children[i], procname, funcs); + if (node->getChild(i)->isFunctionDecl()) + chillAST_FunctionDecl *fd = (chillAST_FunctionDecl *) node->getChild(i); + findFunctionDeclRecursive(node->getChild(i), procname, funcs); } return; } |