<div dir="ltr">Ah, I see, was added in <span style="font-family:monospace">260573</span></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 11, 2016 at 1:34 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</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"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Thu, Feb 11, 2016 at 11:41 AM, Reid Kleckner via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: rnk<br>
Date: Thu Feb 11 13:41:47 2016<br>
New Revision: 260571<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=260571&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=260571&view=rev</a><br>
Log:<br>
[codeview] Fix bug around multi-level wrapper inlining<br>
<br>
If there were wrapper functions with no instructions of their own in the<br>
inlining tree, we would fail to emit InlineSite records for them.<br></blockquote><div><br></div></span><div>Test case?</div><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Modified:<br>
    llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp<br>
<br>
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp?rev=260571&r1=260570&r2=260571&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp?rev=260571&r1=260570&r2=260571&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp Thu Feb 11 13:41:47 2016<br>
@@ -117,6 +117,13 @@ CodeViewDebug::InlineSite &CodeViewDebug<br>
   return *Site;<br>
 }<br>
<br>
+static void addLocIfNotPresent(SmallVectorImpl<const DILocation *> &Locs,<br>
+                               const DILocation *Loc) {<br>
+  auto B = Locs.begin(), E = Locs.end();<br>
+  if (std::find(B, E, Loc) == E)<br>
+    Locs.push_back(Loc);<br>
+}<br>
+<br>
 void CodeViewDebug::maybeRecordLocation(DebugLoc DL,<br>
                                         const MachineFunction *MF) {<br>
   // Skip this instruction if it has the same location as the previous one.<br>
@@ -147,24 +154,24 @@ void CodeViewDebug::maybeRecordLocation(<br>
   CurFn->LastLoc = DL;<br>
<br>
   unsigned FuncId = CurFn->FuncId;<br>
-  if (const DILocation *Loc = DL->getInlinedAt()) {<br>
+  if (DL->getInlinedAt()) {<br>
+    const DILocation *Loc = DL.get();<br>
+<br>
     // If this location was actually inlined from somewhere else, give it the ID<br>
     // of the inline call site.<br>
-    FuncId = getInlineSite(DL.get()).SiteFuncId;<br>
-    CurFn->ChildSites.push_back(Loc);<br>
+    FuncId = getInlineSite(Loc).SiteFuncId;<br>
+<br>
     // Ensure we have links in the tree of inline call sites.<br>
-    const DILocation *ChildLoc = nullptr;<br>
-    while (Loc->getInlinedAt()) {<br>
+    const DILocation *SiteLoc;<br>
+    bool FirstLoc = true;<br>
+    while ((SiteLoc = Loc->getInlinedAt())) {<br>
       InlineSite &Site = getInlineSite(Loc);<br>
-      if (ChildLoc) {<br>
-        // Record the child inline site if not already present.<br>
-        auto B = Site.ChildSites.begin(), E = Site.ChildSites.end();<br>
-        if (std::find(B, E, Loc) != E)<br>
-          break;<br>
-        Site.ChildSites.push_back(Loc);<br>
-      }<br>
-      ChildLoc = Loc;<br>
+      if (!FirstLoc)<br>
+        addLocIfNotPresent(Site.ChildSites, Loc);<br>
+      FirstLoc = false;<br>
+      Loc = SiteLoc;<br>
     }<br>
+    addLocIfNotPresent(CurFn->ChildSites, Loc);<br>
   }<br>
<br>
   OS.EmitCVLocDirective(FuncId, FileId, DL.getLine(), DL.getCol(),<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div></div></div><br></div></div>
</blockquote></div><br></div>