summaryrefslogtreecommitdiff
path: root/include/chillAST
diff options
context:
space:
mode:
Diffstat (limited to 'include/chillAST')
-rw-r--r--include/chillAST/chillAST_def.hh2
-rw-r--r--include/chillAST/chillAST_node.hh14
-rw-r--r--include/chillAST/chillASTs.hh20
3 files changed, 5 insertions, 31 deletions
diff --git a/include/chillAST/chillAST_def.hh b/include/chillAST/chillAST_def.hh
index 665f7ff..f336e14 100644
--- a/include/chillAST/chillAST_def.hh
+++ b/include/chillAST/chillAST_def.hh
@@ -14,7 +14,7 @@
#include <assert.h>
#include <vector> // std::vector
-#include <ir_enums.hh> // for IR_CONDITION_*
+#include <ir_enums.hh> // for IR_CONDITION_*
enum CHILLAST_NODE_TYPE {
CHILLAST_NODE_UNKNOWN = 0,
diff --git a/include/chillAST/chillAST_node.hh b/include/chillAST/chillAST_node.hh
index 2c4ee8d..80f1be4 100644
--- a/include/chillAST/chillAST_node.hh
+++ b/include/chillAST/chillAST_node.hh
@@ -4,12 +4,10 @@
#define _CHILLAST_NODE_H_
#include "chillAST_def.hh"
-#include "printer.h"
//! generic node of the actual chillAST, a multiway tree node.
class chillAST_Node {
public:
- friend class chill::printer::GenericPrinter;
// TODO decide how to hide some data
//! this Node's parent
chillAST_Node *parent;
@@ -121,8 +119,6 @@ public:
bool isCudaSYNCTHREADS() { return (getType() == CHILLAST_NODE_CUDASYNCTHREADS); };
- bool isDeclStmt() { return (getType() == CHILLAST_NODE_DECLSTMT); }; // doesn't exist
-
bool isConstant() {
return (getType() == CHILLAST_NODE_INTEGERLITERAL) || (getType() == CHILLAST_NODE_FLOATINGLITERAL);
}
@@ -168,7 +164,7 @@ public:
int getNumChildren() { return children.size(); };
- chillAST_NodeList& getChildren() { return children; }; // not usually useful
+ chillAST_NodeList* getChildren() { return &children; }; // not usually useful
void setChildren(chillAST_NodeList &c) { children = c; }; // does not set parent. probably should
chillAST_Node *getChild(int which) { return children[which]; };
@@ -406,12 +402,6 @@ public:
exit(-1);;
};
- //! Print AST
- virtual void dump(int indent = 0, FILE *fp = stderr) {
- fflush(fp);
- CHILL_ERROR("(%s) forgot to implement dump()\n", getTypeString());
- };// print ast
-
// TODO We might want to print the code a bit differently, This can be only a generic dump
//! Print CODE
virtual void print(int indent = 0, FILE *fp = stderr) {
@@ -546,6 +536,8 @@ public:
virtual chillAST_VarDecl* getParameter(const char * name);
virtual void addParameter(chillAST_VarDecl* name);
+ void dump(int indent=0,FILE *fp = stderr);
+
};
diff --git a/include/chillAST/chillASTs.hh b/include/chillAST/chillASTs.hh
index d61d183..7e32a3a 100644
--- a/include/chillAST/chillASTs.hh
+++ b/include/chillAST/chillASTs.hh
@@ -166,8 +166,6 @@ public:
chillAST_VarDecl(chillAST_RecordDecl *astruct, const char *n, const char *arraypart);
- void dump(int indent = 0, FILE *fp = stderr);
-
void print(int indent = 0, FILE *fp = stderr);
void printName(int indent = 0, FILE *fp = stderr);
@@ -294,8 +292,6 @@ public:
// required methods
void replaceChild(chillAST_Node *old, chillAST_Node *newchild);
- void dump(int indent = 0, FILE *fp = stderr);
-
void print(int indent = 0, FILE *fp = stderr);
chillAST_Node *constantFold();
@@ -374,7 +370,7 @@ public:
class chillAST_FunctionDecl : public chillAST_Node {
private:
- chillAST_CompoundStmt *body; // always a compound statement?
+ chillAST_CompoundStmt *body; // always a compound statement?
CHILLAST_FUNCTION_TYPE function_type; // CHILLAST_FUNCTION_CPU or CHILLAST_FUNCTION_GPU
bool externfunc; // function is external
bool builtin; // function is a builtin
@@ -456,7 +452,6 @@ public:
// constructors
chillAST_SourceFile(const char *filename); // defined in chill_ast.cc
- void dump(int indent = 0, FILE *fp = stderr); // print ast in chill_ast.cc
void print(int indent = 0, FILE *fp = stderr); // print CODE in chill_ast.cc
void printToFile(char *filename = NULL);
@@ -715,7 +710,6 @@ public:
// required methods that I can't seem to get to inherit
- void dump(int indent = 0, FILE *fp = stderr); // print CODE in chill_ast.cc
void print(int indent = 0, FILE *fp = stderr); // print CODE in chill_ast.cc
void printonly(int indent = 0, FILE *fp = stderr);
@@ -825,7 +819,6 @@ public:
// required methods that I can't seem to get to inherit
- void dump(int indent = 0, FILE *fp = stderr); // print CODE in chill_ast.cc
void print(int indent = 0, FILE *fp = stderr); // print CODE in chill_ast.cc
void printonly(int indent = 0, FILE *fp = stderr);
@@ -903,7 +896,6 @@ public:
void printonly(int indent = 0, FILE *fp = stderr);
void print(int indent = 0, FILE *fp = stderr) const; // print CODE in chill_ast.cc
- void dump(int indent = 0, FILE *fp = stderr); // print ast in chill_ast.cc
char *stringRep(int indent = 0);
chillAST_Node *constantFold();
@@ -1022,7 +1014,6 @@ public:
// required methods that I can't seem to get to inherit
void print(int indent = 0, FILE *fp = stderr); // print CODE in chill_ast.cc
- void dump(int indent = 0, FILE *fp = stderr); // print ast in chill_ast.cc
chillAST_Node *constantFold();
chillAST_Node *clone();
@@ -1080,7 +1071,6 @@ public:
// required methods that I can't seem to get to inherit
void print(int indent = 0, FILE *fp = stderr); // print CODE in chill_ast.cc
- void dump(int indent = 0, FILE *fp = stderr); // print ast in chill_ast.cc
chillAST_Node *constantFold();
chillAST_Node *clone();
@@ -1126,7 +1116,6 @@ public:
// required methods that I can't seem to get to inherit
void print(int indent = 0, FILE *fp = stderr); // print CODE in chill_ast.cc
- void dump(int indent = 0, FILE *fp = stderr); // print ast in chill_ast.cc
chillAST_Node *constantFold();
chillAST_Node *clone();
@@ -1222,7 +1211,6 @@ public:
void replaceChild(chillAST_Node *old, chillAST_Node *newchild);
void print(int indent = 0, FILE *fp = stderr); // print CODE in chill_ast.cc
- void dump(int indent = 0, FILE *fp = stderr); // print ast in chill_ast.cc
chillAST_Node *constantFold();
chillAST_Node *clone();
@@ -1266,7 +1254,6 @@ public:
// required methods that I can't seem to get to inherit
void print(int indent = 0, FILE *fp = stderr); // print CODE in chill_ast.cc
- void dump(int indent = 0, FILE *fp = stderr); // print ast in chill_ast.cc
chillAST_Node *constantFold();
chillAST_Node *clone();
@@ -1348,7 +1335,6 @@ public:
// required methods that I can't seem to get to inherit
void print(int indent = 0, FILE *fp = stderr); // print CODE in chill_ast.cc
- void dump(int indent = 0, FILE *fp = stderr); // print ast in chill_ast.cc
chillAST_Node *constantFold();
chillAST_Node *clone();
@@ -1477,7 +1463,6 @@ public:
// required methods that I can't seem to get to inherit
void print(int indent = 0, FILE *fp = stderr); // print CODE in chill_ast.cc
- void dump(int indent = 0, FILE *fp = stderr); // print ast in chill_ast.cc
//chillAST_Node* constantFold() {};
//chillAST_Node* clone();
//void gatherArrayRefs( std::vector<chillAST_ArraySubscriptExpr*> &refs, bool writtento ){};
@@ -1555,7 +1540,6 @@ public:
chillAST_Node *constantFold();
void print(int indent = 0, FILE *fp = stderr); // print CODE in chill_ast.cc
- void dump(int indent = 0, FILE *fp = stderr); // print ast in chill_ast.cc
void gatherArrayRefs(std::vector<chillAST_ArraySubscriptExpr *> &refs, bool writtento);
void gatherScalarRefs(std::vector<chillAST_DeclRefExpr *> &refs, bool writtento);
@@ -1593,7 +1577,6 @@ public:
// required methods that I can't seem to get to inherit
void print(int indent = 0, FILE *fp = stderr); // print CODE in chill_ast.cc
- void dump(int indent = 0, FILE *fp = stderr); // print ast in chill_ast.cc
chillAST_Node *constantFold();
chillAST_Node *clone();
@@ -1637,7 +1620,6 @@ public:
// required methods that I can't seem to get to inherit
void print(int indent = 0, FILE *fp = stderr); // print CODE in chill_ast.cc
- void dump(int indent = 0, FILE *fp = stderr); // print ast in chill_ast.cc
chillAST_Node *constantFold();
chillAST_Node *clone();