From 79b47d47c0c8ecdce651024b41b9109f05593010 Mon Sep 17 00:00:00 2001 From: Tuowen Zhao Date: Fri, 30 Sep 2016 14:14:51 -0600 Subject: fixes --- include/chillAST/chillAST_node.hh | 3 ++- include/chillAST/chillASTs.hh | 17 ++++------------- 2 files changed, 6 insertions(+), 14 deletions(-) (limited to 'include/chillAST') diff --git a/include/chillAST/chillAST_node.hh b/include/chillAST/chillAST_node.hh index 4db00ce..ea9bf8b 100644 --- a/include/chillAST/chillAST_node.hh +++ b/include/chillAST/chillAST_node.hh @@ -39,7 +39,7 @@ protected: * Fix the pointer reference in a source file * @param nameMap a mapping from string to the corresponding declarations, stack is used to mimic scoping */ - void fixReference(std::map> nameMap); + void fixReference(std::map > nameMap); public: // TODO decide how to hide some data //! this Node's parent @@ -303,6 +303,7 @@ public: virtual void gatherVarUsage(std::vector &decls); + //! Gather all variable that is used as a lefthand side operand virtual void gatherVarLHSUsage(std::vector &decls) { fprintf(stderr, "(%s) forgot to implement gatherVarLHSUsage()\n", getTypeString()); }; diff --git a/include/chillAST/chillASTs.hh b/include/chillAST/chillASTs.hh index 795f12b..90f19e8 100644 --- a/include/chillAST/chillASTs.hh +++ b/include/chillAST/chillASTs.hh @@ -973,9 +973,9 @@ public: char *op; //! true for prefix unary operator bool prefix; - chillAST_Node *subexpr; // constructors + chillAST_UnaryOperator(); chillAST_UnaryOperator(const char *oper, bool pre, chillAST_Node *sub); // other methods particular to this type of node @@ -984,29 +984,20 @@ public: (!strcmp(op, "--"))); // are there more ??? TODO } + chillAST_Node* getSubExpr() { return getChild(0); } + void setSubExpr(chillAST_Node* sub) { setChild(0,sub); } + // required methods that I can't seem to get to inherit chillAST_Node *constantFold(); chillAST_Node *clone(); - void gatherVarDecls(std::vector &decls); - void gatherVarDeclsMore(std::vector &decls) { gatherVarDecls(decls); }; - void gatherScalarVarDecls(std::vector &decls); - - void gatherArrayVarDecls(std::vector &decls); - void gatherArrayRefs(std::vector &refs, bool writtento); // chillAST_UnaryOperator void gatherVarLHSUsage(std::vector &decls); - void replaceVarDecls(chillAST_VarDecl *olddecl, chillAST_VarDecl *newdecl); - - void gatherVarUsage(std::vector &decls); - - void gatherDeclRefExprs(std::vector &refs); - //void replaceVarDecls( chillAST_VarDecl *olddecl, chillAST_VarDecl *newdecl); bool findLoopIndexesToReplace(chillAST_SymbolTable *symtab, bool forcesync = false) { return false; }; // no loops under here -- cgit v1.2.3-70-g09d2