diff options
| author | David Blaikie <dblaikie@gmail.com> | 2014-07-16 23:52:46 +0000 |
|---|---|---|
| committer | David Blaikie <dblaikie@gmail.com> | 2014-07-16 23:52:46 +0000 |
| commit | 1326975496dea765966b873e681910b094916a91 (patch) | |
| tree | 2c06e3994bb7569a9f1b19f06a3112a701552b86 /clang | |
| parent | 13690037ffcacb740172f1013f1df0e02b62d350 (diff) | |
| download | bcm5719-llvm-1326975496dea765966b873e681910b094916a91.tar.gz bcm5719-llvm-1326975496dea765966b873e681910b094916a91.zip | |
DebugInfo: Forward HandleTagDeclRequiredDefinition through MultiplexConsumer to fix debug info emission in the presence of plugins.
When plugins are used the Multiplex(AST)Consumer is employed to dispatch
to both the plugin ASTConsumers and the IRGen ASTConsumer. It wasn't
dispatching a critical call for debug info, resulting in plugin users
having a negative debugging experience.
While I'm here, forward a bunch of other missing calls through the
consumer that seem like they should be there.
To test this, use the example plugin (requires plugins and examples) and
split the test case up so that the plugin testing can be done under that
requirement while the non-plugin testing will execute even in builds
that don't include plugin support or examples.
llvm-svn: 213213
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/include/clang/Frontend/MultiplexConsumer.h | 6 | ||||
| -rw-r--r-- | clang/lib/Frontend/MultiplexConsumer.cpp | 25 | ||||
| -rw-r--r-- | clang/test/CodeGenCXX/Inputs/debug-info-class-limited.cpp (renamed from clang/test/CodeGenCXX/debug-info-class-limited.cpp) | 1 | ||||
| -rw-r--r-- | clang/test/CodeGenCXX/debug-info-class-limited-plugin.test | 2 | ||||
| -rw-r--r-- | clang/test/CodeGenCXX/debug-info-class-limited.test | 1 |
5 files changed, 34 insertions, 1 deletions
diff --git a/clang/include/clang/Frontend/MultiplexConsumer.h b/clang/include/clang/Frontend/MultiplexConsumer.h index a7e0444885f..4d31104cce1 100644 --- a/clang/include/clang/Frontend/MultiplexConsumer.h +++ b/clang/include/clang/Frontend/MultiplexConsumer.h @@ -40,8 +40,14 @@ public: void HandleInterestingDecl(DeclGroupRef D) override; void HandleTranslationUnit(ASTContext &Ctx) override; void HandleTagDeclDefinition(TagDecl *D) override; + void HandleTagDeclRequiredDefinition(const TagDecl *D) override; void HandleCXXImplicitFunctionInstantiation(FunctionDecl *D) override; void HandleTopLevelDeclInObjCContainer(DeclGroupRef D) override; + void HandleImplicitImportDecl(ImportDecl *D) override; + void HandleLinkerOptionPragma(llvm::StringRef Opts) override; + void HandleDetectMismatch(llvm::StringRef Name, + llvm::StringRef Value) override; + void HandleDependentLibrary(llvm::StringRef Lib) override; void CompleteTentativeDefinition(VarDecl *D) override; void HandleVTable(CXXRecordDecl *RD, bool DefinitionRequired) override; ASTMutationListener *GetASTMutationListener() override; diff --git a/clang/lib/Frontend/MultiplexConsumer.cpp b/clang/lib/Frontend/MultiplexConsumer.cpp index 058cee8244b..0e933a3f165 100644 --- a/clang/lib/Frontend/MultiplexConsumer.cpp +++ b/clang/lib/Frontend/MultiplexConsumer.cpp @@ -251,6 +251,11 @@ void MultiplexConsumer::HandleTagDeclDefinition(TagDecl *D) { Consumers[i]->HandleTagDeclDefinition(D); } +void MultiplexConsumer::HandleTagDeclRequiredDefinition(const TagDecl *D) { + for (size_t i = 0, e = Consumers.size(); i != e; ++i) + Consumers[i]->HandleTagDeclRequiredDefinition(D); +} + void MultiplexConsumer::HandleCXXImplicitFunctionInstantiation(FunctionDecl *D){ for (size_t i = 0, e = Consumers.size(); i != e; ++i) Consumers[i]->HandleCXXImplicitFunctionInstantiation(D); @@ -261,6 +266,26 @@ void MultiplexConsumer::HandleTopLevelDeclInObjCContainer(DeclGroupRef D) { Consumers[i]->HandleTopLevelDeclInObjCContainer(D); } +void MultiplexConsumer::HandleImplicitImportDecl(ImportDecl *D) { + for (size_t i = 0, e = Consumers.size(); i != e; ++i) + Consumers[i]->HandleImplicitImportDecl(D); +} + +void MultiplexConsumer::HandleLinkerOptionPragma(llvm::StringRef Opts) { + for (size_t i = 0, e = Consumers.size(); i != e; ++i) + Consumers[i]->HandleLinkerOptionPragma(Opts); +} + +void MultiplexConsumer::HandleDetectMismatch(llvm::StringRef Name, llvm::StringRef Value) { + for (size_t i = 0, e = Consumers.size(); i != e; ++i) + Consumers[i]->HandleDetectMismatch(Name, Value); +} + +void MultiplexConsumer::HandleDependentLibrary(llvm::StringRef Lib) { + for (size_t i = 0, e = Consumers.size(); i != e; ++i) + Consumers[i]->HandleDependentLibrary(Lib); +} + void MultiplexConsumer::CompleteTentativeDefinition(VarDecl *D) { for (size_t i = 0, e = Consumers.size(); i != e; ++i) Consumers[i]->CompleteTentativeDefinition(D); diff --git a/clang/test/CodeGenCXX/debug-info-class-limited.cpp b/clang/test/CodeGenCXX/Inputs/debug-info-class-limited.cpp index 92326f7b539..31a026101bb 100644 --- a/clang/test/CodeGenCXX/debug-info-class-limited.cpp +++ b/clang/test/CodeGenCXX/Inputs/debug-info-class-limited.cpp @@ -1,4 +1,3 @@ -// RUN: %clang -emit-llvm -fno-standalone-debug -g -S %s -o - | FileCheck %s // CHECK-DAG: [ DW_TAG_structure_type ] [PR16214] [line [[@LINE+1]], {{.*}} [def] struct PR16214 { diff --git a/clang/test/CodeGenCXX/debug-info-class-limited-plugin.test b/clang/test/CodeGenCXX/debug-info-class-limited-plugin.test new file mode 100644 index 00000000000..61d258d9ffc --- /dev/null +++ b/clang/test/CodeGenCXX/debug-info-class-limited-plugin.test @@ -0,0 +1,2 @@ +RUN: %clang_cc1 -emit-llvm -fno-standalone-debug -g -o - -load %llvmshlibdir/PrintFunctionNames%pluginext -add-plugin print-function-names %S/Inputs/debug-info-class-limited.cpp 2>&1 | FileCheck %S/Inputs/debug-info-class-limited.cpp +REQUIRES: plugins, examples diff --git a/clang/test/CodeGenCXX/debug-info-class-limited.test b/clang/test/CodeGenCXX/debug-info-class-limited.test new file mode 100644 index 00000000000..0b10728f3c9 --- /dev/null +++ b/clang/test/CodeGenCXX/debug-info-class-limited.test @@ -0,0 +1 @@ +RUN: %clang_cc1 -emit-llvm -fno-standalone-debug -g %S/Inputs/debug-info-class-limited.cpp -o - | FileCheck %S/Inputs/debug-info-class-limited.cpp |

