<div dir="ltr">Thanks for the catch!<br><br>Fixed in <span style="color:rgb(0,0,0)">r271188</span></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 25, 2016 at 10:28 AM, Nico Weber <span dir="ltr"><<a href="mailto:thakis@chromium.org" target="_blank">thakis@chromium.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span class="">Zombie review comment: ".test" isn't part of test/lit.cfg::config.suffixes, so the two .test files added in this change never run unless you explicitly run them (e.g. with `bin/llvm-lit ../llvm-rw/tools/clang/test/CodeGenCXX/*.test`). CodeGenCXX/debug-info-class-limited.test fails when I run it like that.<br><div><br></div></span><div>(resending with cfe-commits address changed to new address)</div></div><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Wed, Jul 16, 2014 at 7:52 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br></span><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: dblaikie<br>
Date: Wed Jul 16 18:52:46 2014<br>
New Revision: 213213<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=213213&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=213213&view=rev</a><br>
Log:<br>
DebugInfo: Forward HandleTagDeclRequiredDefinition through MultiplexConsumer to fix debug info emission in the presence of plugins.<br>
<br>
When plugins are used the Multiplex(AST)Consumer is employed to dispatch<br>
to both the plugin ASTConsumers and the IRGen ASTConsumer. It wasn't<br>
dispatching a critical call for debug info, resulting in plugin users<br>
having a negative debugging experience.<br>
<br>
While I'm here, forward a bunch of other missing calls through the<br>
consumer that seem like they should be there.<br>
<br>
To test this, use the example plugin (requires plugins and examples) and<br>
split the test case up so that the plugin testing can be done under that<br>
requirement while the non-plugin testing will execute even in builds<br>
that don't include plugin support or examples.<br>
<br>
Added:<br>
cfe/trunk/test/CodeGenCXX/Inputs/debug-info-class-limited.cpp<br>
- copied, changed from r213212, cfe/trunk/test/CodeGenCXX/debug-info-class-limited.cpp<br>
cfe/trunk/test/CodeGenCXX/debug-info-class-limited-plugin.test<br>
cfe/trunk/test/CodeGenCXX/debug-info-class-limited.test<br>
Removed:<br>
cfe/trunk/test/CodeGenCXX/debug-info-class-limited.cpp<br>
Modified:<br>
cfe/trunk/include/clang/Frontend/MultiplexConsumer.h<br>
cfe/trunk/lib/Frontend/MultiplexConsumer.cpp<br>
<br>
Modified: cfe/trunk/include/clang/Frontend/MultiplexConsumer.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/MultiplexConsumer.h?rev=213213&r1=213212&r2=213213&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/MultiplexConsumer.h?rev=213213&r1=213212&r2=213213&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/Frontend/MultiplexConsumer.h (original)<br>
+++ cfe/trunk/include/clang/Frontend/MultiplexConsumer.h Wed Jul 16 18:52:46 2014<br>
@@ -40,8 +40,14 @@ public:<br>
void HandleInterestingDecl(DeclGroupRef D) override;<br>
void HandleTranslationUnit(ASTContext &Ctx) override;<br>
void HandleTagDeclDefinition(TagDecl *D) override;<br>
+ void HandleTagDeclRequiredDefinition(const TagDecl *D) override;<br>
void HandleCXXImplicitFunctionInstantiation(FunctionDecl *D) override;<br>
void HandleTopLevelDeclInObjCContainer(DeclGroupRef D) override;<br>
+ void HandleImplicitImportDecl(ImportDecl *D) override;<br>
+ void HandleLinkerOptionPragma(llvm::StringRef Opts) override;<br>
+ void HandleDetectMismatch(llvm::StringRef Name,<br>
+ llvm::StringRef Value) override;<br>
+ void HandleDependentLibrary(llvm::StringRef Lib) override;<br>
void CompleteTentativeDefinition(VarDecl *D) override;<br>
void HandleVTable(CXXRecordDecl *RD, bool DefinitionRequired) override;<br>
ASTMutationListener *GetASTMutationListener() override;<br>
<br>
Modified: cfe/trunk/lib/Frontend/MultiplexConsumer.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/MultiplexConsumer.cpp?rev=213213&r1=213212&r2=213213&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/MultiplexConsumer.cpp?rev=213213&r1=213212&r2=213213&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Frontend/MultiplexConsumer.cpp (original)<br>
+++ cfe/trunk/lib/Frontend/MultiplexConsumer.cpp Wed Jul 16 18:52:46 2014<br>
@@ -251,6 +251,11 @@ void MultiplexConsumer::HandleTagDeclDef<br>
Consumers[i]->HandleTagDeclDefinition(D);<br>
}<br>
<br>
+void MultiplexConsumer::HandleTagDeclRequiredDefinition(const TagDecl *D) {<br>
+ for (size_t i = 0, e = Consumers.size(); i != e; ++i)<br>
+ Consumers[i]->HandleTagDeclRequiredDefinition(D);<br>
+}<br>
+<br>
void MultiplexConsumer::HandleCXXImplicitFunctionInstantiation(FunctionDecl *D){<br>
for (size_t i = 0, e = Consumers.size(); i != e; ++i)<br>
Consumers[i]->HandleCXXImplicitFunctionInstantiation(D);<br>
@@ -261,6 +266,26 @@ void MultiplexConsumer::HandleTopLevelDe<br>
Consumers[i]->HandleTopLevelDeclInObjCContainer(D);<br>
}<br>
<br>
+void MultiplexConsumer::HandleImplicitImportDecl(ImportDecl *D) {<br>
+ for (size_t i = 0, e = Consumers.size(); i != e; ++i)<br>
+ Consumers[i]->HandleImplicitImportDecl(D);<br>
+}<br>
+<br>
+void MultiplexConsumer::HandleLinkerOptionPragma(llvm::StringRef Opts) {<br>
+ for (size_t i = 0, e = Consumers.size(); i != e; ++i)<br>
+ Consumers[i]->HandleLinkerOptionPragma(Opts);<br>
+}<br>
+<br>
+void MultiplexConsumer::HandleDetectMismatch(llvm::StringRef Name, llvm::StringRef Value) {<br>
+ for (size_t i = 0, e = Consumers.size(); i != e; ++i)<br>
+ Consumers[i]->HandleDetectMismatch(Name, Value);<br>
+}<br>
+<br>
+void MultiplexConsumer::HandleDependentLibrary(llvm::StringRef Lib) {<br>
+ for (size_t i = 0, e = Consumers.size(); i != e; ++i)<br>
+ Consumers[i]->HandleDependentLibrary(Lib);<br>
+}<br>
+<br>
void MultiplexConsumer::CompleteTentativeDefinition(VarDecl *D) {<br>
for (size_t i = 0, e = Consumers.size(); i != e; ++i)<br>
Consumers[i]->CompleteTentativeDefinition(D);<br>
<br>
Copied: cfe/trunk/test/CodeGenCXX/Inputs/debug-info-class-limited.cpp (from r213212, cfe/trunk/test/CodeGenCXX/debug-info-class-limited.cpp)<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/Inputs/debug-info-class-limited.cpp?p2=cfe/trunk/test/CodeGenCXX/Inputs/debug-info-class-limited.cpp&p1=cfe/trunk/test/CodeGenCXX/debug-info-class-limited.cpp&r1=213212&r2=213213&rev=213213&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/Inputs/debug-info-class-limited.cpp?p2=cfe/trunk/test/CodeGenCXX/Inputs/debug-info-class-limited.cpp&p1=cfe/trunk/test/CodeGenCXX/debug-info-class-limited.cpp&r1=213212&r2=213213&rev=213213&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/CodeGenCXX/debug-info-class-limited.cpp (original)<br>
+++ cfe/trunk/test/CodeGenCXX/Inputs/debug-info-class-limited.cpp Wed Jul 16 18:52:46 2014<br>
@@ -1,4 +1,3 @@<br>
-// RUN: %clang -emit-llvm -fno-standalone-debug -g -S %s -o - | FileCheck %s<br>
<br>
// CHECK-DAG: [ DW_TAG_structure_type ] [PR16214] [line [[@LINE+1]], {{.*}} [def]<br>
struct PR16214 {<br>
<br>
Added: cfe/trunk/test/CodeGenCXX/debug-info-class-limited-plugin.test<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-class-limited-plugin.test?rev=213213&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-class-limited-plugin.test?rev=213213&view=auto</a><br>
==============================================================================<br>
--- cfe/trunk/test/CodeGenCXX/debug-info-class-limited-plugin.test (added)<br>
+++ cfe/trunk/test/CodeGenCXX/debug-info-class-limited-plugin.test Wed Jul 16 18:52:46 2014<br>
@@ -0,0 +1,2 @@<br>
+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<br>
+REQUIRES: plugins, examples<br>
<br>
Removed: cfe/trunk/test/CodeGenCXX/debug-info-class-limited.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-class-limited.cpp?rev=213212&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-class-limited.cpp?rev=213212&view=auto</a><br>
==============================================================================<br>
--- cfe/trunk/test/CodeGenCXX/debug-info-class-limited.cpp (original)<br>
+++ cfe/trunk/test/CodeGenCXX/debug-info-class-limited.cpp (removed)<br>
@@ -1,50 +0,0 @@<br>
-// RUN: %clang -emit-llvm -fno-standalone-debug -g -S %s -o - | FileCheck %s<br>
-<br>
-// CHECK-DAG: [ DW_TAG_structure_type ] [PR16214] [line [[@LINE+1]], {{.*}} [def]<br>
-struct PR16214 {<br>
- int i;<br>
-};<br>
-<br>
-typedef PR16214 bar;<br>
-<br>
-bar *a;<br>
-bar b;<br>
-<br>
-namespace PR14467 {<br>
-// CHECK-DAG: [ DW_TAG_structure_type ] [foo] [line [[@LINE+1]], {{.*}} [def]<br>
-struct foo {<br>
-};<br>
-<br>
-foo *bar(foo *a) {<br>
- foo *b = new foo(*a);<br>
- return b;<br>
-}<br>
-}<br>
-<br>
-namespace test1 {<br>
-// CHECK-DAG: [ DW_TAG_structure_type ] [foo] [line [[@LINE+1]], {{.*}} [def]<br>
-struct foo {<br>
-};<br>
-<br>
-extern int bar(foo *a);<br>
-int baz(foo *a) {<br>
- return bar(a);<br>
-}<br>
-}<br>
-<br>
-namespace test2 {<br>
-// FIXME: if we were a bit fancier, we could realize that the 'foo' type is only<br>
-// required because of the 'bar' type which is not required at all (or might<br>
-// only be required to be declared)<br>
-// CHECK-DAG: [ DW_TAG_structure_type ] [foo] [line [[@LINE+1]], {{.*}} [def]<br>
-struct foo {<br>
-};<br>
-<br>
-struct bar {<br>
- foo f;<br>
-};<br>
-<br>
-void func() {<br>
- foo *f;<br>
-}<br>
-}<br>
<br>
Added: cfe/trunk/test/CodeGenCXX/debug-info-class-limited.test<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-class-limited.test?rev=213213&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-class-limited.test?rev=213213&view=auto</a><br>
==============================================================================<br>
--- cfe/trunk/test/CodeGenCXX/debug-info-class-limited.test (added)<br>
+++ cfe/trunk/test/CodeGenCXX/debug-info-class-limited.test Wed Jul 16 18:52:46 2014<br>
@@ -0,0 +1 @@<br>
+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<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div></div></div><br></div>
</blockquote></div><br></div>