<div dir="ltr">Could this be responsible for crashes in the bootstrap bot?<div><br></div><div><a href="http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/11031/steps/build%20clang%2Fubsan/logs/stdio">http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/11031/steps/build%20clang%2Fubsan/logs/stdio</a></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 23, 2016 at 8:41 AM, David Blaikie 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"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Tue, Feb 23, 2016 at 5:36 AM, Amjad Aboud 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: aaboud<br>
Date: Tue Feb 23 07:36:51 2016<br>
New Revision: 261633<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=261633&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=261633&view=rev</a><br>
Log:<br>
Supporting all entities declared in lexical scope in LLVM debug info.<br></blockquote><div><br></div></span><div>Great to have this in - thanks so much for sticking with me through all the review/design discussions!</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>
Differential Revision: <a href="http://reviews.llvm.org/D15976" rel="noreferrer" target="_blank">http://reviews.llvm.org/D15976</a><br>
<br>
Added:<br>
    llvm/trunk/test/DebugInfo/X86/PR24008.ll<br>
    llvm/trunk/test/DebugInfo/X86/lexical-block-inline.ll<br>
    llvm/trunk/test/DebugInfo/X86/lexical-block.ll<br>
    llvm/trunk/test/DebugInfo/X86/subprogram-inline.ll<br>
Modified:<br>
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp<br>
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h<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>
    llvm/trunk/test/DebugInfo/Generic/2010-04-06-NestedFnDbgInfo.ll<br>
    llvm/trunk/test/DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll<br>
    llvm/trunk/test/DebugInfo/Generic/cross-cu-linkonce-distinct.ll<br>
    llvm/trunk/test/DebugInfo/Generic/namespace.ll<br>
    llvm/trunk/test/DebugInfo/Generic/nodebug.ll<br>
    llvm/trunk/test/DebugInfo/Mips/InlinedFnLocalVar.ll<br>
    llvm/trunk/test/DebugInfo/X86/InlinedFnLocalVar.ll<br>
    llvm/trunk/test/DebugInfo/X86/dbg-file-name.ll<br>
    llvm/trunk/test/DebugInfo/X86/debug-dead-local-var.ll<br>
    llvm/trunk/test/DebugInfo/X86/gnu-public-names.ll<br>
<br>
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=261633&r1=261632&r2=261633&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=261633&r1=261632&r2=261633&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Tue Feb 23 07:36:51 2016<br>
@@ -114,10 +114,16 @@ DIE *DwarfCompileUnit::getOrCreateGlobal<br>
<br>
   // Construct the context before querying for the existence of the DIE in<br>
   // case such construction creates the DIE.<br>
-  DIE *ContextDIE = getOrCreateContextDIE(GVContext);<br>
+  // For Local Scope, do not construct context DIE.<br>
+  bool IsLocalScope = GVContext && isa<DILocalScope>(GVContext);<br>
+  DIE *ContextDIE = IsLocalScope ? nullptr : getOrCreateContextDIE(GVContext);<br>
+  assert(ContextDIE || IsLocalScope);<br>
+<br>
+  // Create new global variable and add to map.<br>
+  DIE *VariableDIE = IsLocalScope<br>
+                         ? createDIE(GV->getTag(), GV)<br>
+                         : &createAndAddDIE(GV->getTag(), *ContextDIE, GV);<br>
<br>
-  // Add to map.<br>
-  DIE *VariableDIE = &createAndAddDIE(GV->getTag(), *ContextDIE, GV);<br>
   DIScope *DeclContext;<br>
   if (auto *SDMDecl = GV->getStaticDataMemberDeclaration()) {<br>
     DeclContext = resolve(SDMDecl->getScope());<br>
@@ -335,23 +341,15 @@ void DwarfCompileUnit::constructScopeDIE<br>
     if (DD->isLexicalScopeDIENull(Scope))<br>
       return;<br>
<br>
-    unsigned ChildScopeCount;<br>
+    bool HasNonScopeChildren;<br>
<br>
     // We create children here when we know the scope DIE is not going to be<br>
     // null and the children will be added to the scope DIE.<br>
-    createScopeChildrenDIE(Scope, Children, &ChildScopeCount);<br>
-<br>
-    // Skip imported directives in gmlt-like data.<br>
-    if (!includeMinimalInlineScopes()) {<br>
-      // There is no need to emit empty lexical block DIE.<br>
-      for (const auto *IE : ImportedEntities[DS])<br>
-        Children.push_back(<br>
-            constructImportedEntityDIE(cast<DIImportedEntity>(IE)));<br>
-    }<br>
+    createScopeChildrenDIE(Scope, Children, &HasNonScopeChildren);<br>
<br>
     // If there are only other scopes as children, put them directly in the<br>
     // parent instead, as this scope would serve no purpose.<br>
-    if (Children.size() == ChildScopeCount) {<br>
+    if (!HasNonScopeChildren) {<br>
       FinalChildren.insert(FinalChildren.end(),<br>
                            std::make_move_iterator(Children.begin()),<br>
                            std::make_move_iterator(Children.end()));<br>
@@ -366,6 +364,7 @@ void DwarfCompileUnit::constructScopeDIE<br>
     ScopeDIE->addChild(std::move(I));<br>
<br>
   FinalChildren.push_back(std::move(ScopeDIE));<br>
+  addLocalScopeDieToLexicalScope(Scope, ScopeDIE);<br>
 }<br>
<br>
 DIE::value_iterator<br>
@@ -558,20 +557,37 @@ DIE *DwarfCompileUnit::constructVariable<br>
<br>
 DIE *DwarfCompileUnit::createScopeChildrenDIE(LexicalScope *Scope,<br>
                                               SmallVectorImpl<DIE *> &Children,<br>
-                                              unsigned *ChildScopeCount) {<br>
+                                              bool *HasNonScopeChildren) {<br>
   DIE *ObjectPointer = nullptr;<br>
+  bool HasLocalDclDie = false;<br>
+  auto *DS = Scope->getScopeNode();<br>
<br>
   for (DbgVariable *DV : DU->getScopeVariables().lookup(Scope))<br>
     Children.push_back(constructVariableDIE(*DV, *Scope, ObjectPointer));<br>
<br>
-  unsigned ChildCountWithoutScopes = Children.size();<br>
+  // Skip local declarations in gmlt-like data.<br>
+  if (!includeMinimalInlineScopes()) {<br>
+    for (const auto *DI : LocalDeclNodes[DS]) {<br>
+      DIE *D = nullptr;<br>
+      if (auto *IE = dyn_cast<DIImportedEntity>(DI))<br>
+        D = getOrCreateImportedEntityDIE(IE);<br>
+      else if (auto *GV = dyn_cast<DIGlobalVariable>(DI))<br>
+        D = getOrCreateGlobalVariableDIE(GV);<br>
+      else if (auto *RT = dyn_cast<DIType>(DI))<br>
+        D = getOrCreateTypeDIE(RT);<br>
+      else<br>
+        llvm_unreachable("Unexpected DI node!");<br>
+      addLocalDclDieToLexicalScope(Scope, D);<br>
+      HasLocalDclDie = true;<br>
+    }<br>
+  }<br>
+<br>
+  if (HasNonScopeChildren)<br>
+    *HasNonScopeChildren = !Children.empty() || HasLocalDclDie;<br>
<br>
   for (LexicalScope *LS : Scope->getChildren())<br>
     constructScopeDIE(LS, Children);<br>
<br>
-  if (ChildScopeCount)<br>
-    *ChildScopeCount = Children.size() - ChildCountWithoutScopes;<br>
-<br>
   return ObjectPointer;<br>
 }<br>
<br>
@@ -613,6 +629,8 @@ DIE *DwarfCompileUnit::createAndAddScope<br>
   for (auto &I : Children)<br>
     ScopeDIE.addChild(std::move(I));<br>
<br>
+  addLocalScopeDieToLexicalScope(Scope, &ScopeDIE);<br>
+<br>
   return ObjectPointer;<br>
 }<br>
<br>
@@ -649,10 +667,20 @@ void DwarfCompileUnit::constructAbstract<br>
     addDIEEntry(*AbsDef, dwarf::DW_AT_object_pointer, *ObjectPointer);<br>
 }<br>
<br>
+DIE *DwarfCompileUnit::getOrCreateImportedEntityDIE(<br>
+    const DIImportedEntity *Module) {<br>
+  if (DIE *Die = getDIE(Module))<br>
+    return Die;<br>
+<br>
+  return constructImportedEntityDIE(Module);<br>
+}<br>
+<br>
 DIE *DwarfCompileUnit::constructImportedEntityDIE(<br>
     const DIImportedEntity *Module) {<br>
-  DIE *IMDie = DIE::get(DIEValueAllocator, (dwarf::Tag)Module->getTag());<br>
-  insertDIE(Module, IMDie);<br>
+<br>
+  assert(!getDIE(Module));<br>
+<br>
+  DIE *IMDie = createDIE(Module->getTag(), Module);<br>
   DIE *EntityDie;<br>
   auto *Entity = resolve(Module->getEntity());<br>
   if (auto *NS = dyn_cast<DINamespace>(Entity))<br>
@@ -679,22 +707,46 @@ DIE *DwarfCompileUnit::constructImported<br>
 }<br>
<br>
 void DwarfCompileUnit::finishSubprogramDefinition(const DISubprogram *SP) {<br>
-  DIE *D = getDIE(SP);<br>
-  if (DIE *AbsSPDIE = DU->getAbstractSPDies().lookup(SP)) {<br>
-    if (D)<br>
+  if (DIE *D = getDIE(SP)) {<br>
+    if (DIE *AbsSPDIE = DU->getAbstractSPDies().lookup(SP))<br>
       // If this subprogram has an abstract definition, reference that<br>
       addDIEEntry(*D, dwarf::DW_AT_abstract_origin, *AbsSPDIE);<br>
-  } else {<br>
-    if (!D && !includeMinimalInlineScopes())<br>
-      // Lazily construct the subprogram if we didn't see either concrete or<br>
-      // inlined versions during codegen. (except in -gmlt ^ where we want<br>
-      // to omit these entirely)<br>
-      D = getOrCreateSubprogramDIE(SP);<br>
-    if (D)<br>
+    else<br>
       // And attach the attributes<br>
       applySubprogramAttributesToDefinition(SP, *D);<br>
   }<br>
 }<br>
+<br>
+void DwarfCompileUnit::finishLocalScopeDefinitions() {<br>
+  for (const auto &I : getLSDieInfoMap()) {<br>
+    auto LSInfo = I.second;<br>
+    // Attach all local dcl DIEs to abstract local scope if available,<br>
+    // otherwise attach it to concrete local scope.<br>
+    DIE *LBDie =<br>
+        LSInfo.AbstractLSDie ? LSInfo.AbstractLSDie : LSInfo.ConcreteLSDie;<br>
+    assert(LBDie || LSInfo.LocalDclDies.empty());<br>
+    for (auto &D : LSInfo.LocalDclDies)<br>
+      LBDie->addChild(std::move(D));<br>
+<br>
+    if (isa<DISubprogram>(I.first))<br>
+      // For function scope there is nothing else to do.<br>
+      // "abstract_origin" dwarf attribute was added somewhere else.<br>
+      continue;<br>
+<br>
+    if (LSInfo.AbstractLSDie) {<br>
+      // Add "abstract_origin" dwarf attribute to concrete local scope pointing<br>
+      // to the corresponding abstract local scope.<br>
+      if (LSInfo.ConcreteLSDie)<br>
+        addDIEEntry(*LSInfo.ConcreteLSDie, dwarf::DW_AT_abstract_origin,<br>
+                    *LSInfo.AbstractLSDie);<br>
+      // Add "abstract_origin" dwarf attribute to inline local scope pointing<br>
+      // to the corresponding abstract local scope.<br>
+      for (auto &L : LSInfo.InlineLSDies)<br>
+        addDIEEntry(*L, dwarf::DW_AT_abstract_origin, *LSInfo.AbstractLSDie);<br>
+    }<br>
+  }<br>
+}<br>
+<br>
 void DwarfCompileUnit::collectDeadVariables(const DISubprogram *SP) {<br>
   assert(SP && "CU's subprogram list contains a non-subprogram");<br>
   assert(SP->isDefinition() &&<br>
@@ -705,7 +757,7 @@ void DwarfCompileUnit::collectDeadVariab<br>
<br>
   DIE *SPDIE = DU->getAbstractSPDies().lookup(SP);<br>
   if (!SPDIE)<br>
-    SPDIE = getDIE(SP);<br>
+    return;<br>
   assert(SPDIE);<br>
   for (const DILocalVariable *DV : Variables) {<br>
     DbgVariable NewVar(DV, /* IA */ nullptr, DD);<br>
@@ -830,6 +882,30 @@ void DwarfCompileUnit::applySubprogramAt<br>
   addGlobalName(SP->getName(), SPDie, Context);<br>
 }<br>
<br>
+void DwarfCompileUnit::addLocalScopeDieToLexicalScope(LexicalScope *LS,<br>
+                                                      DIE *D) {<br>
+  auto &LSInfo = getLSDieInfoMap()[LS->getScopeNode()];<br>
+  if (LS->isAbstractScope()) {<br>
+    assert(!LSInfo.AbstractLSDie && "Adding abstract LS DIE twice.");<br>
+    LSInfo.AbstractLSDie = D;<br>
+    return;<br>
+  }<br>
+  if (LS->getInlinedAt()) {<br>
+    assert(!LSInfo.InlineLSDies.count(D) && "Adding inline LS DIE twice.");<br>
+    LSInfo.InlineLSDies.insert(D);<br>
+    return;<br>
+  }<br>
+  assert(!LSInfo.ConcreteLSDie && "Adding cocncrete LS DIE twice.");<br>
+  LSInfo.ConcreteLSDie = D;<br>
+  return;<br>
+}<br>
+<br>
+void DwarfCompileUnit::addLocalDclDieToLexicalScope(LexicalScope *LS, DIE *D) {<br>
+  auto &LSInfo = getLSDieInfoMap()[LS->getScopeNode()];<br>
+  LSInfo.LocalDclDies.insert(D);<br>
+  return;<br>
+}<br>
+<br>
 bool DwarfCompileUnit::isDwoUnit() const {<br>
   return DD->useSplitDwarf() && Skeleton;<br>
 }<br>
<br>
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h?rev=261633&r1=261632&r2=261633&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h?rev=261633&r1=261632&r2=261633&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h (original)<br>
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h Tue Feb 23 07:36:51 2016<br>
@@ -15,6 +15,7 @@<br>
 #define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFCOMPILEUNIT_H<br>
<br>
 #include "DwarfUnit.h"<br>
+#include "llvm/ADT/SetVector.h"<br>
 #include "llvm/ADT/StringRef.h"<br>
 #include "llvm/IR/DebugInfo.h"<br>
 #include "llvm/Support/Dwarf.h"<br>
@@ -48,11 +49,10 @@ class DwarfCompileUnit : public DwarfUni<br>
   /// The start of the unit macro info within macro section.<br>
   MCSymbol *MacroLabelBegin;<br>
<br>
-  typedef llvm::SmallVector<const MDNode *, 8> ImportedEntityList;<br>
-  typedef llvm::DenseMap<const MDNode *, ImportedEntityList><br>
-  ImportedEntityMap;<br>
+  typedef llvm::SmallVector<const MDNode *, 8> LocalDeclNodeList;<br>
+  typedef llvm::DenseMap<const MDNode *, LocalDeclNodeList> LocalScopesMap;<br>
<br>
-  ImportedEntityMap ImportedEntities;<br>
+  LocalScopesMap LocalDeclNodes;<br>
<br>
   /// GlobalNames - A map of globally visible named entities for this unit.<br>
   StringMap<const DIE *> GlobalNames;<br>
@@ -71,6 +71,15 @@ class DwarfCompileUnit : public DwarfUni<br>
   // ranges/locs.<br>
   const MCSymbol *BaseAddress;<br>
<br>
+  struct LocalScopeDieInfo {<br>
+    DIE *ConcreteLSDie = nullptr;<br>
+    DIE *AbstractLSDie = nullptr;<br>
+    SetVector<DIE *> InlineLSDies;<br>
+    SetVector<DIE *> LocalDclDies;<br>
+  };<br>
+  // Collection of local scope DIE info.<br>
+  DenseMap<const MDNode *, LocalScopeDieInfo> LocalScopeDieInfoMap;<br>
+<br>
   /// \brief Construct a DIE for the given DbgVariable without initializing the<br>
   /// DbgVariable's DIE reference.<br>
   DIE *constructVariableDIEImpl(const DbgVariable &DV, bool Abstract);<br>
@@ -117,8 +126,8 @@ public:<br>
<br>
   unsigned getOrCreateSourceID(StringRef FileName, StringRef DirName) override;<br>
<br>
-  void addImportedEntity(const DIImportedEntity* IE) {<br>
-    ImportedEntities[IE->getScope()].push_back(IE);<br>
+  void addLocalDeclNode(const DINode *DI, DILocalScope *Scope) {<br>
+    LocalDeclNodes[Scope].push_back(DI);<br>
   }<br>
<br>
   /// addRange - Add an address range to the list of ranges for this unit.<br>
@@ -166,7 +175,7 @@ public:<br>
   /// A helper function to create children of a Scope DIE.<br>
   DIE *createScopeChildrenDIE(LexicalScope *Scope,<br>
                               SmallVectorImpl<DIE *> &Children,<br>
-                              unsigned *ChildScopeCount = nullptr);<br>
+                              bool *HasNonScopeChildren = nullptr);<br>
<br>
   /// \brief Construct a DIE for this subprogram scope.<br>
   void constructSubprogramScopeDIE(LexicalScope *Scope);<br>
@@ -175,11 +184,15 @@ public:<br>
<br>
   void constructAbstractSubprogramScopeDIE(LexicalScope *Scope);<br>
<br>
+  /// \brief Get or create import_module DIE.<br>
+  DIE *getOrCreateImportedEntityDIE(const DIImportedEntity *Module);<br>
   /// \brief Construct import_module DIE.<br>
   DIE *constructImportedEntityDIE(const DIImportedEntity *Module);<br>
<br>
   void finishSubprogramDefinition(const DISubprogram *SP);<br>
<br>
+  void finishLocalScopeDefinitions();<br>
+<br>
   void collectDeadVariables(const DISubprogram *SP);<br>
<br>
   /// Set the skeleton unit associated with this unit.<br>
@@ -253,6 +266,15 @@ public:<br>
<br>
   void setBaseAddress(const MCSymbol *Base) { BaseAddress = Base; }<br>
   const MCSymbol *getBaseAddress() const { return BaseAddress; }<br>
+<br>
+  DenseMap<const MDNode *, LocalScopeDieInfo> &getLSDieInfoMap() {<br>
+    return LocalScopeDieInfoMap;<br>
+  }<br>
+<br>
+  /// Add local scope DIE entry to lexical scope info.<br>
+  void addLocalScopeDieToLexicalScope(LexicalScope *LS, DIE *D);<br>
+  /// Add local declaration DIE entry to lexical scope info.<br>
+  void addLocalDclDieToLexicalScope(LexicalScope *LS, DIE *D);<br>
 };<br>
<br>
 } // end llvm namespace<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=261633&r1=261632&r2=261633&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=261633&r1=261632&r2=261633&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Feb 23 07:36:51 2016<br>
@@ -455,6 +455,16 @@ void DwarfDebug::constructAndAddImported<br>
     D->addChild(TheCU.constructImportedEntityDIE(N));<br>
 }<br>
<br>
+bool DwarfDebug::collectLocalScopedNode(DIScope *S, const DINode *N,<br>
+                                        DwarfCompileUnit &CU) {<br>
+  if (auto LS = dyn_cast_or_null<DILocalScope>(S)) {<br>
+    getLocalScopes(LS->getSubprogram()).insert(LS);<br>
+    CU.addLocalDeclNode(N, LS);<br>
+    return true;<br>
+  }<br>
+  return false;<br>
+}<br>
+<br>
 // Emit all Dwarf sections that should come prior to the content. Create<br>
 // global DIEs and emit initial debug info sections. This is invoked by<br>
 // the target AsmPrinter.<br>
@@ -474,10 +484,9 @@ void DwarfDebug::beginModule() {<br>
   for (MDNode *N : CU_Nodes->operands()) {<br>
     auto *CUNode = cast<DICompileUnit>(N);<br>
     DwarfCompileUnit &CU = constructDwarfCompileUnit(CUNode);<br>
-    for (auto *IE : CUNode->getImportedEntities())<br>
-      CU.addImportedEntity(IE);<br>
     for (auto *GV : CUNode->getGlobalVariables())<br>
-      CU.getOrCreateGlobalVariableDIE(GV);<br>
+      if (!collectLocalScopedNode(GV->getScope(), GV, CU))<br>
+        CU.getOrCreateGlobalVariableDIE(GV);<br>
     for (auto *SP : CUNode->getSubprograms())<br>
       SPMap.insert(std::make_pair(SP, &CU));<br>
     for (auto *Ty : CUNode->getEnumTypes()) {<br>
@@ -489,14 +498,17 @@ void DwarfDebug::beginModule() {<br>
       // The retained types array by design contains pointers to<br>
       // MDNodes rather than DIRefs. Unique them here.<br>
       DIType *RT = cast<DIType>(resolve(Ty->getRef()));<br>
-      if (!RT->isExternalTypeRef())<br>
+      if (RT->isExternalTypeRef())<br>
         // There is no point in force-emitting a forward declaration.<br>
+        continue;<br>
+      if (!collectLocalScopedNode(resolve(Ty->getScope()), RT, CU))<br>
         CU.getOrCreateTypeDIE(RT);<br>
     }<br>
     // Emit imported_modules last so that the relevant context is already<br>
     // available.<br>
     for (auto *IE : CUNode->getImportedEntities())<br>
-      constructAndAddImportedEntityDIE(CU, IE);<br>
+      if (!collectLocalScopedNode(IE->getScope(), IE, CU))<br>
+        constructAndAddImportedEntityDIE(CU, IE);<br>
   }<br>
<br>
   // Tell MMI that we have debug info.<br>
@@ -529,6 +541,11 @@ void DwarfDebug::finishSubprogramDefinit<br>
     });<br>
 }<br>
<br>
+void DwarfDebug::finishLocalScopeDefinitions() {<br>
+  for (const auto &I : CUMap)<br>
+    I.second->finishLocalScopeDefinitions();<br>
+}<br>
+<br>
 // Collect info for variables that were optimized out.<br>
 void DwarfDebug::collectDeadVariables() {<br>
   const Module *M = MMI->getModule();<br>
@@ -554,6 +571,8 @@ void DwarfDebug::finalizeModuleInfo() {<br>
<br>
   finishSubprogramDefinitions();<br>
<br>
+  finishLocalScopeDefinitions();<br>
+<br>
   finishVariableDefinitions();<br>
<br>
   // Collect info for variables that were optimized out.<br>
@@ -1149,6 +1168,9 @@ void DwarfDebug::endFunction(const Machi<br>
       assert(LScopes.getAbstractScopesList().size() == NumAbstractScopes<br>
              && "ensureAbstractVariableIsCreated inserted abstract scopes");<br>
     }<br>
+    // Assure abstract local scope created for each one contains local DIEs.<br>
+    for (const DILocalScope *LS : getLocalScopes(SP))<br>
+      LScopes.getOrCreateAbstractScope(LS);<br>
     constructAbstractSubprogramScopeDIE(AScope);<br>
   }<br>
<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=261633&r1=261632&r2=261633&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=261633&r1=261632&r2=261633&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original)<br>
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Tue Feb 23 07:36:51 2016<br>
@@ -211,6 +211,10 @@ class DwarfDebug : public DebugHandlerBa<br>
   /// Size of each symbol emitted (for those symbols that have a specific size).<br>
   DenseMap<const MCSymbol *, uint64_t> SymSize;<br>
<br>
+  /// Holder for scopes containing local declaration DI nodes per DI function.<br>
+  DenseMap<const DISubprogram *, SmallPtrSet<const DILocalScope *, 16>><br>
+      LocalScopesMap;<br>
+<br>
   /// Collection of abstract variables.<br>
   DenseMap<const MDNode *, std::unique_ptr<DbgVariable>> AbstractVariables;<br>
   SmallVector<std::unique_ptr<DbgVariable>, 64> ConcreteVariables;<br>
@@ -327,6 +331,8 @@ class DwarfDebug : public DebugHandlerBa<br>
<br>
   void finishSubprogramDefinitions();<br>
<br>
+  void finishLocalScopeDefinitions();<br>
+<br>
   /// Finish off debug information after all functions have been<br>
   /// processed.<br>
   void finalizeModuleInfo();<br>
@@ -425,6 +431,11 @@ class DwarfDebug : public DebugHandlerBa<br>
   void constructAndAddImportedEntityDIE(DwarfCompileUnit &TheCU,<br>
                                         const DIImportedEntity *N);<br>
<br>
+  /// Collect MD Node located within local scope node.<br>
+  /// Return true if node was collected, false otherwise.<br>
+  bool collectLocalScopedNode(DIScope *S, const DINode *N,<br>
+                              DwarfCompileUnit &CU);<br>
+<br>
   /// Register a source line with debug info. Returns the unique<br>
   /// label that was emitted and which provides correspondence to the<br>
   /// source line list.<br>
@@ -567,6 +578,12 @@ public:<br>
   SmallPtrSet<const MDNode *, 16> &getProcessedSPNodes() {<br>
     return ProcessedSPNodes;<br>
   }<br>
+<br>
+  /// Return collection of function scopes that contains local declararion DIEs.<br>
+  SmallPtrSet<const DILocalScope *, 16> &<br>
+  getLocalScopes(const DISubprogram *SP) {<br>
+    return LocalScopesMap[SP];<br>
+  }<br>
 };<br>
 } // End of namespace llvm<br>
<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=261633&r1=261632&r2=261633&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp?rev=261633&r1=261632&r2=261633&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp Tue Feb 23 07:36:51 2016<br>
@@ -298,10 +298,15 @@ void DwarfUnit::addDIEEntry(DIE &Die, dw<br>
                Entry);<br>
 }<br>
<br>
-DIE &DwarfUnit::createAndAddDIE(unsigned Tag, DIE &Parent, const DINode *N) {<br>
-  DIE &Die = Parent.addChild(DIE::get(DIEValueAllocator, (dwarf::Tag)Tag));<br>
+DIE *DwarfUnit::createDIE(unsigned Tag, const DINode *N) {<br>
+  DIE *Die = DIE::get(DIEValueAllocator, (dwarf::Tag)Tag);<br>
   if (N)<br>
-    insertDIE(N, &Die);<br>
+    insertDIE(N, Die);<br>
+  return Die;<br>
+}<br>
+<br>
+DIE &DwarfUnit::createAndAddDIE(unsigned Tag, DIE &Parent, const DINode *N) {<br>
+  DIE &Die = Parent.addChild(createDIE(Tag, N));<br>
   return Die;<br>
 }<br>
<br>
@@ -727,15 +732,18 @@ DIE *DwarfUnit::getOrCreateTypeDIE(const<br>
<br>
   // Construct the context before querying for the existence of the DIE in case<br>
   // such construction creates the DIE.<br>
+  // For Local Scope, do not construct context DIE.<br>
   auto *Context = resolve(Ty->getScope());<br>
-  DIE *ContextDIE = getOrCreateContextDIE(Context);<br>
-  assert(ContextDIE);<br>
+  bool IsLocalScope = Context && isa<DILocalScope>(Context);<br>
+  DIE *ContextDIE = IsLocalScope ? nullptr : getOrCreateContextDIE(Context);<br>
+  assert(ContextDIE || IsLocalScope);<br>
<br>
   if (DIE *TyDIE = getDIE(Ty))<br>
     return TyDIE;<br>
<br>
-  // Create new type.<br>
-  DIE &TyDIE = createAndAddDIE(Ty->getTag(), *ContextDIE, Ty);<br>
+  // Create new type and add to map.<br>
+  DIE &TyDIE = IsLocalScope ? *createDIE(Ty->getTag(), Ty)<br>
+                            : createAndAddDIE(Ty->getTag(), *ContextDIE, Ty);<br>
<br>
   updateAcceleratorTables(Context, Ty, TyDIE);<br>
<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=261633&r1=261632&r2=261633&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h?rev=261633&r1=261632&r2=261633&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h (original)<br>
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h Tue Feb 23 07:36:51 2016<br>
@@ -298,6 +298,9 @@ public:<br>
   /// Construct function argument DIEs.<br>
   void constructSubprogramArguments(DIE &Buffer, DITypeRefArray Args);<br>
<br>
+  /// Create a DIE with the given Tag, and call insertDIE if MD is not null.<br>
+  DIE *createDIE(unsigned Tag, const DINode *N = nullptr);<br>
+<br>
   /// Create a DIE with the given Tag, add the DIE to its parent, and<br>
   /// call insertDIE if MD is not null.<br>
   DIE &createAndAddDIE(unsigned Tag, DIE &Parent, const DINode *N = nullptr);<br>
<br>
Modified: llvm/trunk/test/DebugInfo/Generic/2010-04-06-NestedFnDbgInfo.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Generic/2010-04-06-NestedFnDbgInfo.ll?rev=261633&r1=261632&r2=261633&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Generic/2010-04-06-NestedFnDbgInfo.ll?rev=261633&r1=261632&r2=261633&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/DebugInfo/Generic/2010-04-06-NestedFnDbgInfo.ll (original)<br>
+++ llvm/trunk/test/DebugInfo/Generic/2010-04-06-NestedFnDbgInfo.ll Tue Feb 23 07:36:51 2016<br>
@@ -74,7 +74,7 @@ entry:<br>
 !1 = distinct !DILexicalBlock(line: 15, column: 12, file: !38, scope: !2)<br>
 !2 = distinct !DISubprogram(name: "main", linkageName: "main", line: 15, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, scopeLine: 15, file: !38, scope: !3, type: !5)<br>
 !3 = !DIFile(filename: "one.cc", directory: "/tmp")<br>
-!4 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang 1.5", isOptimized: false, emissionKind: 0, file: !38, enums: !39, retainedTypes: !39, subprograms: !37, imports:  null)<br>
+!4 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang 1.5", isOptimized: false, emissionKind: 0, file: !38, enums: !39, retainedTypes: !41, subprograms: !37, imports:  null)<br>
 !5 = !DISubroutineType(types: !6)<br>
 !6 = !{!7}<br>
 !7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)<br>
@@ -112,3 +112,4 @@ entry:<br>
 !38 = !DIFile(filename: "one.cc", directory: "/tmp")<br>
 !39 = !{}<br>
 !40 = !{i32 1, !"Debug Info Version", i32 3}<br>
+!41 = !{!21}<br>
\ No newline at end of file<br>
<br>
Modified: llvm/trunk/test/DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll?rev=261633&r1=261632&r2=261633&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll?rev=261633&r1=261632&r2=261633&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll (original)<br>
+++ llvm/trunk/test/DebugInfo/Generic/2010-06-29-InlinedFnLocalVar.ll Tue Feb 23 07:36:51 2016<br>
@@ -27,7 +27,7 @@ entry:<br>
<br>
 !0 = distinct !DISubprogram(name: "foo", line: 9, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 9, file: !27, scope: !1, type: !3, variables: !24)<br>
 !1 = !DIFile(filename: "bar.c", directory: "/tmp/")<br>
-!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !27, enums: !20, retainedTypes: !20, subprograms: !25, globals: !26, imports:  !20)<br>
+!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !27, enums: !20, retainedTypes: !61, subprograms: !25, globals: !26, imports:  !20)<br>
 !3 = !DISubroutineType(types: !4)<br>
 !4 = !{!5, !5}<br>
 !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)<br>
@@ -39,6 +39,7 @@ entry:<br>
<br>
 !59 = !DILocalVariable(name: "j", line: 9, arg: 1, scope: !0, file: !1, type: !5)<br>
 !60 = !DILocalVariable(name: "xyz", line: 10, scope: !11, file: !1, type: !12)<br>
+!61 = !{!12}<br>
<br>
 !11 = distinct !DILexicalBlock(line: 9, column: 0, file: !1, scope: !0)<br>
 !12 = !DICompositeType(tag: DW_TAG_structure_type, name: "X", line: 10, size: 64, align: 32, file: !27, scope: !0, elements: !13)<br>
<br>
Modified: llvm/trunk/test/DebugInfo/Generic/cross-cu-linkonce-distinct.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Generic/cross-cu-linkonce-distinct.ll?rev=261633&r1=261632&r2=261633&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Generic/cross-cu-linkonce-distinct.ll?rev=261633&r1=261632&r2=261633&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/DebugInfo/Generic/cross-cu-linkonce-distinct.ll (original)<br>
+++ llvm/trunk/test/DebugInfo/Generic/cross-cu-linkonce-distinct.ll Tue Feb 23 07:36:51 2016<br>
@@ -32,7 +32,7 @@<br>
 ; CHECK:     DW_AT_name {{.*}} "func"<br>
 ; CHECK: DW_TAG_compile_unit<br>
<br>
-; FIXME: Maybe we should drop the subprogram here - since the function was<br>
+; Check that the subprogram is dropped in this CU - since the function was<br>
 ; emitted in one CU, due to linkonce_odr uniquing. We certainly don't emit the<br>
 ; subprogram here if the source location for this definition is the same (see<br>
 ; test/DebugInfo/cross-cu-linkonce.ll), though it's very easy to tickle that<br>
@@ -43,7 +43,7 @@<br>
 ; directory of the source file even though the file name is absolute, not<br>
 ; relative)<br>
<br>
-; CHECK: DW_TAG_subprogram<br>
+; CHECK-NOT: DW_TAG_subprogram<br>
<br>
 @x = global i32 (i32)* @_Z4funci, align 8<br>
 @y = global i32 (i32)* @_Z4funci, align 8<br>
@@ -64,7 +64,7 @@ declare void @llvm.dbg.declare(metadata,<br>
 attributes #0 = { inlinehint nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }<br>
 attributes #1 = { nounwind readnone }<br>
<br>
-!<a href="http://llvm.dbg.cu" rel="noreferrer" target="_blank">llvm.dbg.cu</a> = !{!12, !0}<br>
+!<a href="http://llvm.dbg.cu" rel="noreferrer" target="_blank">llvm.dbg.cu</a> = !{!0, !12}<br>
 !llvm.module.flags = !{!19, !20}<br>
 !llvm.ident = !{!21, !21}<br>
<br>
<br>
Modified: llvm/trunk/test/DebugInfo/Generic/namespace.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Generic/namespace.ll?rev=261633&r1=261632&r2=261633&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Generic/namespace.ll?rev=261633&r1=261632&r2=261633&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/DebugInfo/Generic/namespace.ll (original)<br>
+++ llvm/trunk/test/DebugInfo/Generic/namespace.ll Tue Feb 23 07:36:51 2016<br>
@@ -23,6 +23,11 @@<br>
 ; CHECK-NOT: NULL<br>
 ; CHECK: [[BAR:0x[0-9a-f]*]]:{{ *}}DW_TAG_structure_type<br>
 ; CHECK-NEXT: DW_AT_name{{.*}}= "bar"<br>
+; CHECK: DW_TAG_subprogram<br>
+; CHECK-NOT: DW_TAG<br>
+; CHECK: DW_AT_MIPS_linkage_name<br>
+; CHECK-NOT: DW_TAG<br>
+; CHECK: DW_AT_name{{.*}}= "f1"<br>
 ; CHECK: [[FUNC1:.*]]: DW_TAG_subprogram<br>
 ; CHECK-NOT: DW_TAG<br>
 ; CHECK: DW_AT_MIPS_linkage_name<br>
@@ -45,11 +50,6 @@<br>
 ; CHECK-NOT: DW_TAG<br>
 ; CHECK: DW_AT_name{{.*}}= "func_fwd"<br>
 ; CHECK-NOT: DW_AT_declaration<br>
-; CHECK: DW_TAG_subprogram<br>
-; CHECK-NOT: DW_TAG<br>
-; CHECK: DW_AT_MIPS_linkage_name<br>
-; CHECK-NOT: DW_TAG<br>
-; CHECK: DW_AT_name{{.*}}= "f1"<br>
 ; CHECK: NULL<br>
<br>
 ; CHECK-NOT: NULL<br>
@@ -71,10 +71,23 @@<br>
<br>
 ; CHECK: DW_TAG_subprogram<br>
 ; CHECK-NOT: DW_TAG<br>
+; CHECK: DW_AT_name{{.*}}= "__cxx_global_var_init"<br>
+; CHECK-NOT: DW_TAG<br>
+<br>
+; CHECK: DW_TAG_subprogram<br>
+; CHECK-NOT: DW_TAG<br>
 ; CHECK: DW_AT_MIPS_linkage_name<br>
 ; CHECK-NOT: DW_TAG<br>
 ; CHECK: DW_AT_name{{.*}}= "func"<br>
 ; CHECK-NOT: NULL<br>
+; CHECK: DW_TAG_lexical_block<br>
+; CHECK-NOT: NULL<br>
+; CHECK: DW_TAG_imported_module<br>
+; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2]])<br>
+; CHECK-NEXT: DW_AT_decl_line{{.*}}(23)<br>
+; CHECK-NEXT: DW_AT_import{{.*}}=><br>
+; CHECK: NULL<br>
+; CHECK-NOT: NULL<br>
 ; CHECK: DW_TAG_imported_module<br>
 ; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2]])<br>
 ; CHECK-NEXT: DW_AT_decl_line{{.*}}(26)<br>
@@ -134,13 +147,6 @@<br>
 ; CHECK-NEXT: DW_AT_decl_line{{.*}}(37)<br>
 ; CHECK-NEXT: DW_AT_import{{.*}}=> {[[FUNC_FWD]]})<br>
<br>
-; CHECK: DW_TAG_lexical_block<br>
-; CHECK-NOT: NULL<br>
-; CHECK: DW_TAG_imported_module<br>
-; CHECK-NEXT: DW_AT_decl_file{{.*}}([[F2]])<br>
-; CHECK-NEXT: DW_AT_decl_line{{.*}}(23)<br>
-; CHECK-NEXT: DW_AT_import{{.*}}=><br>
-; CHECK: NULL<br>
 ; CHECK: NULL<br>
 ; CHECK: NULL<br>
<br>
<br>
Modified: llvm/trunk/test/DebugInfo/Generic/nodebug.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Generic/nodebug.ll?rev=261633&r1=261632&r2=261633&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Generic/nodebug.ll?rev=261633&r1=261632&r2=261633&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/DebugInfo/Generic/nodebug.ll (original)<br>
+++ llvm/trunk/test/DebugInfo/Generic/nodebug.ll Tue Feb 23 07:36:51 2016<br>
@@ -16,10 +16,8 @@<br>
 ;   f1();<br>
 ; }<br>
<br>
-; Check that there's only one DW_TAG_subprogram, nothing for the 'f2' function.<br>
-; CHECK: DW_TAG_subprogram<br>
-; CHECK-NOT: DW_TAG<br>
-; CHECK:   DW_AT_name {{.*}} "f1"<br>
+; Check that there is no DW_TAG_subprogram, nothing for the 'f2' function.<br>
+; Note: No debug info was emitted for 'f1' function because it has no code.<br>
 ; CHECK-NOT: DW_TAG_subprogram<br>
<br>
 @i = external global i32<br>
<br>
Modified: llvm/trunk/test/DebugInfo/Mips/InlinedFnLocalVar.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Mips/InlinedFnLocalVar.ll?rev=261633&r1=261632&r2=261633&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Mips/InlinedFnLocalVar.ll?rev=261633&r1=261632&r2=261633&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/DebugInfo/Mips/InlinedFnLocalVar.ll (original)<br>
+++ llvm/trunk/test/DebugInfo/Mips/InlinedFnLocalVar.ll Tue Feb 23 07:36:51 2016<br>
@@ -27,7 +27,7 @@ entry:<br>
<br>
 !0 = distinct !DISubprogram(name: "foo", line: 9, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 9, file: !27, scope: !1, type: !3, variables: !24)<br>
 !1 = !DIFile(filename: "bar.c", directory: "/tmp/")<br>
-!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !27, enums: !20, retainedTypes: !20, subprograms: !25, globals: !26, imports:  !20)<br>
+!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !27, enums: !20, retainedTypes: !61, subprograms: !25, globals: !26, imports:  !20)<br>
 !3 = !DISubroutineType(types: !4)<br>
 !4 = !{!5, !5}<br>
 !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)<br>
@@ -39,6 +39,7 @@ entry:<br>
<br>
 !59 = !DILocalVariable(name: "j", line: 9, arg: 1, scope: !0, file: !1, type: !5)<br>
 !60 = !DILocalVariable(name: "xyz", line: 10, scope: !11, file: !1, type: !12)<br>
+!61 = !{!12}<br>
<br>
 !11 = distinct !DILexicalBlock(line: 9, column: 0, file: !1, scope: !0)<br>
 !12 = !DICompositeType(tag: DW_TAG_structure_type, name: "X", line: 10, size: 64, align: 32, file: !27, scope: !0, elements: !13)<br>
<br>
Modified: llvm/trunk/test/DebugInfo/X86/InlinedFnLocalVar.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/InlinedFnLocalVar.ll?rev=261633&r1=261632&r2=261633&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/InlinedFnLocalVar.ll?rev=261633&r1=261632&r2=261633&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/DebugInfo/X86/InlinedFnLocalVar.ll (original)<br>
+++ llvm/trunk/test/DebugInfo/X86/InlinedFnLocalVar.ll Tue Feb 23 07:36:51 2016<br>
@@ -27,7 +27,7 @@ entry:<br>
<br>
 !0 = distinct !DISubprogram(name: "foo", line: 9, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 9, file: !27, scope: !1, type: !3, variables: !24)<br>
 !1 = !DIFile(filename: "bar.c", directory: "/tmp/")<br>
-!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !27, enums: !20, retainedTypes: !20, subprograms: !25, globals: !26, imports:  !20)<br>
+!2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !27, enums: !20, retainedTypes: !111, subprograms: !25, globals: !26, imports:  !20)<br>
 !3 = !DISubroutineType(types: !4)<br>
 !4 = !{!5, !5}<br>
 !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)<br>
@@ -39,6 +39,7 @@ entry:<br>
<br>
 !109 = !DILocalVariable(name: "j", line: 9, arg: 1, scope: !0, file: !1, type: !5)<br>
 !110 = !DILocalVariable(name: "xyz", line: 10, scope: !11, file: !1, type: !12)<br>
+!111 = !{!12}<br>
<br>
 !11 = distinct !DILexicalBlock(line: 9, column: 0, file: !1, scope: !0)<br>
 !12 = !DICompositeType(tag: DW_TAG_structure_type, name: "X", line: 10, size: 64, align: 32, file: !27, scope: !0, elements: !13)<br>
<br>
Added: llvm/trunk/test/DebugInfo/X86/PR24008.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/PR24008.ll?rev=261633&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/PR24008.ll?rev=261633&view=auto</a><br>
==============================================================================<br>
--- llvm/trunk/test/DebugInfo/X86/PR24008.ll (added)<br>
+++ llvm/trunk/test/DebugInfo/X86/PR24008.ll Tue Feb 23 07:36:51 2016<br>
@@ -0,0 +1,67 @@<br>
+; RUN: llc -mtriple=x86_64-unknown-linux-gnu -filetype=obj -O0 < %s  | llvm-dwarfdump -debug-dump=info - | FileCheck %s<br>
+<br>
+;; This test checks the following:<br>
+;; 1. Compilation does not crash<br>
+;; 2. "f1" function is defined.<br>
+;; 3. "nested::f2" function is not defined.<br>
+;;<br>
+;; This test was generated by running following command:<br>
+;; clang -cc1 -O0 -g -emit-llvm foo.cpp -o - | opt -S -inline -sroa<br>
+;; Where test.cpp<br>
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
+;;void f1() {<br>
+;;  while (true) {<br>
+;;    struct nested {<br>
+;;      static void f2() {}<br>
+;;    };<br>
+;;    nested::f2();<br>
+;;  }<br>
+;;}<br>
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
+<br>
+; CHECK:      DW_TAG_compile_unit<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:        DW_TAG_subprogram<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:          DW_AT_name {{.*}} "f1"<br>
+; CHECK:        NULL<br>
+<br>
+; CHECK-NOT: DW_TAG_subprogram<br>
+<br>
+<br>
+; Function Attrs: nounwind<br>
+define void @_Z2f1v() #0 !dbg !6 {<br>
+entry:<br>
+  br label %while.body, !dbg !16<br>
+<br>
+while.body:                                       ; preds = %while.body, %entry<br>
+  br label %while.body, !dbg !16<br>
+<br>
+return:                                           ; No predecessors!<br>
+  ret void, !dbg !17<br>
+}<br>
+<br>
+attributes #0 = { nounwind "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }<br>
+<br>
+!<a href="http://llvm.dbg.cu" rel="noreferrer" target="_blank">llvm.dbg.cu</a> = !{!0}<br>
+!llvm.module.flags = !{!13, !14}<br>
+!llvm.ident = !{!15}<br>
+<br>
+!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 242994) (llvm/trunk 242995)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !3, subprograms: !11)<br>
+!1 = !DIFile(filename: "foo.cpp", directory: "/")<br>
+!2 = !{}<br>
+!3 = !{!4}<br>
+!4 = !DICompositeType(tag: DW_TAG_structure_type, name: "nested", scope: !5, file: !1, line: 3, size: 8, align: 8, elements: !9)<br>
+!5 = distinct !DILexicalBlock(scope: !6, file: !1, line: 2)<br>
+!6 = distinct !DISubprogram(name: "f1", linkageName: "_Z2f1v", scope: !1, file: !1, line: 1, type: !7, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, variables: !2)<br>
+!7 = !DISubroutineType(types: !8)<br>
+!8 = !{null}<br>
+!9 = !{!10}<br>
+!10 = distinct !DISubprogram(name: "f2", scope: !4, file: !1, line: 4, type: !7, isLocal: false, isDefinition: false, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false)<br>
+!11 = !{!6, !12}<br>
+!12 = distinct !DISubprogram(name: "f2", linkageName: "_ZZ2f1vEN6nested2f2Ev", scope: !4, file: !1, line: 4, type: !7, isLocal: true, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false, declaration: !10, variables: !2)<br>
+!13 = !{i32 2, !"Dwarf Version", i32 4}<br>
+!14 = !{i32 2, !"Debug Info Version", i32 3}<br>
+!15 = !{!"clang version 3.8.0 (trunk 242994) (llvm/trunk 242995)"}<br>
+!16 = !DILocation(line: 2, scope: !6)<br>
+!17 = !DILocation(line: 8, scope: !6)<br>
<br>
Modified: llvm/trunk/test/DebugInfo/X86/dbg-file-name.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/dbg-file-name.ll?rev=261633&r1=261632&r2=261633&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/dbg-file-name.ll?rev=261633&r1=261632&r2=261633&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/DebugInfo/X86/dbg-file-name.ll (original)<br>
+++ llvm/trunk/test/DebugInfo/X86/dbg-file-name.ll Tue Feb 23 07:36:51 2016<br>
@@ -6,7 +6,7 @@<br>
 declare i32 @printf(i8*, ...) nounwind<br>
<br>
 define i32 @main() nounwind !dbg !6 {<br>
-  ret i32 0<br>
+  ret i32 0, !dbg !13<br>
 }<br>
<br>
 !<a href="http://llvm.dbg.cu" rel="noreferrer" target="_blank">llvm.dbg.cu</a> = !{!2}<br>
@@ -22,3 +22,4 @@ define i32 @main() nounwind !dbg !6 {<br>
 !10 = !DIFile(filename: "simple.c", directory: "/Users/manav/one/two")<br>
 !11 = !{}<br>
 !12 = !{i32 1, !"Debug Info Version", i32 3}<br>
+!13 = !DILocation(line: 10, scope: !6)<br>
<br>
Modified: llvm/trunk/test/DebugInfo/X86/debug-dead-local-var.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/debug-dead-local-var.ll?rev=261633&r1=261632&r2=261633&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/debug-dead-local-var.ll?rev=261633&r1=261632&r2=261633&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/DebugInfo/X86/debug-dead-local-var.ll (original)<br>
+++ llvm/trunk/test/DebugInfo/X86/debug-dead-local-var.ll Tue Feb 23 07:36:51 2016<br>
@@ -11,9 +11,9 @@<br>
 ;   return 1;<br>
 ; }<br>
<br>
-; Check that we still have the structure type for X even though we're not<br>
-; going to emit a low/high_pc for foo.<br>
-; CHECK: DW_TAG_structure_type<br>
+; Check that we will not have the structure type for X as we are going to omit<br>
+; the function foo.<br>
+; CHECK-NOT: DW_TAG_structure_type<br>
<br>
 ; Function Attrs: nounwind readnone uwtable<br>
 define i32 @bar() #0 !dbg !4 {<br>
@@ -27,7 +27,7 @@ attributes #0 = { nounwind readnone uwta<br>
 !llvm.module.flags = !{!18, !19}<br>
 !llvm.ident = !{!20}<br>
<br>
-!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 (trunk 209255) (llvm/trunk 209253)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)<br>
+!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 (trunk 209255) (llvm/trunk 209253)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !22, subprograms: !3, globals: !2, imports: !2)<br>
 !1 = !DIFile(filename: "debug-dead-local-var.c", directory: "/usr/local/google/home/echristo")<br>
 !2 = !{}<br>
 !3 = !{!4, !9}<br>
@@ -49,3 +49,4 @@ attributes #0 = { nounwind readnone uwta<br>
 !19 = !{i32 2, !"Debug Info Version", i32 3}<br>
 !20 = !{!"clang version 3.5.0 (trunk 209255) (llvm/trunk 209253)"}<br>
 !21 = !DILocation(line: 13, scope: !4)<br>
+!22 = !{!14}<br>
<br>
Modified: llvm/trunk/test/DebugInfo/X86/gnu-public-names.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/gnu-public-names.ll?rev=261633&r1=261632&r2=261633&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/gnu-public-names.ll?rev=261633&r1=261632&r2=261633&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/DebugInfo/X86/gnu-public-names.ll (original)<br>
+++ llvm/trunk/test/DebugInfo/X86/gnu-public-names.ll Tue Feb 23 07:36:51 2016<br>
@@ -123,17 +123,6 @@<br>
 ; CHECK: DW_AT_linkage_name<br>
 ; CHECK-NOT: DW_TAG<br>
 ; CHECK: DW_AT_name {{.*}} "global_namespace_function"<br>
-<br>
-; CHECK: DW_TAG_subprogram<br>
-; CHECK-NOT: DW_TAG<br>
-; CHECK:   DW_AT_name {{.*}} "f3"<br>
-; CHECK-NOT: {{DW_TAG|NULL}}<br>
-; CHECK: [[F3_Z:.*]]:   DW_TAG_variable<br>
-; CHECK-NOT: DW_TAG<br>
-; CHECK:     DW_AT_name {{.*}} "z"<br>
-; CHECK-NOT: {{DW_TAG|NULL}}<br>
-; CHECK:     DW_AT_location<br>
-; CHECK-NOT: {{DW_TAG|NULL}}<br>
 ; CHECK:   NULL<br>
 ; CHECK-NOT: {{DW_TAG|NULL}}<br>
<br>
@@ -194,6 +183,18 @@<br>
 ; CHECK-NOT: DW_TAG<br>
 ; CHECK: DW_AT_name {{.*}} "global_function"<br>
<br>
+; CHECK: DW_TAG_subprogram<br>
+; CHECK-NOT: DW_TAG<br>
+; CHECK:   DW_AT_name {{.*}} "f3"<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK: [[F3_Z:.*]]:   DW_TAG_variable<br>
+; CHECK-NOT: DW_TAG<br>
+; CHECK:     DW_AT_name {{.*}} "z"<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:     DW_AT_location<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:   NULL<br>
+<br>
 ; CHECK-LABEL: .debug_gnu_pubnames contents:<br>
 ; CHECK-NEXT: length = {{.*}} version = 0x0002 unit_offset = 0x00000000 unit_size = {{.*}}<br>
 ; CHECK-NEXT: Offset     Linkage  Kind     Name<br>
@@ -201,12 +202,12 @@<br>
 ; CHECK-NEXT:  [[NS]] EXTERNAL TYPE     "ns"<br>
 ; CHECK-NEXT:  [[OUTER_ANON_C]] STATIC VARIABLE "outer::(anonymous namespace)::c"<br>
 ; CHECK-NEXT:  [[ANON_I]] STATIC VARIABLE "(anonymous namespace)::i"<br>
+; CHECK-NEXT:  [[ANON]] EXTERNAL TYPE "(anonymous namespace)"<br>
 ; GCC Doesn't put local statics in pubnames, but it seems not unreasonable and<br>
 ; comes out naturally from LLVM's implementation, so I'm OK with it for now. If<br>
 ; it's demonstrated that this is a major size concern or degrades debug info<br>
 ; consumer behavior, feel free to change it.<br>
 ; CHECK-NEXT:  [[F3_Z]] STATIC VARIABLE "f3::z"<br>
-; CHECK-NEXT:  [[ANON]] EXTERNAL TYPE "(anonymous namespace)"<br>
 ; CHECK-NEXT:  [[OUTER_ANON]] EXTERNAL TYPE "outer::(anonymous namespace)"<br>
 ; CHECK-NEXT:  [[ANON_INNER_B]] STATIC VARIABLE "(anonymous namespace)::inner::b"<br>
 ; CHECK-NEXT:  [[OUTER]] EXTERNAL TYPE "outer"<br>
<br>
Added: llvm/trunk/test/DebugInfo/X86/lexical-block-inline.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/lexical-block-inline.ll?rev=261633&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/lexical-block-inline.ll?rev=261633&view=auto</a><br>
==============================================================================<br>
--- llvm/trunk/test/DebugInfo/X86/lexical-block-inline.ll (added)<br>
+++ llvm/trunk/test/DebugInfo/X86/lexical-block-inline.ll Tue Feb 23 07:36:51 2016<br>
@@ -0,0 +1,198 @@<br>
+; RUN: llc -mtriple=x86_64-unknown-linux-gnu -filetype=obj -O0 < %s  | llvm-dwarfdump -debug-dump=info - | FileCheck %s<br>
+; RUN: llc -mtriple=x86_64-unknown-linux-gnu -split-dwarf=Enable -filetype=obj -O0 < %s  | llvm-dwarfdump -debug-dump=info.dwo - | FileCheck %s<br>
+<br>
+;; This test checks the following:<br>
+;; 1. Useless lexical block entry is not emitted.<br>
+;; 2. Function static variable, typedef, records (structure, class and union)<br>
+;;    that are defined in lexical basic block are emitted as children to<br>
+;;    these lexical blocks.<br>
+;;    * For typedef and record check that both are emitted in lexical block<br>
+;;      where they are declared and not in the one where they are used.<br>
+;; 3. "bar" function, which was inlined into "foo" function, is created as<br>
+;;    abstract (with DW_AT_inline attribute).<br>
+;;    All variables and types are defined in this abstract entry.<br>
+;; 4. "bar" function is created in "foo" function as inlined function<br>
+;;    (with DW_TAG_inlined_subroutine attribute), and all its local variables<br>
+;;    are created as concrete variables pointing to the abstract suitable entry<br>
+;;    defined under abstract "bar" function.<br>
+;; 5. Lexical block entries created in the inline "bar" function entry have<br>
+;;    "DW_AT_abstract_origin" attribute pointing to the equivalent abstract<br>
+;;    lexical block entry.<br>
+;;<br>
+;; This test was generated by running following command:<br>
+;; clang -cc1 -O0 -g -emit-llvm foo.cpp -o - | opt -S -inline -sroa<br>
+;; Where foo.cpp<br>
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
+;;__inline int bar(int s) {<br>
+;;  {<br>
+;;    {<br>
+;;      struct X {<br>
+;;          int x;<br>
+;;      };<br>
+;;      typedef int Y;<br>
+;;      {<br>
+;;        X a = { s };<br>
+;;        Y b(s);<br>
+;;        static int c = 0;<br>
+;;        return a.x + b + c++;<br>
+;;      }<br>
+;;    }<br>
+;;  }<br>
+;;}<br>
+;;<br>
+;;<br>
+;;int foo(int i) {<br>
+;;  return<br>
+;;    bar(i);<br>
+;;}<br>
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
+<br>
+; CHECK:    [[Offset_bar:0x[0-9abcdef]+]]: DW_TAG_subprogram<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:      DW_AT_name {{.*}} "bar"<br>
+; CHECK:      DW_AT_inline<br>
+; CHECK-NOT: NULL<br>
+; CHECK:      DW_TAG_lexical_block<br>
+<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:        [[Offset_LB2:0x[0-9abcdef]+]]: DW_TAG_lexical_block<br>
+<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:        [[Offset_a:0x[0-9abcdef]+]]: DW_TAG_variable<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:          DW_AT_name {{.*}} "a"<br>
+<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:        [[Offset_b:0x[0-9abcdef]+]]: DW_TAG_variable<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:          DW_AT_name {{.*}} "b"<br>
+<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:        [[Offset_c:0x[0-9abcdef]+]]: DW_TAG_variable<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:          DW_AT_name {{.*}} "c"<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:          DW_AT_location<br>
+<br>
+; CHECK-NOT: {{DW_TAG}}<br>
+; CHECK:        NULL<br>
+<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:      [[Offset_X:0x[0-9abcdef]+]]: DW_TAG_structure_type<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:        DW_AT_name {{.*}} "X"<br>
+; CHECK:        NULL<br>
+<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:      [[Offset_Y:0x[0-9abcdef]+]]: DW_TAG_typedef<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:        DW_AT_name {{.*}} "Y"<br>
+<br>
+; CHECK-NOT: {{DW_TAG}}<br>
+; CHECK:      NULL<br>
+<br>
+<br>
+; CHECK:    DW_TAG_subprogram<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:      DW_AT_name {{.*}} "foo"<br>
+; CHECK-NOT: {{NULL}}<br>
+; CHECK:      DW_TAG_inlined_subroutine<br>
+; CHECK-NEXT:   DW_AT_abstract_origin {{.*}} {[[Offset_bar]]}<br>
+<br>
+; CHECK-NOT: {{NULL}}<br>
+; CHECK:        DW_TAG_lexical_block<br>
+<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:        DW_TAG_lexical_block<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:       DW_AT_abstract_origin {{.*}} {[[Offset_LB2]]}<br>
+<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:          DW_TAG_variable<br>
+; CHECK-NEXT:       DW_AT_location<br>
+; CHECK-NEXT:       DW_AT_abstract_origin {{.*}} {[[Offset_a]]}<br>
+<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:          DW_TAG_variable<br>
+; CHECK-NEXT:       DW_AT_location<br>
+; CHECK-NEXT:       DW_AT_abstract_origin {{.*}} {[[Offset_b]]}<br>
+<br>
+; CHECK-NOT: {{DW_TAG}}<br>
+; CHECK:      NULL<br>
+<br>
+; CHECK-NOT: {{DW_TAG}}<br>
+; CHECK:      NULL<br>
+<br>
+%struct.X = type { i32 }<br>
+<br>
+$_ZZ3bariE1c = comdat any<br>
+<br>
+@_ZZ3bariE1c = linkonce_odr global i32 0, comdat, align 4<br>
+<br>
+; Function Attrs: nounwind<br>
+define i32 @_Z3fooi(i32 %i) #0 !dbg !15 {<br>
+entry:<br>
+  call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !22, metadata !23), !dbg !24<br>
+  call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !25, metadata !23), !dbg !26<br>
+  call void @llvm.dbg.declare(metadata %struct.X* undef, metadata !28, metadata !23), !dbg !29<br>
+  call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !28, metadata !23), !dbg !29<br>
+  call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !30, metadata !23), !dbg !31<br>
+  %add.i = add nsw i32 %i, %i, !dbg !32<br>
+  %0 = load i32, i32* @_ZZ3bariE1c, align 4, !dbg !32<br>
+  %inc.i = add nsw i32 %0, 1, !dbg !32<br>
+  store i32 %inc.i, i32* @_ZZ3bariE1c, align 4, !dbg !32<br>
+  %add2.i = add nsw i32 %add.i, %0, !dbg !32<br>
+  ret i32 %add2.i, !dbg !33<br>
+}<br>
+<br>
+; Function Attrs: nounwind readnone<br>
+declare void @llvm.dbg.declare(metadata, metadata, metadata) #1<br>
+<br>
+; Function Attrs: nounwind readnone<br>
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1<br>
+<br>
+attributes #0 = { nounwind "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }<br>
+attributes #1 = { nounwind readnone }<br>
+<br>
+!<a href="http://llvm.dbg.cu" rel="noreferrer" target="_blank">llvm.dbg.cu</a> = !{!0, !34}<br>
+!llvm.module.flags = !{!19, !20}<br>
+!llvm.ident = !{!21}<br>
+<br>
+!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 242994) (llvm/trunk 242995)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !3, subprograms: !14, globals: !16)<br>
+!1 = !DIFile(filename: "foo.cpp", directory: "/")<br>
+!2 = !{}<br>
+!3 = !{!4, !13}<br>
+!4 = !DICompositeType(tag: DW_TAG_structure_type, name: "X", scope: !5, file: !1, line: 4, size: 32, align: 32, elements: !11, identifier: "_ZTSZ3bariE1X")<br>
+!5 = distinct !DILexicalBlock(scope: !6, file: !1, line: 3)<br>
+!6 = distinct !DILexicalBlock(scope: !7, file: !1, line: 2)<br>
+!7 = distinct !DISubprogram(name: "bar", linkageName: "_Z3bari", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, variables: !2)<br>
+!8 = !DISubroutineType(types: !9)<br>
+!9 = !{!10, !10}<br>
+!10 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)<br>
+!11 = !{!12}<br>
+!12 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !"_ZTSZ3bariE1X", file: !1, line: 5, baseType: !10, size: 32, align: 32)<br>
+!13 = !DIDerivedType(tag: DW_TAG_typedef, name: "Y", scope: !5, file: !1, line: 7, baseType: !10)<br>
+!14 = !{!15, !7}<br>
+!15 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooi", scope: !1, file: !1, line: 19, type: !8, isLocal: false, isDefinition: true, scopeLine: 19, flags: DIFlagPrototyped, isOptimized: false, variables: !2)<br>
+!16 = !{!17}<br>
+!17 = !DIGlobalVariable(name: "c", scope: !18, file: !1, line: 11, type: !10, isLocal: false, isDefinition: true, variable: i32* @_ZZ3bariE1c)<br>
+!18 = distinct !DILexicalBlock(scope: !5, file: !1, line: 8)<br>
+!19 = !{i32 2, !"Dwarf Version", i32 4}<br>
+!20 = !{i32 2, !"Debug Info Version", i32 3}<br>
+!21 = !{!"clang version 3.8.0 (trunk 242994) (llvm/trunk 242995)"}<br>
+!22 = !DILocalVariable(name: "i", arg: 1, scope: !15, file: !1, line: 19, type: !10)<br>
+!23 = !DIExpression()<br>
+!24 = !DILocation(line: 19, scope: !15)<br>
+!25 = !DILocalVariable(name: "s", arg: 1, scope: !7, file: !1, line: 1, type: !10)<br>
+!26 = !DILocation(line: 1, scope: !7, inlinedAt: !27)<br>
+!27 = distinct !DILocation(line: 21, scope: !15)<br>
+!28 = !DILocalVariable(name: "a", scope: !18, file: !1, line: 9, type: !"_ZTSZ3bariE1X")<br>
+!29 = !DILocation(line: 9, scope: !18, inlinedAt: !27)<br>
+!30 = !DILocalVariable(name: "b", scope: !18, file: !1, line: 10, type: !13)<br>
+!31 = !DILocation(line: 10, scope: !18, inlinedAt: !27)<br>
+!32 = !DILocation(line: 12, scope: !18, inlinedAt: !27)<br>
+!33 = !DILocation(line: 20, scope: !15)<br>
+<br>
+; This line is manually added to check that the test does not crash when having<br>
+; more than one compile unit!<br>
+!34 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 242994) (llvm/trunk 242995)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !2)<br>
<br>
Added: llvm/trunk/test/DebugInfo/X86/lexical-block.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/lexical-block.ll?rev=261633&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/lexical-block.ll?rev=261633&view=auto</a><br>
==============================================================================<br>
--- llvm/trunk/test/DebugInfo/X86/lexical-block.ll (added)<br>
+++ llvm/trunk/test/DebugInfo/X86/lexical-block.ll Tue Feb 23 07:36:51 2016<br>
@@ -0,0 +1,131 @@<br>
+; RUN: llc -mtriple=x86_64-unknown-linux-gnu -filetype=obj -O0 < %s  | llvm-dwarfdump -debug-dump=info - | FileCheck %s<br>
+<br>
+;; This test checks the following:<br>
+;; 1. Useless lexical block entry is not emitted.<br>
+;; 2. Function static variable, typedef, records (structure, class and union)<br>
+;;    that are defined in lexical basic block are emitted as children to<br>
+;;    these lexical blocks.<br>
+;;    * For typedef and record check that both are emitted in lexical block<br>
+;;      where they are declared and not in the one where they are used.<br>
+;;<br>
+;; This test was generated by running following command:<br>
+;; clang -cc1 -O0 -g -emit-llvm foo.cpp<br>
+;; Where foo.cpp<br>
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
+;;int foo(void) {<br>
+;;  {<br>
+;;    {<br>
+;;      struct X {<br>
+;;        int x;<br>
+;;      };<br>
+;;      typedef int Y;<br>
+;;      {<br>
+;;        X a;<br>
+;;        Y b;<br>
+;;        static int c;<br>
+;;        return a.x + b + c;<br>
+;;      }<br>
+;;    }<br>
+;;  }<br>
+;;}<br>
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
+<br>
+<br>
+; CHECK:    DW_TAG_subprogram<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:      DW_AT_name {{.*}} "foo"<br>
+; CHECK-NOT: NULL<br>
+; CHECK:      DW_TAG_lexical_block<br>
+<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:        DW_TAG_lexical_block<br>
+<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:          DW_TAG_variable<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:            DW_AT_name {{.*}} "a"<br>
+<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:          DW_TAG_variable<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:            DW_AT_name {{.*}} "b"<br>
+<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:          DW_TAG_variable<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:            DW_AT_name {{.*}} "c"<br>
+<br>
+; CHECK-NOT: {{DW_TAG}}<br>
+; CHECK:          NULL<br>
+<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:        DW_TAG_structure_type<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:          DW_AT_name {{.*}} "X"<br>
+; CHECK:          NULL<br>
+<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:        DW_TAG_typedef<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:          DW_AT_name {{.*}} "Y"<br>
+<br>
+; CHECK-NOT: {{DW_TAG}}<br>
+; CHECK:          NULL<br>
+<br>
+%struct.X = type { i32 }<br>
+<br>
+@_ZZ3foovE1c = internal global i32 0, align 4<br>
+<br>
+; Function Attrs: nounwind<br>
+define i32 @_Z3foov() #0 !dbg !7 {<br>
+entry:<br>
+  %a = alloca %struct.X, align 4<br>
+  %b = alloca i32, align 4<br>
+  call void @llvm.dbg.declare(metadata %struct.X* %a, metadata !21, metadata !22), !dbg !23<br>
+  call void @llvm.dbg.declare(metadata i32* %b, metadata !24, metadata !22), !dbg !25<br>
+  %x = getelementptr inbounds %struct.X, %struct.X* %a, i32 0, i32 0, !dbg !26<br>
+  %0 = load i32, i32* %x, align 4, !dbg !26<br>
+  %1 = load i32, i32* %b, align 4, !dbg !26<br>
+  %add = add nsw i32 %0, %1, !dbg !26<br>
+  %2 = load i32, i32* @_ZZ3foovE1c, align 4, !dbg !26<br>
+  %add1 = add nsw i32 %add, %2, !dbg !26<br>
+  ret i32 %add1, !dbg !26<br>
+}<br>
+<br>
+; Function Attrs: nounwind readnone<br>
+declare void @llvm.dbg.declare(metadata, metadata, metadata) #1<br>
+<br>
+attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }<br>
+attributes #1 = { nounwind readnone }<br>
+<br>
+!<a href="http://llvm.dbg.cu" rel="noreferrer" target="_blank">llvm.dbg.cu</a> = !{!0}<br>
+!llvm.module.flags = !{!18, !19}<br>
+!llvm.ident = !{!20}<br>
+<br>
+!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.7.0 (trunk 237245)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !3, subprograms: !14, globals: !15, imports: !2)<br>
+!1 = !DIFile(filename: "foo.cpp", directory: "/")<br>
+!2 = !{}<br>
+!3 = !{!4, !13}<br>
+!4 = !DICompositeType(tag: DW_TAG_structure_type, name: "X", scope: !5, file: !1, line: 4, size: 32, align: 32, elements: !11)<br>
+!5 = distinct !DILexicalBlock(scope: !6, file: !1, line: 3)<br>
+!6 = distinct !DILexicalBlock(scope: !7, file: !1, line: 2)<br>
+!7 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, variables: !2)<br>
+!8 = !DISubroutineType(types: !9)<br>
+!9 = !{!10}<br>
+!10 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)<br>
+!11 = !{!12}<br>
+!12 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !4, file: !1, line: 5, baseType: !10, size: 32, align: 32)<br>
+!13 = !DIDerivedType(tag: DW_TAG_typedef, name: "Y", scope: !5, file: !1, line: 7, baseType: !10)<br>
+!14 = !{!7}<br>
+!15 = !{!16}<br>
+!16 = !DIGlobalVariable(name: "c", scope: !17, file: !1, line: 11, type: !10, isLocal: true, isDefinition: true, variable: i32* @_ZZ3foovE1c)<br>
+!17 = distinct !DILexicalBlock(scope: !5, file: !1, line: 8)<br>
+!18 = !{i32 2, !"Dwarf Version", i32 4}<br>
+!19 = !{i32 2, !"Debug Info Version", i32 3}<br>
+!20 = !{!"clang version 3.7.0 (trunk 237245)"}<br>
+!21 = !DILocalVariable(name: "a", scope: !17, file: !1, line: 9, type: !4)<br>
+!22 = !DIExpression()<br>
+!23 = !DILocation(line: 9, scope: !17)<br>
+!24 = !DILocalVariable(name: "b", scope: !17, file: !1, line: 10, type: !13)<br>
+!25 = !DILocation(line: 10, scope: !17)<br>
+!26 = !DILocation(line: 12, scope: !17)<br>
<br>
Added: llvm/trunk/test/DebugInfo/X86/subprogram-inline.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/subprogram-inline.ll?rev=261633&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/subprogram-inline.ll?rev=261633&view=auto</a><br>
==============================================================================<br>
--- llvm/trunk/test/DebugInfo/X86/subprogram-inline.ll (added)<br>
+++ llvm/trunk/test/DebugInfo/X86/subprogram-inline.ll Tue Feb 23 07:36:51 2016<br>
@@ -0,0 +1,169 @@<br>
+; RUN: llc -mtriple=x86_64-unknown-linux-gnu -filetype=obj -O0 < %s  | llvm-dwarfdump -debug-dump=info - | FileCheck %s<br>
+; RUN: llc -mtriple=x86_64-unknown-linux-gnu -split-dwarf=Enable -filetype=obj -O0 < %s  | llvm-dwarfdump -debug-dump=info.dwo - | FileCheck %s<br>
+<br>
+;; This test checks the following:<br>
+;; 2. Function static variable, typedef, records (structure, class and union)<br>
+;;    that are defined in lexical function scope are emitted as children to<br>
+;;    the function scope, directly.<br>
+;; 3. "bar" function, which was inlined into "foo" function, is created as<br>
+;;    abstract (with DW_AT_inline attribute).<br>
+;;    All variables and types are defined in this abstract entry.<br>
+;; 4. "bar" function is created in "foo" function as inlined function<br>
+;;    (with DW_TAG_inlined_subroutine attribute), and all its local variables<br>
+;;    are created as concrete variables pointing to the abstract suitable entry<br>
+;;    defined under abstract "bar" function.<br>
+;;<br>
+;; This test was generated by running following command:<br>
+;; clang -cc1 -O0 -g -emit-llvm foo.cpp -o - | opt -S -inline -sroa<br>
+;; Where foo.cpp<br>
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
+;;__inline int bar(int s) {<br>
+;;<br>
+;;<br>
+;;      struct X {<br>
+;;          int x;<br>
+;;      };<br>
+;;      typedef int Y;<br>
+;;<br>
+;;        X a = { s };<br>
+;;        Y b(s);<br>
+;;        static int c = 0;<br>
+;;        return a.x + b + c++;<br>
+;;<br>
+;;<br>
+;;<br>
+;;}<br>
+;;<br>
+;;<br>
+;;int foo(int i) {<br>
+;;  return<br>
+;;    bar(i);<br>
+;;}<br>
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
+<br>
+; CHECK:    [[Offset_bar:0x[0-9abcdef]+]]: DW_TAG_subprogram<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:      DW_AT_name {{.*}} "bar"<br>
+; CHECK:      DW_AT_inline<br>
+; CHECK-NOT: NULL<br>
+<br>
+; CHECK:        [[Offset_a:0x[0-9abcdef]+]]: DW_TAG_variable<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:          DW_AT_name {{.*}} "a"<br>
+<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:        [[Offset_b:0x[0-9abcdef]+]]: DW_TAG_variable<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:          DW_AT_name {{.*}} "b"<br>
+<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:        [[Offset_c:0x[0-9abcdef]+]]: DW_TAG_variable<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:          DW_AT_name {{.*}} "c"<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:          DW_AT_location<br>
+<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:      [[Offset_X:0x[0-9abcdef]+]]: DW_TAG_structure_type<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:        DW_AT_name {{.*}} "X"<br>
+; CHECK:        NULL<br>
+<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:      [[Offset_Y:0x[0-9abcdef]+]]: DW_TAG_typedef<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:        DW_AT_name {{.*}} "Y"<br>
+<br>
+; CHECK-NOT: {{DW_TAG}}<br>
+; CHECK:      NULL<br>
+<br>
+<br>
+; CHECK:    DW_TAG_subprogram<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:      DW_AT_name {{.*}} "foo"<br>
+; CHECK-NOT: {{NULL}}<br>
+; CHECK:      DW_TAG_inlined_subroutine<br>
+; CHECK-NEXT:   DW_AT_abstract_origin {{.*}} {[[Offset_bar]]}<br>
+<br>
+; CHECK-NOT: {{NULL}}<br>
+; CHECK:          DW_TAG_variable<br>
+; CHECK-NEXT:       DW_AT_location<br>
+; CHECK-NEXT:       DW_AT_abstract_origin {{.*}} {[[Offset_a]]}<br>
+<br>
+; CHECK-NOT: {{DW_TAG|NULL}}<br>
+; CHECK:          DW_TAG_variable<br>
+; CHECK-NEXT:       DW_AT_location<br>
+; CHECK-NEXT:       DW_AT_abstract_origin {{.*}} {[[Offset_b]]}<br>
+<br>
+; CHECK-NOT: {{DW_TAG}}<br>
+; CHECK:      NULL<br>
+<br>
+%struct.X = type { i32 }<br>
+<br>
+$_ZZ3bariE1c = comdat any<br>
+<br>
+@_ZZ3bariE1c = linkonce_odr global i32 0, comdat, align 4<br>
+<br>
+; Function Attrs: nounwind<br>
+define i32 @_Z3fooi(i32 %i) #0 !dbg !13 {<br>
+entry:<br>
+  call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !18, metadata !19), !dbg !20<br>
+  call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !21, metadata !19), !dbg !22<br>
+  call void @llvm.dbg.declare(metadata %struct.X* undef, metadata !24, metadata !19), !dbg !25<br>
+  call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !24, metadata !19), !dbg !25<br>
+  call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !26, metadata !19), !dbg !27<br>
+  %add.i = add nsw i32 %i, %i, !dbg !28<br>
+  %0 = load i32, i32* @_ZZ3bariE1c, align 4, !dbg !28<br>
+  %inc.i = add nsw i32 %0, 1, !dbg !28<br>
+  store i32 %inc.i, i32* @_ZZ3bariE1c, align 4, !dbg !28<br>
+  %add2.i = add nsw i32 %add.i, %0, !dbg !28<br>
+  ret i32 %add2.i, !dbg !29<br>
+}<br>
+<br>
+; Function Attrs: nounwind readnone<br>
+declare void @llvm.dbg.declare(metadata, metadata, metadata) #1<br>
+<br>
+; Function Attrs: nounwind readnone<br>
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1<br>
+<br>
+attributes #0 = { nounwind "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-features"="+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }<br>
+attributes #1 = { nounwind readnone }<br>
+<br>
+!<a href="http://llvm.dbg.cu" rel="noreferrer" target="_blank">llvm.dbg.cu</a> = !{!0, !30}<br>
+!llvm.module.flags = !{!16}<br>
+!llvm.ident = !{!17}<br>
+<br>
+!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 256818)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !3, subprograms: !12, globals: !14)<br>
+!1 = !DIFile(filename: "foo.cpp", directory: "/")<br>
+!2 = !{}<br>
+!3 = !{!4, !11}<br>
+!4 = !DICompositeType(tag: DW_TAG_structure_type, name: "X", scope: !5, file: !1, line: 4, size: 32, align: 32, elements: !9, identifier: "_ZTSZ3bariE1X")<br>
+!5 = distinct !DISubprogram(name: "bar", linkageName: "_Z3bari", scope: !1, file: !1, line: 1, type: !6, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, variables: !2)<br>
+!6 = !DISubroutineType(types: !7)<br>
+!7 = !{!8, !8}<br>
+!8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)<br>
+!9 = !{!10}<br>
+!10 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !"_ZTSZ3bariE1X", file: !1, line: 5, baseType: !8, size: 32, align: 32)<br>
+!11 = !DIDerivedType(tag: DW_TAG_typedef, name: "Y", scope: !5, file: !1, line: 7, baseType: !8)<br>
+!12 = !{!13, !5}<br>
+!13 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooi", scope: !1, file: !1, line: 19, type: !6, isLocal: false, isDefinition: true, scopeLine: 19, flags: DIFlagPrototyped, isOptimized: false, variables: !2)<br>
+!14 = !{!15}<br>
+!15 = !DIGlobalVariable(name: "c", scope: !5, file: !1, line: 11, type: !8, isLocal: false, isDefinition: true, variable: i32* @_ZZ3bariE1c)<br>
+!16 = !{i32 2, !"Debug Info Version", i32 3}<br>
+!17 = !{!"clang version 3.8.0 (trunk 256818)"}<br>
+!18 = !DILocalVariable(name: "i", arg: 1, scope: !13, file: !1, line: 19, type: !8)<br>
+!19 = !DIExpression()<br>
+!20 = !DILocation(line: 19, scope: !13)<br>
+!21 = !DILocalVariable(name: "s", arg: 1, scope: !5, file: !1, line: 1, type: !8)<br>
+!22 = !DILocation(line: 1, scope: !5, inlinedAt: !23)<br>
+!23 = distinct !DILocation(line: 21, scope: !13)<br>
+!24 = !DILocalVariable(name: "a", scope: !5, file: !1, line: 9, type: !"_ZTSZ3bariE1X")<br>
+!25 = !DILocation(line: 9, scope: !5, inlinedAt: !23)<br>
+!26 = !DILocalVariable(name: "b", scope: !5, file: !1, line: 10, type: !11)<br>
+!27 = !DILocation(line: 10, scope: !5, inlinedAt: !23)<br>
+!28 = !DILocation(line: 12, scope: !5, inlinedAt: !23)<br>
+!29 = !DILocation(line: 20, scope: !13)<br>
+<br>
+; This line is manually added to check that the test does not crash when having<br>
+; more than one compile unit!<br>
+!30 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 242994) (llvm/trunk 242995)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !2)<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>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">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>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Alexey Samsonov<br><a href="mailto:vonosmas@gmail.com" target="_blank">vonosmas@gmail.com</a></div></div>
</div>