omp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FunctionASTVisitor : public RecursiveASTVisitor<FunctionASTVisitor> { | |
using Base = RecursiveASTVisitor<FunctionASTVisitor>; | |
public: | |
bool VisitOMPExecDir(OMPExecDir *D) { | |
OmpStructuredStmts.emplace_back(D.getStructuredStmt()); | |
} | |
bool VisitSOMETHINGELSE(???) { | |
if(InOmpStructuredStmt) | |
HI! | |
} | |
bool TraverseStmt(Stmt *Node) { | |
if (!Node) | |
return Base::TraverseStmt(Node); | |
if (OmpStructuredStmts.back() == Node) | |
++InOmpStructuredStmt; | |
Base::TraverseStmt(Node); | |
if (OmpStructuredStmts.back() == Node) { | |
OmpStructuredStmts.pop_back(); | |
--InOmpStructuredStmt; | |
} | |
return true; | |
} | |
std::vector<Stmt*> OmpStructuredStmts; | |
int InOmpStructuredStmt = 0; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment