<div dir="ltr">This is, 'technically', a separate patch in some sense from the LLD part - changes to LLVM usually merit tests in LLVM to ensure they work/don't regress/etc without needing to checkout & test other subprojects (like lld).</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Nov 12, 2018 at 11:02 AM Zachary Turner <<a href="mailto:zturner@google.com">zturner@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This one specific function, or the patch as a whole?  I thought the patch had pretty good non-unit-test coverage <br><div class="gmail_quote"><div dir="ltr">On Mon, Nov 12, 2018 at 10:36 AM David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Could this use/be tested with a unit test, perhaps?</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Nov 8, 2018 at 10:52 AM Zachary Turner via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-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: zturner<br>
Date: Thu Nov  8 10:50:11 2018<br>
New Revision: 346429<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=346429&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=346429&view=rev</a><br>
Log:<br>
[NativePDB] Higher fidelity reconstruction of AST from Debug Info.<br>
<br>
In order to accurately put a type into the correct location in the AST<br>
we construct from debug info, we need to be able to determine what<br>
DeclContext (namespace, global, nested class, etc) that it goes into.<br>
PDB doesn't contain this mapping.  It does, however, contain the reverse<br>
mapping.  That is, for a given class type T, you can determine all<br>
classes Q1, Q2, ..., Qn that are nested inside of T.  We need to know,<br>
for a given class type Q, what type T is it nested inside of.<br>
<br>
This patch builds this map as a pre-processing step when we first<br>
load the PDB by scanning every type.  Initial tests show that while<br>
this can be slow in debug builds of LLDB, it is quite fast in release<br>
builds (less than 2 seconds for a ~1GB PDB, and it only needs to happen<br>
once).<br>
<br>
Furthermore, having this pre-processing step in place allows us to<br>
repurpose it for building up other kinds of indexing to it down the<br>
line.  For the time being, this gives us very accurate reconstruction<br>
of the DeclContext hierarchy.<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D54216" rel="noreferrer" target="_blank">https://reviews.llvm.org/D54216</a><br>
<br>
Modified:<br>
    llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecord.h<br>
<br>
Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecord.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecord.h?rev=346429&r1=346428&r2=346429&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecord.h?rev=346429&r1=346428&r2=346429&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecord.h (original)<br>
+++ llvm/trunk/include/llvm/DebugInfo/CodeView/TypeRecord.h Thu Nov  8 10:50:11 2018<br>
@@ -429,6 +429,10 @@ public:<br>
     return (Options & ClassOptions::ForwardReference) != ClassOptions::None;<br>
   }<br>
<br>
+  bool containsNestedClass() const {<br>
+    return (Options & ClassOptions::ContainsNestedClass) != ClassOptions::None;<br>
+  }<br>
+<br>
   bool isScoped() const {<br>
     return (Options & ClassOptions::Scoped) != ClassOptions::None;<br>
   }<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>
</blockquote></div>
</blockquote></div>