<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Amjad<div class=""><br class=""></div><div class="">Either this change, or r268054, appears to have broken the bots. Can you please take a look?</div><div class=""><br class=""></div><div 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" class="">http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_check/22409/consoleFull#8333002949ba4694-19c4-4d7e-bec5-911270d8a58c</a></div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Pete</div><div class=""><div><blockquote type="cite" class=""><div class="">On Apr 29, 2016, at 9:08 AM, Amjad Aboud via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org" class="">cfe-commits@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Author: aaboud<br class="">Date: Fri Apr 29 11:08:08 2016<br class="">New Revision: 268055<br class=""><br class="">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=268055&view=rev" 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: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=268055&r1=268054&r2=268055&view=diff" 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: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.h?rev=268055&r1=268054&r2=268055&view=diff" 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: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDecl.cpp?rev=268055&r1=268054&r2=268055&view=diff" 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: <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" 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: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-lb.cpp?rev=268055&view=auto" 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" class="">cfe-commits@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits<br class=""></div></div></blockquote></div><br class=""></div></body></html>