<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Mar 18, 2014 at 10:41 AM, Adrian Prantl <span dir="ltr"><<a href="mailto:aprantl@apple.com" target="_blank">aprantl@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Author: adrian<br>
Date: Tue Mar 18 12:41:15 2014<br>
New Revision: 204162<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=204162&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=204162&view=rev</a><br>
Log:<br>
Debug info: Remove OdrMemberMap from DwarfDebug, it's not necessary.<br>
Follow-up to r203982.<br>
<br>
Modified:<br>
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br>
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h<br>
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp<br>
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h<br>
<br>
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=204162&r1=204161&r2=204162&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=204162&r1=204161&r2=204162&view=diff</a><br>

==============================================================================<br>
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Mar 18 12:41:15 2014<br>
@@ -369,7 +369,6 @@ bool DwarfDebug::isSubprogramContext(con<br>
 // scope then create and insert DIEs for these variables.<br>
 DIE *DwarfDebug::updateSubprogramScopeDIE(DwarfCompileUnit *SPCU,<br>
                                           DISubprogram SP) {<br>
-  SP = SPCU->getOdrUniqueSubprogram(resolve(SP.getContext()), SP);<br>
   DIE *SPDie = SPCU->getDIE(SP);<br>
<br>
   assert(SPDie && "Unable to find subprogram DIE!");<br>
@@ -604,7 +603,8 @@ DIE *DwarfDebug::constructScopeDIE(Dwarf<br>
   if (!Scope || !Scope->getScopeNode())<br>
     return NULL;<br>
<br>
-  DIScope DS(Scope->getScopeNode());<br>
+  // Unique scope where applicable.<br>
+  DIScope DS(resolve(DIScope(Scope->getScopeNode()).getRef()));<br></blockquote><div><br></div><div>Just to recapture what Adrian and I discussed earlier. We try not to unique types in the backend. All references to</div>
<div>DITypes with an identifier should be converted to DIRef if possible (with the exception of the retained type list).</div><div><br></div><div><br></div><div>Adrian tried reverting r203982, the testing case for r203982 will still work, it is working because of his earlier commit on converting DIVariable's type to use DIRef.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
   SmallVector<DIE *, 8> Children;<br>
   DIE *ObjectPointer = NULL;<br>
<br>
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=204162&r1=204161&r2=204162&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=204162&r1=204161&r2=204162&view=diff</a><br>

==============================================================================<br>
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original)<br>
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Tue Mar 18 12:41:15 2014<br>
@@ -346,9 +346,6 @@ class DwarfDebug : public AsmPrinterHand<br>
   /// of in DwarfCompileUnit.<br>
   DenseMap<const MDNode *, DIE *> MDTypeNodeToDieMap;<br>
<br>
-  // Used to unique C++ member function declarations.<br>
-  StringMap<const MDNode *> OdrMemberMap;<br>
-<br>
   // List of all labels used in aranges generation.<br>
   std::vector<SymbolCU> ArangeLabels;<br>
<br>
@@ -700,11 +697,6 @@ public:<br>
     return MDTypeNodeToDieMap.lookup(TypeMD);<br>
   }<br>
<br>
-  /// \brief Look up or create an entry in the OdrMemberMap.<br>
-  const MDNode *&getOrCreateOdrMember(StringRef Key) {<br>
-    return OdrMemberMap.GetOrCreateValue(Key).getValue();<br>
-  }<br>
-<br>
   /// \brief Emit all Dwarf sections that should come prior to the<br>
   /// content.<br>
   void beginModule();<br>
<br>
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp?rev=204162&r1=204161&r2=204162&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp?rev=204162&r1=204161&r2=204162&view=diff</a><br>

==============================================================================<br>
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp Tue Mar 18 12:41:15 2014<br>
@@ -1427,24 +1427,6 @@ DIE *DwarfUnit::getOrCreateNameSpace(DIN<br>
   return NDie;<br>
 }<br>
<br>
-/// Unique C++ member function declarations based on their<br>
-/// context and mangled name.<br>
-DISubprogram<br>
-DwarfUnit::getOdrUniqueSubprogram(DIScope Context, DISubprogram SP) const {<br>
-  if (!hasODR() ||<br>
-      !Context.isCompositeType() ||<br>
-      SP.getLinkageName().empty() ||<br>
-      SP.isDefinition())<br>
-    return SP;<br>
-  // Create a key with the UID of the parent class and this SP's name.<br>
-  Twine Key = SP.getContext().getName() + SP.getLinkageName();<br>
-  const MDNode *&Entry = DD->getOrCreateOdrMember(Key.str());<br>
-  if (!Entry)<br>
-    Entry = &*SP;<br>
-<br>
-  return DISubprogram(Entry);<br>
-}<br>
-<br>
 /// getOrCreateSubprogramDIE - Create new DIE using SP.<br>
 DIE *DwarfUnit::getOrCreateSubprogramDIE(DISubprogram SP) {<br>
   // Construct the context before querying for the existence of the DIE in case<br>
@@ -1452,8 +1434,10 @@ DIE *DwarfUnit::getOrCreateSubprogramDIE<br>
   // declarations).<br>
   DIScope Context = resolve(SP.getContext());<br>
   DIE *ContextDIE = getOrCreateContextDIE(Context);<br>
+<br>
   // Unique declarations based on the ODR, where applicable.<br>
-  SP = getOdrUniqueSubprogram(Context, SP);<br>
+  SP = DISubprogram(DD->resolve(SP.getRef()));<br></blockquote><div><br></div><div>This line of code does nothing, since we don't have identifiers for DISubprogram.</div><div><br></div><div>Thanks,</div><div>Manman</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
+  assert(SP.Verify());<br>
<br>
   DIE *SPDie = getDIE(SP);<br>
   if (SPDie)<br>
<br>
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h?rev=204162&r1=204161&r2=204162&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h?rev=204162&r1=204161&r2=204162&view=diff</a><br>

==============================================================================<br>
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h (original)<br>
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h Tue Mar 18 12:41:15 2014<br>
@@ -487,28 +487,6 @@ public:<br>
<br>
   virtual DwarfCompileUnit &getCU() = 0;<br>
<br>
-  /// \brief Return whether this compilation unit has the<br>
-  /// one-definition-rule (ODR).  In C++ this allows the compiler to<br>
-  /// perform type unique during LTO.<br>
-  bool hasODR() const {<br>
-    switch (getLanguage()) {<br>
-    case dwarf::DW_LANG_C_plus_plus:<br>
-    case dwarf::DW_LANG_C_plus_plus_03:<br>
-    case dwarf::DW_LANG_C_plus_plus_11:<br>
-      // For all we care, the C++ part of the language has the ODR and<br>
-      // ObjC methods are not represented in a way that they could be<br>
-      // confused with C++ member functions.<br>
-    case dwarf::DW_LANG_ObjC_plus_plus:<br>
-      return true;<br>
-    default:<br>
-      return false;<br>
-    }<br>
-  }<br>
-<br>
-  /// \brief Unique C++ member function declarations based on their<br>
-  /// context+mangled name.<br>
-  DISubprogram getOdrUniqueSubprogram(DIScope Context, DISubprogram SP) const;<br>
-<br>
 protected:<br>
   /// getOrCreateStaticMemberDIE - Create new static data member DIE.<br>
   DIE *getOrCreateStaticMemberDIE(DIDerivedType DT);<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>