diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-11-18 00:26:59 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-11-18 00:26:59 +0000 |
commit | 88c2596edc8eb475e20f6033de1ea01669695a0c (patch) | |
tree | 679107546ea3a40c67fda44db856d82616a08b6a /lib/Frontend | |
parent | b395c63b473bf1b3783bff371a993332e8c4c5e3 (diff) |
Change ASTConsumer::HandleTopLevelDecl to return true for the parser to continue
parsing or false to abort parsing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144943 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend')
-rw-r--r-- | lib/Frontend/ASTConsumers.cpp | 3 | ||||
-rw-r--r-- | lib/Frontend/ASTUnit.cpp | 6 | ||||
-rw-r--r-- | lib/Frontend/MultiplexConsumer.cpp | 3 |
3 files changed, 8 insertions, 4 deletions
diff --git a/lib/Frontend/ASTConsumers.cpp b/lib/Frontend/ASTConsumers.cpp index 54bb282728..390ae09497 100644 --- a/lib/Frontend/ASTConsumers.cpp +++ b/lib/Frontend/ASTConsumers.cpp @@ -66,9 +66,10 @@ namespace { this->Context = &Context; } - virtual void HandleTopLevelDecl(DeclGroupRef D) { + virtual bool HandleTopLevelDecl(DeclGroupRef D) { for (DeclGroupRef::iterator I = D.begin(), E = D.end(); I != E; ++I) HandleTopLevelSingleDecl(*I); + return true; } void HandleTopLevelSingleDecl(Decl *D); diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp index c59f2d16d2..6cd0784215 100644 --- a/lib/Frontend/ASTUnit.cpp +++ b/lib/Frontend/ASTUnit.cpp @@ -878,9 +878,10 @@ public: } } - void HandleTopLevelDecl(DeclGroupRef D) { + bool HandleTopLevelDecl(DeclGroupRef D) { for (DeclGroupRef::iterator it = D.begin(), ie = D.end(); it != ie; ++it) handleTopLevelDecl(*it); + return true; } // We're not interested in "interesting" decls. @@ -926,7 +927,7 @@ public: Hash = 0; } - virtual void HandleTopLevelDecl(DeclGroupRef D) { + virtual bool HandleTopLevelDecl(DeclGroupRef D) { for (DeclGroupRef::iterator it = D.begin(), ie = D.end(); it != ie; ++it) { Decl *D = *it; // FIXME: Currently ObjC method declarations are incorrectly being @@ -938,6 +939,7 @@ public: AddTopLevelDeclarationToHash(D, Hash); TopLevelDecls.push_back(D); } + return true; } virtual void HandleTranslationUnit(ASTContext &Ctx) { diff --git a/lib/Frontend/MultiplexConsumer.cpp b/lib/Frontend/MultiplexConsumer.cpp index 8e746f65a9..e7b886ccb6 100644 --- a/lib/Frontend/MultiplexConsumer.cpp +++ b/lib/Frontend/MultiplexConsumer.cpp @@ -183,9 +183,10 @@ void MultiplexConsumer::Initialize(ASTContext &Context) { Consumers[i]->Initialize(Context); } -void MultiplexConsumer::HandleTopLevelDecl(DeclGroupRef D) { +bool MultiplexConsumer::HandleTopLevelDecl(DeclGroupRef D) { for (size_t i = 0, e = Consumers.size(); i != e; ++i) Consumers[i]->HandleTopLevelDecl(D); + return true; } void MultiplexConsumer::HandleInterestingDecl(DeclGroupRef D) { |