<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Apr 29, 2016, at 10:27 AM, Aboud, Amjad <<a href="mailto:amjad.aboud@intel.com" class="">amjad.aboud@intel.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">Sorry for that, I broke a LIT test that I added few days ago.<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">The LIT test need to be fixed and I already fixed it in r268063.</span></div></div></div></blockquote>No problem.  Thanks for the quick reply.<br class=""><blockquote type="cite" class=""><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""><o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">Let’s wait till r268063 run bots and see that everything will pass.</span></div></div></div></blockquote>Sounds good, thanks.  I’ll keep an eye on the bots.</div><div><br class=""></div><div>Thanks,</div><div>Pete<br class=""><blockquote type="cite" class=""><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""><o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><a name="_MailEndCompose" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></a></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">Thanks,<o:p class=""></o:p></span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125);" class="">Amjad<o:p class=""></o:p></span></div><div style="border-style: none none none solid; border-left-color: blue; border-left-width: 1.5pt; padding: 0in 0in 0in 4pt;" class=""><div class=""><div style="border-style: solid none none; border-top-color: rgb(225, 225, 225); border-top-width: 1pt; padding: 3pt 0in 0in;" class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><a name="_____replyseparator" class=""></a><b class=""><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class="">From:</span></b><span style="font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span class="Apple-converted-space"> </span><a href="mailto:peter_cooper@apple.com" class="">peter_cooper@apple.com</a> [<a href="mailto:peter_cooper@apple.com" class="">mailto:peter_cooper@apple.com</a>]<span class="Apple-converted-space"> </span><br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Friday, April 29, 2016 19:53<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>Aboud, Amjad <<a href="mailto:amjad.aboud@intel.com" class="">amjad.aboud@intel.com</a>><br class=""><b class="">Cc:</b><span class="Apple-converted-space"> </span><a href="mailto:cfe-commits@lists.llvm.org" class="">cfe-commits@lists.llvm.org</a><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>Re: r268055 - Recommitted r264281 "Supporting all entities declared in lexical scope in LLVM debug info."<o:p class=""></o:p></span></div></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">Hi Amjad<o:p class=""></o:p></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">Either this change, or r268054, appears to have broken the bots.  Can you please take a look?<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">The error at: <a href="http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_check/22409/consoleFull#8333002949ba4694-19c4-4d7e-bec5-911270d8a58c" style="color: purple; text-decoration: underline;" class="">http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_check/22409/consoleFull#8333002949ba4694-19c4-4d7e-bec5-911270d8a58c</a><o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">Thanks,<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">Pete<o:p class=""></o:p></div></div><div class=""><div class=""><blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">On Apr 29, 2016, at 9:08 AM, Amjad Aboud via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org" style="color: purple; text-decoration: underline;" class="">cfe-commits@lists.llvm.org</a>> wrote:<o:p class=""></o:p></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><o:p class=""> </o:p></div><div class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class="">Author: aaboud<br class="">Date: Fri Apr 29 11:08:08 2016<br class="">New Revision: 268055<br class=""><br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=268055&view=rev" style="color: purple; text-decoration: underline;" class="">http://llvm.org/viewvc/llvm-project?rev=268055&view=rev</a><br class="">Log:<br class="">Recommitted r264281 "Supporting all entities declared in lexical scope in LLVM debug info."<br class="">After fixing PR26942 in r267004.<br class=""><br class="">Added:<br class="">   cfe/trunk/test/CodeGenCXX/debug-info-lb.cpp<br class="">Modified:<br class="">   cfe/trunk/lib/CodeGen/CGDebugInfo.cpp<br class="">   cfe/trunk/lib/CodeGen/CGDebugInfo.h<br class="">   cfe/trunk/lib/CodeGen/CGDecl.cpp<br class="">   cfe/trunk/test/CodeGenCXX/debug-info-anon-union-vars.cpp<br class=""><br class="">Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp<br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=268055&r1=268054&r2=268055&view=diff" style="color: purple; text-decoration: underline;" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=268055&r1=268054&r2=268055&view=diff</a><br class="">==============================================================================<br class="">--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)<br class="">+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Fri Apr 29 11:08:08 2016<br class="">@@ -814,15 +814,18 @@ llvm::DIType *CGDebugInfo::CreateType(co<br class=""><br class="">llvm::DIType *CGDebugInfo::CreateType(const TypedefType *Ty,<br class="">                                      llvm::DIFile *Unit) {<br class="">+  TypedefNameDecl *TD = Ty->getDecl();<br class="">  // We don't set size information, but do specify where the typedef was<br class="">  // declared.<br class="">-  SourceLocation Loc = Ty->getDecl()->getLocation();<br class="">+  SourceLocation Loc = TD->getLocation();<br class="">+<br class="">+  llvm::DIScope *TDContext = getDeclarationLexicalScope(*TD, QualType(Ty, 0));<br class=""><br class="">  // Typedefs are derived from some other type.<br class="">  return DBuilder.createTypedef(<br class="">      getOrCreateType(Ty->getDecl()->getUnderlyingType(), Unit),<br class="">      Ty->getDecl()->getName(), getOrCreateFile(Loc), getLineNumber(Loc),<br class="">-      getDeclContextDescriptor(Ty->getDecl()));<br class="">+      TDContext);<br class="">}<br class=""><br class="">llvm::DIType *CGDebugInfo::CreateType(const FunctionType *Ty,<br class="">@@ -1457,6 +1460,23 @@ llvm::DIType *CGDebugInfo::getOrCreateSt<br class="">  return T;<br class="">}<br class=""><br class="">+void CGDebugInfo::recordDeclarationLexicalScope(const Decl &D) {<br class="">+  assert(LexicalBlockMap.find(&D) == LexicalBlockMap.end() &&<br class="">+         "D is already mapped to lexical block scope");<br class="">+  if (!LexicalBlockStack.empty())<br class="">+    LexicalBlockMap[&D] = LexicalBlockStack.back();<br class="">+}<br class="">+<br class="">+llvm::DIScope *CGDebugInfo::getDeclarationLexicalScope(const Decl &D,<br class="">+                                                       QualType Ty) {<br class="">+  auto I = LexicalBlockMap.find(&D);<br class="">+  if (I != LexicalBlockMap.end()) {<br class="">+    RetainedTypes.push_back(Ty.getAsOpaquePtr());<br class="">+    return I->second;<br class="">+  }<br class="">+  return getDeclContextDescriptor(cast<Decl>(&D));<br class="">+}<br class="">+<br class="">void CGDebugInfo::completeType(const EnumDecl *ED) {<br class="">  if (DebugKind <= codegenoptions::DebugLineTablesOnly)<br class="">    return;<br class="">@@ -2060,7 +2080,7 @@ llvm::DIType *CGDebugInfo::CreateEnumTyp<br class="">    // entered into the ReplaceMap: finalize() will replace the first<br class="">    // FwdDecl with the second and then replace the second with<br class="">    // complete type.<br class="">-    llvm::DIScope *EDContext = getDeclContextDescriptor(ED);<br class="">+    llvm::DIScope *EDContext = getDeclarationLexicalScope(*ED, QualType(Ty, 0));<br class="">    llvm::DIFile *DefUnit = getOrCreateFile(ED->getLocation());<br class="">    llvm::TempDIScope TmpContext(DBuilder.createReplaceableCompositeType(<br class="">        llvm::dwarf::DW_TAG_enumeration_type, "", TheCU, DefUnit, 0));<br class="">@@ -2104,7 +2124,7 @@ llvm::DIType *CGDebugInfo::CreateTypeDef<br class=""><br class="">  llvm::DIFile *DefUnit = getOrCreateFile(ED->getLocation());<br class="">  unsigned Line = getLineNumber(ED->getLocation());<br class="">-  llvm::DIScope *EnumContext = getDeclContextDescriptor(ED);<br class="">+  llvm::DIScope *EnumContext = getDeclarationLexicalScope(*ED, QualType(Ty, 0));<br class="">  llvm::DIType *ClassTy =<br class="">      ED->isFixed() ? getOrCreateType(ED->getIntegerType(), DefUnit) : nullptr;<br class="">  return DBuilder.createEnumerationType(EnumContext, ED->getName(), DefUnit,<br class="">@@ -2365,7 +2385,7 @@ llvm::DICompositeType *CGDebugInfo::Crea<br class="">  unsigned Line = getLineNumber(RD->getLocation());<br class="">  StringRef RDName = getClassName(RD);<br class=""><br class="">-  llvm::DIScope *RDContext = getDeclContextDescriptor(RD);<br class="">+  llvm::DIScope *RDContext = getDeclarationLexicalScope(*RD, QualType(Ty, 0));<br class=""><br class="">  // If we ended up creating the type during the context chain construction,<br class="">  // just return that.<br class="">@@ -2536,8 +2556,15 @@ void CGDebugInfo::collectVarDeclProps(co<br class="">  if (DC->isRecord())<br class="">    DC = CGM.getContext().getTranslationUnitDecl();<br class=""><br class="">- llvm::DIScope *Mod = getParentModuleOrNull(VD);<br class="">- VDContext = getContextDescriptor(cast<Decl>(DC), Mod ? Mod : TheCU);<br class="">+  if (VD->isStaticLocal()) {<br class="">+    // Get context for static locals (that are technically globals) the same way<br class="">+    // we do for "local" locals -- by using current lexical block.<br class="">+    assert(!LexicalBlockStack.empty() && "Region stack mismatch, stack empty!");<br class="">+    VDContext = LexicalBlockStack.back();<br class="">+  } else {<br class="">+    llvm::DIScope *Mod = getParentModuleOrNull(VD);<br class="">+    VDContext = getContextDescriptor(cast<Decl>(DC), Mod ? Mod : TheCU);<br class="">+  }<br class="">}<br class=""><br class="">llvm::DISubprogram *<br class=""><br class="">Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.h<br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.h?rev=268055&r1=268054&r2=268055&view=diff" style="color: purple; text-decoration: underline;" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.h?rev=268055&r1=268054&r2=268055&view=diff</a><br class="">==============================================================================<br class="">--- cfe/trunk/lib/CodeGen/CGDebugInfo.h (original)<br class="">+++ cfe/trunk/lib/CodeGen/CGDebugInfo.h Fri Apr 29 11:08:08 2016<br class="">@@ -107,6 +107,11 @@ class CGDebugInfo {<br class=""><br class="">  /// Keep track of our current nested lexical block.<br class="">  std::vector<llvm::TypedTrackingMDRef<llvm::DIScope>> LexicalBlockStack;<br class="">+<br class="">+  /// Map of AST declaration to its lexical block scope.<br class="">+  llvm::DenseMap<const Decl *, llvm::TypedTrackingMDRef<llvm::DIScope>><br class="">+      LexicalBlockMap;<br class="">+<br class="">  llvm::DenseMap<const Decl *, llvm::TrackingMDRef> RegionMap;<br class="">  /// Keep track of LexicalBlockStack counter at the beginning of a<br class="">  /// function. This is used to pop unbalanced regions at the end of a<br class="">@@ -369,6 +374,12 @@ public:<br class="">  /// Emit an Objective-C interface type standalone debug info.<br class="">  llvm::DIType *getOrCreateInterfaceType(QualType Ty, SourceLocation Loc);<br class=""><br class="">+  /// Map AST declaration to its lexical block scope if available.<br class="">+  void recordDeclarationLexicalScope(const Decl &D);<br class="">+<br class="">+  /// Get lexical scope of AST declaration.<br class="">+  llvm::DIScope *getDeclarationLexicalScope(const Decl &D, QualType Ty);<br class="">+<br class="">  /// Emit standalone debug info for a type.<br class="">  llvm::DIType *getOrCreateStandaloneType(QualType Ty, SourceLocation Loc);<br class=""><br class=""><br class="">Modified: cfe/trunk/lib/CodeGen/CGDecl.cpp<br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDecl.cpp?rev=268055&r1=268054&r2=268055&view=diff" style="color: purple; text-decoration: underline;" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDecl.cpp?rev=268055&r1=268054&r2=268055&view=diff</a><br class="">==============================================================================<br class="">--- cfe/trunk/lib/CodeGen/CGDecl.cpp (original)<br class="">+++ cfe/trunk/lib/CodeGen/CGDecl.cpp Fri Apr 29 11:08:08 2016<br class="">@@ -87,11 +87,7 @@ void CodeGenFunction::EmitDecl(const Dec<br class="">  case Decl::UsingShadow:<br class="">  case Decl::ObjCTypeParam:<br class="">    llvm_unreachable("Declaration should not be in declstmts!");<br class="">-  case Decl::Function:  // void X();<br class="">-  case Decl::Record:    // struct/union/class X;<br class="">-  case Decl::Enum:      // enum X;<br class="">-  case Decl::EnumConstant: // enum ? { X = ? }<br class="">-  case Decl::CXXRecord: // struct/union/class X; [C++]<br class="">+  case Decl::Function:     // void X();<br class="">  case Decl::StaticAssert: // static_assert(X, ""); [C++0x]<br class="">  case Decl::Label:        // __label__ x;<br class="">  case Decl::Import:<br class="">@@ -101,13 +97,21 @@ void CodeGenFunction::EmitDecl(const Dec<br class="">    // None of these decls require codegen support.<br class="">    return;<br class=""><br class="">+  case Decl::Record:       // struct/union/class X;<br class="">+  case Decl::Enum:         // enum X;<br class="">+  case Decl::EnumConstant: // enum ? { X = ? }<br class="">+  case Decl::CXXRecord:    // struct/union/class X; [C++]<br class="">+    if (CGDebugInfo *DI = getDebugInfo())<br class="">+      DI->recordDeclarationLexicalScope(D);<br class="">+    return;<br class="">+<br class="">  case Decl::NamespaceAlias:<br class="">    if (CGDebugInfo *DI = getDebugInfo())<br class="">-        DI->EmitNamespaceAlias(cast<NamespaceAliasDecl>(D));<br class="">+      DI->EmitNamespaceAlias(cast<NamespaceAliasDecl>(D));<br class="">    return;<br class="">  case Decl::Using:          // using X; [C++]<br class="">    if (CGDebugInfo *DI = getDebugInfo())<br class="">-        DI->EmitUsingDecl(cast<UsingDecl>(D));<br class="">+      DI->EmitUsingDecl(cast<UsingDecl>(D));<br class="">    return;<br class="">  case Decl::UsingDirective: // using namespace X; [C++]<br class="">    if (CGDebugInfo *DI = getDebugInfo())<br class="">@@ -128,6 +132,9 @@ void CodeGenFunction::EmitDecl(const Dec<br class="">    const TypedefNameDecl &TD = cast<TypedefNameDecl>(D);<br class="">    QualType Ty = TD.getUnderlyingType();<br class=""><br class="">+    if (CGDebugInfo *DI = getDebugInfo())<br class="">+      DI->recordDeclarationLexicalScope(D);<br class="">+<br class="">    if (Ty->isVariablyModifiedType())<br class="">      EmitVariablyModifiedType(Ty);<br class="">  }<br class=""><br class="">Modified: cfe/trunk/test/CodeGenCXX/debug-info-anon-union-vars.cpp<br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-anon-union-vars.cpp?rev=268055&r1=268054&r2=268055&view=diff" style="color: purple; text-decoration: underline;" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-anon-union-vars.cpp?rev=268055&r1=268054&r2=268055&view=diff</a><br class="">==============================================================================<br class="">--- cfe/trunk/test/CodeGenCXX/debug-info-anon-union-vars.cpp (original)<br class="">+++ cfe/trunk/test/CodeGenCXX/debug-info-anon-union-vars.cpp Fri Apr 29 11:08:08 2016<br class="">@@ -44,8 +44,13 @@ void instantiate(int x) {<br class="">  buildBytes(x);<br class="">}<br class=""><br class="">-// CHECK: !DIGlobalVariable(name: "c",{{.*}} file: [[FILE:.*]], line: 6,{{.*}} isLocal: true, isDefinition: true<br class="">-// CHECK: [[FILE]] = !DIFile(filename: "{{.*}}debug-info-anon-union-vars.cpp",<br class="">+// CHECK: ![[UNION:[0-9]+]] = distinct !DICompositeType(tag: DW_TAG_union_type,<br class="">+// CHECK-NOT: name:<br class="">+// CHECK: elements<br class="">+// CHECK: [[FILE:.*]] = !DIFile(filename: "{{.*}}debug-info-anon-union-vars.cpp",<br class="">+// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "i", scope: ![[UNION]],<br class="">+// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "c", scope: ![[UNION]],<br class="">+// CHECK: !DIGlobalVariable(name: "c",{{.*}} file: [[FILE]], line: 6,{{.*}} isLocal: true, isDefinition: true<br class="">// CHECK: !DIGlobalVariable(name: "d",{{.*}} file: [[FILE]], line: 6,{{.*}} isLocal: true, isDefinition: true<br class="">// CHECK: !DIGlobalVariable(name: "a",{{.*}} file: [[FILE]], line: 6,{{.*}} isLocal: true, isDefinition: true<br class="">// CHECK: !DIGlobalVariable(name: "b",{{.*}} file: [[FILE]], line: 6,{{.*}} isLocal: true, isDefinition: true<br class="">@@ -55,9 +60,4 @@ void instantiate(int x) {<br class="">// CHECK: !DILocalVariable(name: "c", {{.*}}, flags: DIFlagArtificial<br class="">// CHECK: !DILocalVariable(<br class="">// CHECK-NOT: name:<br class="">-// CHECK: type: ![[UNION:[0-9]+]]<br class="">-// CHECK: ![[UNION]] = distinct !DICompositeType(tag: DW_TAG_union_type,<br class="">-// CHECK-NOT: name:<br class="">-// CHECK: elements<br class="">-// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "i", scope: ![[UNION]],<br class="">-// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "c", scope: ![[UNION]],<br class="">+// CHECK: type: ![[UNION]]<br class=""><br class="">Added: cfe/trunk/test/CodeGenCXX/debug-info-lb.cpp<br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-lb.cpp?rev=268055&view=auto" style="color: purple; text-decoration: underline;" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-lb.cpp?rev=268055&view=auto</a><br class="">==============================================================================<br class="">--- cfe/trunk/test/CodeGenCXX/debug-info-lb.cpp (added)<br class="">+++ cfe/trunk/test/CodeGenCXX/debug-info-lb.cpp Fri Apr 29 11:08:08 2016<br class="">@@ -0,0 +1,27 @@<br class="">+// RUN: %clang_cc1 -triple x86_64-none-linux-gnu -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s<br class="">+<br class="">+void foo() {<br class="">+  static int bar = 1;<br class="">+  {<br class="">+    struct X {};<br class="">+    typedef char Y;<br class="">+    static int bar = 0;<br class="">+    // The following basic block is intended, in order to check the case where<br class="">+    // types "X", "Y" are defined in a different scope than where they are used.<br class="">+    // They should have the scope they are defined at as their parent scope.<br class="">+    {<br class="">+      X a;<br class="">+      Y b;<br class="">+    }<br class="">+  }<br class="">+}<br class="">+<br class="">+// CHECK: !{{[0-9]+}} = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "X", scope: [[LBScope:![0-9]+]],<br class="">+// CHECK: [[LBScope]] = distinct !DILexicalBlock(scope: !{{[0-9]+}}, file: !{{[0-9]+}}, line: 5)<br class="">+<br class="">+// CHECK: [[FuncScope:![0-9]+]] = distinct !DISubprogram(name: "foo",<br class="">+<br class="">+// CHECK: !{{[0-9]+}} = !DIDerivedType(tag: DW_TAG_typedef, name: "Y", scope: [[LBScope]],<br class="">+// CHECK: !{{[0-9]+}} = distinct !DIGlobalVariable(name: "bar", scope: [[FuncScope]], file: !{{[0-9]+}}, line: 4<br class="">+// CHECK: !{{[0-9]+}} = distinct !DIGlobalVariable(name: "bar", scope: [[LBScope]], file: !{{[0-9]+}}, line: 8<br class="">+<br class=""><br class=""><br class="">_______________________________________________<br class="">cfe-commits mailing list<br class=""><a href="mailto:cfe-commits@lists.llvm.org" style="color: purple; text-decoration: underline;" class="">cfe-commits@lists.llvm.org</a><br class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" style="color: purple; text-decoration: underline;" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><o:p class=""></o:p></div></div></div></blockquote></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><o:p class=""> </o:p></div></div></div></div><p style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">---------------------------------------------------------------------<br class="">Intel Israel (74) Limited</p><p style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">This e-mail and any attachments may contain confidential material for<br class="">the sole use of the intended recipient(s). Any review or distribution<br class="">by others is strictly prohibited. If you are not the intended<br class="">recipient, please contact the sender and delete all copies.</p></div></blockquote></div><br class=""></body></html>