Created
March 4, 2019 21:42
-
-
Save LebedevRI/ebf23be1fe0b984423b9ee7d4f78d010 to your computer and use it in GitHub Desktop.
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