Created
April 25, 2013 00:39
-
-
Save andydude/5456709 to your computer and use it in GitHub Desktop.
My attempt at adding a function to help with the bubbling phase of walking the AST.
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
unsigned clang_visitChildrenWithPost(CXCursor parent, | |
CXCursorVisitor visitor, | |
CXPostChildrenVisitor post_visitor, | |
CXClientData client_data) { | |
clang::cxcursor::CursorVisitor CursorVis(clang_Cursor_getTranslationUnit(parent), visitor, client_data, | |
/*VisitPreprocessorLast=*/false, | |
/*VisitIncludedPreprocessingEntries=*/false, | |
/*RegionOfInterest=*/clang::SourceRange(), | |
/*VisitDeclsOnly=*/false, | |
/*PostChildrenVisitor=*/post_visitor); | |
return CursorVis.VisitChildren(parent); | |
} |
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
#ifdef __cplusplus | |
extern "C" { | |
#endif | |
typedef bool CXPostChildVisitResult; | |
bool CXPostChildVisit_Continue = false; | |
bool CXPostChildVisit_Break = true; | |
// copy of | |
// clang::cxcursor::CursorVisitor::PostChildrenVisitorTy | |
typedef CXPostChildVisitResult (*CXPostChildrenVisitor)(CXCursor cursor, CXClientData client_data); | |
unsigned clang_visitChildrenWithPost(CXCursor parent, | |
CXCursorVisitor visitor, | |
CXPostChildrenVisitor post_visitor, | |
CXClientData client_data); | |
#ifdef __cplusplus | |
} | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment