@@ -84,7 +84,7 @@ bool isInCurFile(ASTContext *Context, const Stmt* S, string& filename){
8484
8585 vector<string>::iterator fileItr = find (includeList.begin (), includeList.end (), filename);
8686 bool ret = fileItr != includeList.end ();
87- if (debugPrint && S->getStmtClassName () == " CXXConstructExpr" ){
87+ if (debugPrint && S->getStmtClassName () == std::string ( " CXXConstructExpr" ) ){
8888 cerr << " context is is current file: " << ret << endl;
8989
9090 }
@@ -232,7 +232,7 @@ class ASTMatcherVisitor : public RecursiveASTVisitor<ASTMatcherVisitor> {
232232 bool DeclHelper (Decl *D){
233233
234234 const Stmt* parent = getStmtParent (D, Context);
235- const Stmt* parentsParent = getStmtParent (parent, Context);
235+ // const Stmt* parentsParent = getStmtParent(parent, Context);
236236
237237 // if it is part of the (init; condition; increment) of a for loop, we don't care about it
238238 if (isFlowControl (D, Context)){
@@ -443,7 +443,7 @@ class ASTMatcherVisitor : public RecursiveASTVisitor<ASTMatcherVisitor> {
443443 */
444444 void StmtHelper (Stmt *x){
445445 // variable used for <cond> </cond>
446- bool condition = false ;
446+ // bool condition = false;
447447 bool isElse = false ;
448448 if (x != NULL ){
449449 string output = " " ;
@@ -460,7 +460,7 @@ class ASTMatcherVisitor : public RecursiveASTVisitor<ASTMatcherVisitor> {
460460
461461 const Stmt* parent = getStmtParent (x, Context);
462462 // PROBLEM
463- if (x->getStmtClassName () != " ForStmt" && isFlowControl (x, Context)){
463+ if (x->getStmtClassName () != std::string ( " ForStmt" ) && isFlowControl (x, Context)){
464464 return ;
465465 }
466466
@@ -533,7 +533,7 @@ class ASTMatcherVisitor : public RecursiveASTVisitor<ASTMatcherVisitor> {
533533 }
534534
535535
536- if(parent != NULL && strcmp(parent->getStmtClassName(), "IfStmt") == 0){
536+ if(parent != NULL && strcmp(parent->getStmtClassName(), std::string( "IfStmt") ) == 0){
537537 if(debugPrint){
538538 cerr << "possibly an if statement" << endl;
539539 }
@@ -579,7 +579,7 @@ class ASTMatcherVisitor : public RecursiveASTVisitor<ASTMatcherVisitor> {
579579 }else if (node == " DoStmt" ){
580580 output += " <do" ;
581581 }else if (node == " IfStmt" ){
582- if (parent->getStmtClassName () != " IfStmt" ){
582+ if (parent->getStmtClassName () != std::string ( " IfStmt" ) ){
583583 intLevel += 1 ;
584584 stringstream ssif;
585585 ssif << intLevel;
@@ -621,7 +621,7 @@ class ASTMatcherVisitor : public RecursiveASTVisitor<ASTMatcherVisitor> {
621621 }
622622
623623 }else if (node == " CallExpr" ){
624- CallExpr* expr = (CallExpr*) x;
624+ // CallExpr* expr = (CallExpr*) x;
625625 output += " <Call" ;
626626 // output += "<calling func: ";
627627 // output += expr->getDirectCallee()->getNameInfo().getAsString();
@@ -641,7 +641,7 @@ class ASTMatcherVisitor : public RecursiveASTVisitor<ASTMatcherVisitor> {
641641
642642 string filename;
643643 if (isInCurFile (Context, CD, filename)){
644- CXXMethodDecl* MD = ce->getConstructor ();
644+ // CXXMethodDecl* MD = ce->getConstructor();
645645 output += " <Call " ;
646646 /*
647647 output += MD->getNameInfo().getAsString();
@@ -698,7 +698,7 @@ class ASTMatcherVisitor : public RecursiveASTVisitor<ASTMatcherVisitor> {
698698
699699 string filename;
700700 if (isInCurFile (Context, CD, filename)){
701- CXXMethodDecl* MD = ce->getConstructor ();
701+ // CXXMethodDecl* MD = ce->getConstructor();
702702
703703 output += " <Call " ;
704704 /*
@@ -718,7 +718,7 @@ class ASTMatcherVisitor : public RecursiveASTVisitor<ASTMatcherVisitor> {
718718 }
719719
720720 }else if (node == " DeclRefExpr" ){
721- if (parent != NULL && parent->getStmtClassName () == " ImplicitCastExpr" ){
721+ if (parent != NULL && parent->getStmtClassName () == std::string ( " ImplicitCastExpr" ) ){
722722 DeclRefExpr* dr = (DeclRefExpr*) x;
723723 ValueDecl* d = (ValueDecl*) dr->getDecl ();
724724 if (d != NULL ){
@@ -939,15 +939,15 @@ It can be a grandparent, great grand parent etc
939939
940940 const Stmt* parent = getStmtParent (S, Context);
941941 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;}
943943
944944
945- if (parent != NULL && S->getStmtClassName () == " IfStmt" && parent->getStmtClassName () == " IfStmt" ){
945+ if (parent != NULL && S->getStmtClassName () == std::string ( " IfStmt" ) && parent->getStmtClassName () == std::string ( " IfStmt" ) ){
946946 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" ) ){
951951 level += 2 ;
952952 }
953953 // FIX HERE - issues!
0 commit comments