@@ -84,7 +84,7 @@ bool isInCurFile(ASTContext *Context, const Stmt* S, string& filename){
84
84
85
85
vector<string>::iterator fileItr = find (includeList.begin (), includeList.end (), filename);
86
86
bool ret = fileItr != includeList.end ();
87
- if (debugPrint && S->getStmtClassName () == " CXXConstructExpr" ){
87
+ if (debugPrint && S->getStmtClassName () == std::string ( " CXXConstructExpr" ) ){
88
88
cerr << " context is is current file: " << ret << endl;
89
89
90
90
}
@@ -232,7 +232,7 @@ class ASTMatcherVisitor : public RecursiveASTVisitor<ASTMatcherVisitor> {
232
232
bool DeclHelper (Decl *D){
233
233
234
234
const Stmt* parent = getStmtParent (D, Context);
235
- const Stmt* parentsParent = getStmtParent (parent, Context);
235
+ // const Stmt* parentsParent = getStmtParent(parent, Context);
236
236
237
237
// if it is part of the (init; condition; increment) of a for loop, we don't care about it
238
238
if (isFlowControl (D, Context)){
@@ -443,7 +443,7 @@ class ASTMatcherVisitor : public RecursiveASTVisitor<ASTMatcherVisitor> {
443
443
*/
444
444
void StmtHelper (Stmt *x){
445
445
// variable used for <cond> </cond>
446
- bool condition = false ;
446
+ // bool condition = false;
447
447
bool isElse = false ;
448
448
if (x != NULL ){
449
449
string output = " " ;
@@ -460,7 +460,7 @@ class ASTMatcherVisitor : public RecursiveASTVisitor<ASTMatcherVisitor> {
460
460
461
461
const Stmt* parent = getStmtParent (x, Context);
462
462
// PROBLEM
463
- if (x->getStmtClassName () != " ForStmt" && isFlowControl (x, Context)){
463
+ if (x->getStmtClassName () != std::string ( " ForStmt" ) && isFlowControl (x, Context)){
464
464
return ;
465
465
}
466
466
@@ -533,7 +533,7 @@ class ASTMatcherVisitor : public RecursiveASTVisitor<ASTMatcherVisitor> {
533
533
}
534
534
535
535
536
- if(parent != NULL && strcmp(parent->getStmtClassName(), "IfStmt") == 0){
536
+ if(parent != NULL && strcmp(parent->getStmtClassName(), std::string( "IfStmt") ) == 0){
537
537
if(debugPrint){
538
538
cerr << "possibly an if statement" << endl;
539
539
}
@@ -579,7 +579,7 @@ class ASTMatcherVisitor : public RecursiveASTVisitor<ASTMatcherVisitor> {
579
579
}else if (node == " DoStmt" ){
580
580
output += " <do" ;
581
581
}else if (node == " IfStmt" ){
582
- if (parent->getStmtClassName () != " IfStmt" ){
582
+ if (parent->getStmtClassName () != std::string ( " IfStmt" ) ){
583
583
intLevel += 1 ;
584
584
stringstream ssif;
585
585
ssif << intLevel;
@@ -621,7 +621,7 @@ class ASTMatcherVisitor : public RecursiveASTVisitor<ASTMatcherVisitor> {
621
621
}
622
622
623
623
}else if (node == " CallExpr" ){
624
- CallExpr* expr = (CallExpr*) x;
624
+ // CallExpr* expr = (CallExpr*) x;
625
625
output += " <Call" ;
626
626
// output += "<calling func: ";
627
627
// output += expr->getDirectCallee()->getNameInfo().getAsString();
@@ -641,7 +641,7 @@ class ASTMatcherVisitor : public RecursiveASTVisitor<ASTMatcherVisitor> {
641
641
642
642
string filename;
643
643
if (isInCurFile (Context, CD, filename)){
644
- CXXMethodDecl* MD = ce->getConstructor ();
644
+ // CXXMethodDecl* MD = ce->getConstructor();
645
645
output += " <Call " ;
646
646
/*
647
647
output += MD->getNameInfo().getAsString();
@@ -698,7 +698,7 @@ class ASTMatcherVisitor : public RecursiveASTVisitor<ASTMatcherVisitor> {
698
698
699
699
string filename;
700
700
if (isInCurFile (Context, CD, filename)){
701
- CXXMethodDecl* MD = ce->getConstructor ();
701
+ // CXXMethodDecl* MD = ce->getConstructor();
702
702
703
703
output += " <Call " ;
704
704
/*
@@ -718,7 +718,7 @@ class ASTMatcherVisitor : public RecursiveASTVisitor<ASTMatcherVisitor> {
718
718
}
719
719
720
720
}else if (node == " DeclRefExpr" ){
721
- if (parent != NULL && parent->getStmtClassName () == " ImplicitCastExpr" ){
721
+ if (parent != NULL && parent->getStmtClassName () == std::string ( " ImplicitCastExpr" ) ){
722
722
DeclRefExpr* dr = (DeclRefExpr*) x;
723
723
ValueDecl* d = (ValueDecl*) dr->getDecl ();
724
724
if (d != NULL ){
@@ -939,15 +939,15 @@ It can be a grandparent, great grand parent etc
939
939
940
940
const Stmt* parent = getStmtParent (S, Context);
941
941
const Stmt* gp = getStmtParent (parent, Context);
942
- // if(gp != NULL && parent != NULL && parent->getStmtClassName() == "IfStmt" && S->getStmtClassName() == "CompoundStmt"){ cout << gp->getStmtClassName() << endl;}
942
+ // if(gp != NULL && parent != NULL && parent->getStmtClassName() == std::string( "IfStmt") && S->getStmtClassName() == std::string( "CompoundStmt") ){ cout << gp->getStmtClassName() << endl;}
943
943
944
944
945
- if (parent != NULL && S->getStmtClassName () == " IfStmt" && parent->getStmtClassName () == " IfStmt" ){
945
+ if (parent != NULL && S->getStmtClassName () == std::string ( " IfStmt" ) && parent->getStmtClassName () == std::string ( " IfStmt" ) ){
946
946
level += 1 ;
947
- }else if (S->getStmtClassName () == " CompoundStmt" && gp != NULL && gp->getStmtClassName () == " IfStmt"
948
- && parent != NULL && parent->getStmtClassName () == " IfStmt" ){
949
- level = level;
950
- }else if (parent != NULL && parent->getStmtClassName () == " IfStmt" ){
947
+ }else if (S->getStmtClassName () == std::string ( " CompoundStmt" ) && gp != NULL && gp->getStmtClassName () == std::string ( " IfStmt" )
948
+ && parent != NULL && parent->getStmtClassName () == std::string ( " IfStmt" ) ){
949
+ // level = level;
950
+ }else if (parent != NULL && parent->getStmtClassName () == std::string ( " IfStmt" ) ){
951
951
level += 2 ;
952
952
}
953
953
// FIX HERE - issues!
0 commit comments