summaryrefslogtreecommitdiff
path: root/src/printer
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2016-09-30 15:34:03 -0600
committerTuowen Zhao <ztuowen@gmail.com>2016-09-30 15:34:03 -0600
commit2028f3ddc680b3af6476ace8840d6bcc85b88d73 (patch)
tree974b38bcaac5ef599fb22d60d660529e1a000c01 /src/printer
parent79b47d47c0c8ecdce651024b41b9109f05593010 (diff)
downloadchill-2028f3ddc680b3af6476ace8840d6bcc85b88d73.tar.gz
chill-2028f3ddc680b3af6476ace8840d6bcc85b88d73.tar.bz2
chill-2028f3ddc680b3af6476ace8840d6bcc85b88d73.zip
children cont.
Diffstat (limited to 'src/printer')
-rw-r--r--src/printer/cfamily.cpp20
-rw-r--r--src/printer/dump.cpp24
2 files changed, 22 insertions, 22 deletions
diff --git a/src/printer/cfamily.cpp b/src/printer/cfamily.cpp
index 5c56bd7..3427c80 100644
--- a/src/printer/cfamily.cpp
+++ b/src/printer/cfamily.cpp
@@ -117,7 +117,7 @@ int CFamily::getPrecS(chillAST_CStyleAddressOf *n) {
void CFamily::printS(std::string ident, chillAST_CStyleAddressOf *n, std::ostream &o) {
int prec = getPrec(n);
- printPrec(ident, n->subexpr, o, prec);
+ printPrec(ident, n->getSubExpr(), o, prec);
}
int CFamily::getPrecS(chillAST_CStyleCastExpr *n) {
@@ -126,7 +126,7 @@ int CFamily::getPrecS(chillAST_CStyleCastExpr *n) {
void CFamily::printS(std::string ident, chillAST_CStyleCastExpr *n, std::ostream &o) {
o << "(" << n->towhat << ")";
- printPrec(ident, n->subexpr, o, getPrec(n));
+ printPrec(ident, n->getSubExpr(), o, getPrec(n));
}
void CFamily::printS(std::string ident, chillAST_CudaFree *n, std::ostream &o) {
@@ -139,9 +139,9 @@ void CFamily::printS(std::string ident, chillAST_CudaKernelCall *n, std::ostream
void CFamily::printS(std::string ident, chillAST_CudaMalloc *n, std::ostream &o) {
o << "cudaMalloc(";
- print(ident, n->devPtr, o);
+ print(ident, n->getDevPtr(), o);
o << ", ";
- print(ident, n->sizeinbytes, o);
+ print(ident, n->getSize(), o);
o << ")";
}
@@ -227,7 +227,7 @@ void CFamily::printS(std::string ident, chillAST_IfStmt *n, std::ostream &o) {
CHILL_ERROR("Then part is not a CompoundStmt!\n");
if (n->getElse()) {
o << "else ";
- print(ident, n->elsepart, o);
+ print(ident, n->getElse(), o);
}
}
@@ -236,7 +236,7 @@ void CFamily::printS(std::string ident, chillAST_IntegerLiteral *n, std::ostream
}
void CFamily::printS(std::string ident, chillAST_ImplicitCastExpr *n, std::ostream &o) {
- print(ident, n->subexpr, o);
+ print(ident, n->getSubExpr(), o);
}
void CFamily::printS(std::string ident, chillAST_MacroDefinition *n, std::ostream &o) {
@@ -254,7 +254,7 @@ void CFamily::printS(std::string ident, chillAST_MacroDefinition *n, std::ostrea
void CFamily::printS(std::string ident, chillAST_Malloc *n, std::ostream &o) {
o << "malloc(";
- print(ident, n->sizeexpr, o);
+ print(ident, n->getSize(), o);
o << ")";
}
@@ -276,7 +276,7 @@ void CFamily::printS(std::string ident, chillAST_NoOp *n, std::ostream &o) {}
void CFamily::printS(std::string ident, chillAST_ParenExpr *n, std::ostream &o) {
o << "(";
- print(ident, n->subexpr, o);
+ print(ident, n->getSubExpr(), o);
o << ")";
}
@@ -304,9 +304,9 @@ void CFamily::printS(std::string ident, chillAST_RecordDecl *n, std::ostream &o)
void CFamily::printS(std::string ident, chillAST_ReturnStmt *n, std::ostream &o) {
o << "return";
- if (n->returnvalue) {
+ if (n->getRetVal()) {
o << " ";
- print(ident, n->returnvalue, o);
+ print(ident, n->getRetVal(), o);
}
}
diff --git a/src/printer/dump.cpp b/src/printer/dump.cpp
index 059e56f..0e66f29 100644
--- a/src/printer/dump.cpp
+++ b/src/printer/dump.cpp
@@ -79,12 +79,12 @@ void Dump::printS(std::string ident, chillAST_CompoundStmt *n, std::ostream &o)
}
void Dump::printS(std::string ident, chillAST_CStyleAddressOf *n, std::ostream &o) {
- print(ident, n->subexpr, o);
+ print(ident, n->getSubExpr(), o);
}
void Dump::printS(std::string ident, chillAST_CStyleCastExpr *n, std::ostream &o) {
o << n->towhat << " ";
- print(ident, n->subexpr, o);
+ print(ident, n->getSubExpr(), o);
}
void Dump::printS(std::string ident, chillAST_CudaFree *n, std::ostream &o) {
@@ -96,8 +96,8 @@ void Dump::printS(std::string ident, chillAST_CudaKernelCall *n, std::ostream &o
}
void Dump::printS(std::string ident, chillAST_CudaMalloc *n, std::ostream &o) {
- print(ident, n->devPtr, o);
- print(ident, n->sizeinbytes, o);
+ print(ident, n->getDevPtr(), o);
+ print(ident, n->getSize(), o);
}
void Dump::printS(std::string ident, chillAST_CudaMemcpy *n, std::ostream &o) {
@@ -141,10 +141,10 @@ void Dump::printS(std::string ident, chillAST_FunctionDecl *n, std::ostream &o)
}
void Dump::printS(std::string ident, chillAST_IfStmt *n, std::ostream &o) {
- print(ident, n->cond, o);
- print(ident, n->thenpart, o);
- if (n->elsepart)
- print(ident, n->elsepart, o);
+ print(ident, n->getCond(), o);
+ print(ident, n->getThen(), o);
+ if (n->getElse())
+ print(ident, n->getElse(), o);
}
void Dump::printS(std::string ident, chillAST_IntegerLiteral *n, std::ostream &o) {
@@ -152,7 +152,7 @@ void Dump::printS(std::string ident, chillAST_IntegerLiteral *n, std::ostream &o
}
void Dump::printS(std::string ident, chillAST_ImplicitCastExpr *n, std::ostream &o) {
- print(ident, n->subexpr, o);
+ print(ident, n->getSubExpr(), o);
}
void Dump::printS(std::string ident, chillAST_MacroDefinition *n, std::ostream &o) {
@@ -162,7 +162,7 @@ void Dump::printS(std::string ident, chillAST_MacroDefinition *n, std::ostream &
}
void Dump::printS(std::string ident, chillAST_Malloc *n, std::ostream &o) {
- print(ident, n->sizeexpr, o);
+ print(ident, n->getSize(), o);
}
void Dump::printS(std::string ident, chillAST_MemberExpr *n, std::ostream &o) {
@@ -179,7 +179,7 @@ void Dump::printS(std::string ident, chillAST_NULL *n, std::ostream &o) {
void Dump::printS(std::string ident, chillAST_NoOp *n, std::ostream &o) {}
void Dump::printS(std::string ident, chillAST_ParenExpr *n, std::ostream &o) {
- print(ident, n->subexpr, o);
+ print(ident, n->getSubExpr(), o);
}
void Dump::printS(std::string ident, chillAST_Preprocessing *n, std::ostream &o) {}
@@ -192,7 +192,7 @@ void Dump::printS(std::string ident, chillAST_RecordDecl *n, std::ostream &o) {
}
void Dump::printS(std::string ident, chillAST_ReturnStmt *n, std::ostream &o) {
- if (n->returnvalue) print(ident, n->returnvalue, o);
+ if (n->getRetVal()) print(ident, n->getRetVal(), o);
}
void Dump::printS(std::string ident, chillAST_Sizeof *n, std::ostream &o) {