diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-09-10 00:09:20 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-09-10 00:09:20 +0000 |
commit | 08e0bc16b3312c27e87d33be7dcf3d4fe5bdd2e2 (patch) | |
tree | 062040f563583f0cc41fe81fc95b3c3c6d643207 /tools/libclang/CIndex.cpp | |
parent | a1364be341550d71dff27dd8de0c6872ba6c707e (diff) |
Kill of the Decl::PCHLevel field entirely. We now only need to know
whether a Decl was deserialized from an AST file (any AST file).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139438 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/libclang/CIndex.cpp')
-rw-r--r-- | tools/libclang/CIndex.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index fcd6459d4f..e6e1b90534 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -183,11 +183,6 @@ class CursorVisitor : public DeclVisitor<CursorVisitor, bool>, /// \brief The opaque client data, to be passed along to the visitor. CXClientData ClientData; - // MaxPCHLevel - the maximum PCH level of declarations that we will pass on - // to the visitor. Declarations with a PCH level greater than this value will - // be suppressed. - unsigned MaxPCHLevel; - /// \brief Whether we should visit the preprocessing record entries last, /// after visiting other declarations. bool VisitPreprocessorLast; @@ -238,12 +233,11 @@ class CursorVisitor : public DeclVisitor<CursorVisitor, bool>, public: CursorVisitor(CXTranslationUnit TU, CXCursorVisitor Visitor, CXClientData ClientData, - unsigned MaxPCHLevel, bool VisitPreprocessorLast, SourceRange RegionOfInterest = SourceRange()) : TU(TU), AU(static_cast<ASTUnit*>(TU->TUData)), Visitor(Visitor), ClientData(ClientData), - MaxPCHLevel(MaxPCHLevel), VisitPreprocessorLast(VisitPreprocessorLast), + VisitPreprocessorLast(VisitPreprocessorLast), RegionOfInterest(RegionOfInterest), DI_current(0) { Parent.kind = CXCursor_NoDeclFound; @@ -375,9 +369,6 @@ bool CursorVisitor::Visit(CXCursor Cursor, bool CheckedRegionOfInterest) { if (clang_isDeclaration(Cursor.kind)) { Decl *D = getCursorDecl(Cursor); assert(D && "Invalid declaration cursor"); - if (D->getPCHLevel() > MaxPCHLevel) - return false; - if (D->isImplicit()) return false; } @@ -3030,7 +3021,6 @@ unsigned clang_visitChildren(CXCursor parent, CXCursorVisitor visitor, CXClientData client_data) { CursorVisitor CursorVis(getCursorTU(parent), visitor, client_data, - getCursorASTUnit(parent)->getMaxPCHLevel(), false); return CursorVis.VisitChildren(parent); } @@ -3527,7 +3517,8 @@ CXCursor clang_getCursor(CXTranslationUnit TU, CXSourceLocation Loc) { GetCursorData ResultData(CXXUnit->getSourceManager(), SLoc, Result); CXCursor Parent = clang_getTranslationUnitCursor(TU); CursorVisitor CursorVis(TU, GetCursorVisitor, &ResultData, - Decl::MaxPCHLevel, true, SourceLocation(SLoc)); + /*VisitPreprocessorLast=*/true, + SourceLocation(SLoc)); CursorVis.VisitChildren(Parent); } @@ -4564,8 +4555,7 @@ public: : Annotated(annotated), Tokens(tokens), Cursors(cursors), NumTokens(numTokens), TokIdx(0), PreprocessingTokIdx(0), AnnotateVis(tu, - AnnotateTokensVisitor, this, - Decl::MaxPCHLevel, true, RegionOfInterest), + AnnotateTokensVisitor, this, true, RegionOfInterest), SrcMgr(static_cast<ASTUnit*>(tu->TUData)->getSourceManager()), HasContextSensitiveKeywords(false) { } @@ -5029,7 +5019,7 @@ static void clang_annotateTokensImpl(void *UserData) { Tokens, NumTokens); CursorVisitor MacroArgMarker(TU, MarkMacroArgTokensVisitorDelegate, &Visitor, - Decl::MaxPCHLevel, true, RegionOfInterest); + true, RegionOfInterest); MacroArgMarker.visitPreprocessedEntitiesInRegion(); } |