<div dir="ltr">Seems like a rather complex test case - could you explain what's going on there? (maybe in the form of a comment in the code - what path through all those classes is required to tickle this)<br><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 23, 2017 at 2:25 PM Adrian Prantl via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: adrian<br>
Date: Wed Aug 23 14:24:12 2017<br>
New Revision: 311601<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=311601&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=311601&view=rev</a><br>
Log:<br>
Fix a bug in CGDebugInfo::EmitInlineFunctionStart causing DILocations to be<br>
parented in function declarations.<br>
<br>
Fixes PR33997.<br>
<a href="https://bugs.llvm.org/show_bug.cgi?id=33997" rel="noreferrer" target="_blank">https://bugs.llvm.org/show_bug.cgi?id=33997</a><br>
<br>
Added:<br>
    cfe/trunk/test/CodeGenCXX/debug-info-inlined.cpp<br>
Modified:<br>
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=311601&r1=311600&r2=311601&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=311601&r1=311600&r2=311601&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Wed Aug 23 14:24:12 2017<br>
@@ -3287,7 +3287,7 @@ void CGDebugInfo::EmitInlineFunctionStar<br>
   llvm::DISubprogram *SP = nullptr;<br>
   if (FI != SPCache.end())<br>
     SP = dyn_cast_or_null<llvm::DISubprogram>(FI->second);<br>
-  if (!SP)<br>
+  if (!SP || !SP->isDefinition())<br>
     SP = getFunctionStub(GD);<br>
   FnBeginRegionCount.push_back(LexicalBlockStack.size());<br>
   LexicalBlockStack.emplace_back(SP);<br>
<br>
Added: cfe/trunk/test/CodeGenCXX/debug-info-inlined.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-inlined.cpp?rev=311601&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-inlined.cpp?rev=311601&view=auto</a><br>
==============================================================================<br>
--- cfe/trunk/test/CodeGenCXX/debug-info-inlined.cpp (added)<br>
+++ cfe/trunk/test/CodeGenCXX/debug-info-inlined.cpp Wed Aug 23 14:24:12 2017<br>
@@ -0,0 +1,45 @@<br>
+// RUN: %clang_cc1 -emit-llvm -triple i686-pc-windows-msvc19.0.24213 -gcodeview -debug-info-kind=limited -std=c++14 %s -o - | FileCheck %s<br>
+// PR33997.<br>
+struct already_AddRefed {<br>
+  ~already_AddRefed();<br>
+};<br>
+struct RefPtr {<br>
+  operator int *();<br>
+};<br>
+struct ServoCssRulesStrong {<br>
+  already_AddRefed Consume();<br>
+};<br>
+struct GroupRule {<br>
+  GroupRule(already_AddRefed);<br>
+};<br>
+class ConditionRule : GroupRule {<br>
+  using GroupRule::GroupRule;<br>
+};<br>
+class CSSMediaRule : ConditionRule {<br>
+  using ConditionRule::ConditionRule;<br>
+};<br>
+class CSSMozDocumentRule : ConditionRule {<br>
+  using ConditionRule::ConditionRule;<br>
+};<br>
+class ServoDocumentRule : CSSMozDocumentRule {<br>
+  ServoDocumentRule(RefPtr);<br>
+};<br>
+class ServoMediaRule : CSSMediaRule {<br>
+  ServoMediaRule(RefPtr);<br>
+};<br>
+ServoCssRulesStrong Servo_MediaRule_GetRules(int *);<br>
+ServoCssRulesStrong Servo_DocumentRule_GetRules(int *);<br>
+ServoDocumentRule::ServoDocumentRule(RefPtr aRawRule)<br>
+    : CSSMozDocumentRule(Servo_DocumentRule_GetRules(aRawRule).Consume()) {}<br>
+<br>
+ServoMediaRule::ServoMediaRule(RefPtr aRawRule)<br>
+    : CSSMediaRule(Servo_MediaRule_GetRules(aRawRule).Consume()) {}<br>
+<br>
+// CHECK: define{{.*}}ServoMediaRule<br>
+// CHECK-NOT: {{ ret }}<br>
+// CHECK: store %class.ConditionRule* %<br>
+// CHECK-SAME: %class.ConditionRule** %<br>
+// CHECK-SAME: !dbg ![[INL:[0-9]+]]<br>
+<br>
+// CHECK: ![[INL]] = !DILocation(line: 16, scope: ![[SP:[0-9]+]], inlinedAt:<br>
+// CHECK: ![[SP]] = distinct !DISubprogram(name: "GroupRule", {{.*}}isDefinition: true<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div></div>