forked from OSchip/llvm-project
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
This commit is contained in:
parent
13690037ff
commit
1326975496
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 {
|
|
@ -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
|
|
@ -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
|
Loading…
Reference in New Issue