Index: include/llvm/IR/DebugInfoMetadata.h =================================================================== --- include/llvm/IR/DebugInfoMetadata.h +++ include/llvm/IR/DebugInfoMetadata.h @@ -1396,19 +1396,20 @@ friend class MDNode; DILocation(LLVMContext &C, StorageType Storage, unsigned Line, - unsigned Column, ArrayRef MDs); + unsigned Column, ArrayRef MDs, bool ImplicitCode); ~DILocation() { dropAllReferences(); } static DILocation *getImpl(LLVMContext &Context, unsigned Line, unsigned Column, Metadata *Scope, - Metadata *InlinedAt, StorageType Storage, - bool ShouldCreate = true); + Metadata *InlinedAt, bool ImplicitCode, + StorageType Storage, bool ShouldCreate = true); static DILocation *getImpl(LLVMContext &Context, unsigned Line, unsigned Column, DILocalScope *Scope, - DILocation *InlinedAt, StorageType Storage, - bool ShouldCreate = true) { + DILocation *InlinedAt, bool ImplicitCode, + StorageType Storage, bool ShouldCreate = true) { return getImpl(Context, Line, Column, static_cast(Scope), - static_cast(InlinedAt), Storage, ShouldCreate); + static_cast(InlinedAt), ImplicitCode, Storage, + ShouldCreate); } /// With a given unsigned int \p U, use up to 13 bits to represent it. @@ -1437,7 +1438,7 @@ // Get the raw scope/inlinedAt since it is possible to invoke this on // a DILocation containing temporary metadata. return getTemporary(getContext(), getLine(), getColumn(), getRawScope(), - getRawInlinedAt()); + getRawInlinedAt(), isImplicitCode()); } public: @@ -1446,12 +1447,13 @@ DEFINE_MDNODE_GET(DILocation, (unsigned Line, unsigned Column, Metadata *Scope, - Metadata *InlinedAt = nullptr), - (Line, Column, Scope, InlinedAt)) + Metadata *InlinedAt = nullptr, bool ImplicitCode = false), + (Line, Column, Scope, InlinedAt, ImplicitCode)) DEFINE_MDNODE_GET(DILocation, (unsigned Line, unsigned Column, DILocalScope *Scope, - DILocation *InlinedAt = nullptr), - (Line, Column, Scope, InlinedAt)) + DILocation *InlinedAt = nullptr, + bool ImplicitCode = false), + (Line, Column, Scope, InlinedAt, ImplicitCode)) /// Return a (temporary) clone of this. TempDILocation clone() const { return cloneImpl(); } @@ -1464,6 +1466,10 @@ return cast_or_null(getRawInlinedAt()); } + /// Check if the location corresponds to an implicit code. + bool isImplicitCode() const { return ImplicitCode; } + void setImplicitCode(bool ImplicitCode) { this->ImplicitCode = ImplicitCode; } + DIFile *getFile() const { return getScope()->getFile(); } StringRef getFilename() const { return getScope()->getFilename(); } StringRef getDirectory() const { return getScope()->getDirectory(); } Index: include/llvm/IR/DebugLoc.h =================================================================== --- include/llvm/IR/DebugLoc.h +++ include/llvm/IR/DebugLoc.h @@ -78,7 +78,8 @@ /// /// FIXME: Remove this. Users should use DILocation::get(). static DebugLoc get(unsigned Line, unsigned Col, const MDNode *Scope, - const MDNode *InlinedAt = nullptr); + const MDNode *InlinedAt = nullptr, + bool ImplicitCode = false); enum { ReplaceLastInlinedAt = true }; /// Rebuild the entire inlined-at chain for this instruction so that the top of @@ -112,6 +113,10 @@ /// Return \c this as a bar \a MDNode. MDNode *getAsMDNode() const { return Loc; } + /// Check if the DebugLoc corresponds to an implicit code. + bool isImplicitCode() const; + void setImplicitCode(bool ImplicitCode); + bool operator==(const DebugLoc &DL) const { return Loc == DL.Loc; } bool operator!=(const DebugLoc &DL) const { return Loc != DL.Loc; } Index: include/llvm/IR/Metadata.h =================================================================== --- include/llvm/IR/Metadata.h +++ include/llvm/IR/Metadata.h @@ -66,9 +66,11 @@ enum StorageType { Uniqued, Distinct, Temporary }; /// Storage flag for non-uniqued, otherwise unowned, metadata. - unsigned char Storage; + unsigned char Storage : 7; // TODO: expose remaining bits to subclasses. + bool ImplicitCode : 1; + unsigned short SubclassData16 = 0; unsigned SubclassData32 = 0; @@ -80,7 +82,7 @@ protected: Metadata(unsigned ID, StorageType Storage) - : SubclassID(ID), Storage(Storage) { + : SubclassID(ID), Storage(Storage), ImplicitCode(false) { static_assert(sizeof(*this) == 8, "Metadata fields poorly packed"); } Index: lib/AsmParser/LLParser.cpp =================================================================== --- lib/AsmParser/LLParser.cpp +++ lib/AsmParser/LLParser.cpp @@ -4226,18 +4226,21 @@ (IsDistinct ? CLASS::getDistinct ARGS : CLASS::get ARGS) /// ParseDILocationFields: -/// ::= !DILocation(line: 43, column: 8, scope: !5, inlinedAt: !6) +/// ::= !DILocation(line: 43, column: 8, scope: !5, inlinedAt: !6, +/// isImplicitCode: true) bool LLParser::ParseDILocation(MDNode *&Result, bool IsDistinct) { #define VISIT_MD_FIELDS(OPTIONAL, REQUIRED) \ OPTIONAL(line, LineField, ); \ OPTIONAL(column, ColumnField, ); \ REQUIRED(scope, MDField, (/* AllowNull */ false)); \ - OPTIONAL(inlinedAt, MDField, ); + OPTIONAL(inlinedAt, MDField, ); \ + OPTIONAL(isImplicitCode, MDBoolField, (false)); PARSE_MD_FIELDS(); #undef VISIT_MD_FIELDS - Result = GET_OR_DISTINCT( - DILocation, (Context, line.Val, column.Val, scope.Val, inlinedAt.Val)); + Result = + GET_OR_DISTINCT(DILocation, (Context, line.Val, column.Val, scope.Val, + inlinedAt.Val, isImplicitCode.Val)); return false; } Index: lib/Bitcode/Reader/MetadataLoader.cpp =================================================================== --- lib/Bitcode/Reader/MetadataLoader.cpp +++ lib/Bitcode/Reader/MetadataLoader.cpp @@ -1139,7 +1139,7 @@ break; } case bitc::METADATA_LOCATION: { - if (Record.size() != 5) + if (Record.size() != 6) return error("Invalid record"); IsDistinct = Record[0]; @@ -1147,8 +1147,10 @@ unsigned Column = Record[2]; Metadata *Scope = getMD(Record[3]); Metadata *InlinedAt = getMDOrNull(Record[4]); + bool ImplicitCode = Record[5]; MetadataList.assignValue( - GET_OR_DISTINCT(DILocation, (Context, Line, Column, Scope, InlinedAt)), + GET_OR_DISTINCT(DILocation, (Context, Line, Column, Scope, InlinedAt, + ImplicitCode)), NextMetadataNo); NextMetadataNo++; break; Index: lib/Bitcode/Writer/BitcodeWriter.cpp =================================================================== --- lib/Bitcode/Writer/BitcodeWriter.cpp +++ lib/Bitcode/Writer/BitcodeWriter.cpp @@ -1403,6 +1403,7 @@ Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); + Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); return Stream.EmitAbbrev(std::move(Abbv)); } @@ -1417,6 +1418,7 @@ Record.push_back(N->getColumn()); Record.push_back(VE.getMetadataID(N->getScope())); Record.push_back(VE.getMetadataOrNullID(N->getInlinedAt())); + Record.push_back(N->isImplicitCode()); Stream.EmitRecord(bitc::METADATA_LOCATION, Record, Abbrev); Record.clear(); Index: lib/IR/AsmWriter.cpp =================================================================== --- lib/IR/AsmWriter.cpp +++ lib/IR/AsmWriter.cpp @@ -1753,6 +1753,7 @@ Printer.printInt("column", DL->getColumn()); Printer.printMetadata("scope", DL->getRawScope(), /* ShouldSkipNull */ false); Printer.printMetadata("inlinedAt", DL->getRawInlinedAt()); + Printer.printBool("isImplicitCode", DL->isImplicitCode()); Out << ")"; } Index: lib/IR/DebugInfoMetadata.cpp =================================================================== --- lib/IR/DebugInfoMetadata.cpp +++ lib/IR/DebugInfoMetadata.cpp @@ -23,7 +23,8 @@ using namespace llvm; DILocation::DILocation(LLVMContext &C, StorageType Storage, unsigned Line, - unsigned Column, ArrayRef MDs) + unsigned Column, ArrayRef MDs, + bool ImplicitCode) : MDNode(C, DILocationKind, Storage, MDs) { assert((MDs.size() == 1 || MDs.size() == 2) && "Expected a scope and optional inlined-at"); @@ -33,6 +34,8 @@ SubclassData32 = Line; SubclassData16 = Column; + + setImplicitCode(ImplicitCode); } static void adjustColumn(unsigned &Column) { @@ -43,15 +46,15 @@ DILocation *DILocation::getImpl(LLVMContext &Context, unsigned Line, unsigned Column, Metadata *Scope, - Metadata *InlinedAt, StorageType Storage, - bool ShouldCreate) { + Metadata *InlinedAt, bool ImplicitCode, + StorageType Storage, bool ShouldCreate) { // Fixup column. adjustColumn(Column); if (Storage == Uniqued) { - if (auto *N = - getUniqued(Context.pImpl->DILocations, - DILocationInfo::KeyTy(Line, Column, Scope, InlinedAt))) + if (auto *N = getUniqued(Context.pImpl->DILocations, + DILocationInfo::KeyTy(Line, Column, Scope, + InlinedAt, ImplicitCode))) return N; if (!ShouldCreate) return nullptr; @@ -63,8 +66,8 @@ Ops.push_back(Scope); if (InlinedAt) Ops.push_back(InlinedAt); - return storeImpl(new (Ops.size()) - DILocation(Context, Storage, Line, Column, Ops), + return storeImpl(new (Ops.size()) DILocation(Context, Storage, Line, Column, + Ops, ImplicitCode), Storage, Context.pImpl->DILocations); } Index: lib/IR/DebugLoc.cpp =================================================================== --- lib/IR/DebugLoc.cpp +++ lib/IR/DebugLoc.cpp @@ -56,15 +56,28 @@ return DebugLoc(); } +bool DebugLoc::isImplicitCode() const { + if (DILocation *Loc = get()) { + return Loc->isImplicitCode(); + } + return true; +} + +void DebugLoc::setImplicitCode(bool ImplicitCode) { + if (DILocation *Loc = get()) { + Loc->setImplicitCode(ImplicitCode); + } +} + DebugLoc DebugLoc::get(unsigned Line, unsigned Col, const MDNode *Scope, - const MDNode *InlinedAt) { + const MDNode *InlinedAt, bool ImplicitCode) { // If no scope is available, this is an unknown location. if (!Scope) return DebugLoc(); return DILocation::get(Scope->getContext(), Line, Col, const_cast(Scope), - const_cast(InlinedAt)); + const_cast(InlinedAt), ImplicitCode); } DebugLoc DebugLoc::appendInlinedAt(DebugLoc DL, DILocation *InlinedAt, Index: lib/IR/LLVMContextImpl.h =================================================================== --- lib/IR/LLVMContextImpl.h +++ lib/IR/LLVMContextImpl.h @@ -280,21 +280,24 @@ unsigned Column; Metadata *Scope; Metadata *InlinedAt; + bool ImplicitCode; MDNodeKeyImpl(unsigned Line, unsigned Column, Metadata *Scope, - Metadata *InlinedAt) - : Line(Line), Column(Column), Scope(Scope), InlinedAt(InlinedAt) {} + Metadata *InlinedAt, bool ImplicitCode) + : Line(Line), Column(Column), Scope(Scope), InlinedAt(InlinedAt), + ImplicitCode(ImplicitCode) {} MDNodeKeyImpl(const DILocation *L) : Line(L->getLine()), Column(L->getColumn()), Scope(L->getRawScope()), - InlinedAt(L->getRawInlinedAt()) {} + InlinedAt(L->getRawInlinedAt()), ImplicitCode(L->isImplicitCode()) {} bool isKeyOf(const DILocation *RHS) const { return Line == RHS->getLine() && Column == RHS->getColumn() && - Scope == RHS->getRawScope() && InlinedAt == RHS->getRawInlinedAt(); + Scope == RHS->getRawScope() && InlinedAt == RHS->getRawInlinedAt() && + ImplicitCode == RHS->isImplicitCode(); } unsigned getHashValue() const { - return hash_combine(Line, Column, Scope, InlinedAt); + return hash_combine(Line, Column, Scope, InlinedAt, ImplicitCode); } }; Index: lib/Transforms/Instrumentation/GCOVProfiling.cpp =================================================================== --- lib/Transforms/Instrumentation/GCOVProfiling.cpp +++ lib/Transforms/Instrumentation/GCOVProfiling.cpp @@ -605,7 +605,8 @@ continue; // Artificial lines such as calls to the global constructors. - if (Loc.getLine() == 0) continue; + if (Loc.getLine() == 0 || Loc.isImplicitCode()) + continue; if (Line == Loc.getLine()) continue; Line = Loc.getLine(); Index: test/Assembler/dilocation.ll =================================================================== --- test/Assembler/dilocation.ll +++ test/Assembler/dilocation.ll @@ -17,19 +17,19 @@ ; CHECK: !2 = !DIFile !2 = !DIFile(filename: "path/to/file", directory: "/path/to/dir") -; CHECK-NEXT: !3 = !DILocation(line: 3, column: 7, scope: !0) +; CHECK-NEXT: !3 = !DILocation(line: 3, column: 7, scope: !0, isImplicitCode: false) !3 = !DILocation(line: 3, column: 7, scope: !0) !4 = !DILocation(scope: !0, column: 7, line: 3) -; CHECK-NEXT: !4 = !DILocation(line: 3, column: 7, scope: !0, inlinedAt: !3) +; CHECK-NEXT: !4 = !DILocation(line: 3, column: 7, scope: !0, inlinedAt: !3, isImplicitCode: false) !5 = !DILocation(scope: !0, inlinedAt: !3, column: 7, line: 3) !6 = !DILocation(column: 7, line: 3, scope: !0, inlinedAt: !3) -; CHECK-NEXT: !5 = !DILocation(line: 0, scope: !0) +; CHECK-NEXT: !5 = !DILocation(line: 0, scope: !0, isImplicitCode: false) !7 = !DILocation(scope: !0) !8 = !DILocation(scope: !0, column: 0, line: 0) -; CHECK-NEXT: !6 = !DILocation(line: 4294967295, column: 65535, scope: !0) +; CHECK-NEXT: !6 = !DILocation(line: 4294967295, column: 65535, scope: !0, isImplicitCode: false) !9 = !DILocation(line: 4294967295, column: 65535, scope: !0) !10 = !{i32 2, !"Debug Info Version", i32 3} Index: test/Bindings/llvm-c/debug_info.ll =================================================================== --- test/Bindings/llvm-c/debug_info.ll +++ test/Bindings/llvm-c/debug_info.ll @@ -55,5 +55,5 @@ ; CHECK-NEXT: !29 = !DILocalVariable(name: "c", arg: 3, scope: !20, file: !1, line: 42, type: !23) ; CHECK-NEXT: !30 = !DILocalVariable(name: "d", scope: !31, file: !1, line: 43, type: !11) ; CHECK-NEXT: !31 = distinct !DILexicalBlock(scope: !20, file: !1, line: 42) -; CHECK-NEXT: !32 = !DILocation(line: 42, scope: !20) -; CHECK-NEXT: !33 = !DILocation(line: 43, scope: !20) +; CHECK-NEXT: !32 = !DILocation(line: 42, scope: !20, isImplicitCode: false) +; CHECK-NEXT: !33 = !DILocation(line: 43, scope: !20, isImplicitCode: false) Index: test/BugPoint/metadata.ll =================================================================== --- test/BugPoint/metadata.ll +++ test/BugPoint/metadata.ll @@ -17,7 +17,7 @@ ; NOTYPE-NOT: !DIBasicType ; NOTYPE: !DICompileUnit ; NOTYPE-NOT: !DIBasicType -; CHECK-DAG: ![[LOC]] = !DILocation(line: 104, column: 105, scope: ![[SCOPE:[0-9]+]]) +; CHECK-DAG: ![[LOC]] = !DILocation(line: 104, column: 105, scope: ![[SCOPE:[0-9]+]], isImplicitCode: false) ; CHECK-DAG: ![[SCOPE]] = distinct !DISubprogram(name: "test",{{.*}}file: ![[FILE:[0-9]+]] ; CHECK-DAG: ![[FILE]] = !DIFile(filename: "source.c", directory: "/dir") ; CHECK-DAG: ![[CALL]] = !{!"the call to foo"} Index: test/CodeGen/X86/tail-dup-debugloc.ll =================================================================== --- test/CodeGen/X86/tail-dup-debugloc.ll +++ test/CodeGen/X86/tail-dup-debugloc.ll @@ -3,7 +3,7 @@ ; Check that DebugLoc attached to the branch instruction of ; 'while.cond1.preheader.lr.ph' survives after tailduplication pass. ; -; CHECK: [[DLOC:![0-9]+]] = !DILocation(line: 9, column: 5, scope: !{{[0-9]+}}) +; CHECK: [[DLOC:![0-9]+]] = !DILocation(line: 9, column: 5, scope: !{{[0-9]+}}, isImplicitCode: false) ; CHECK: [[VREG:%[^ ]+]]:gr64 = COPY $rdi ; CHECK: TEST64rr [[VREG]], [[VREG]] ; CHECK-NEXT: JE_1 {{.+}}, debug-location [[DLOC]] @@ -52,5 +52,5 @@ !8 = !DILocation(line: 7, column: 15, scope: !9) !9 = !DILexicalBlockFile(scope: !6, file: !1, discriminator: 2) !10 = !DILocation(line: 7, column: 3, scope: !9) -!11 = !DILocation(line: 9, column: 5, scope: !9) +!11 = !DILocation(line: 9, column: 5, scope: !9, isImplicitCode: false) !12 = !DILocation(line: 14, column: 3, scope: !6) Index: test/CodeGen/X86/tail-merge-debugloc.ll =================================================================== --- test/CodeGen/X86/tail-merge-debugloc.ll +++ test/CodeGen/X86/tail-merge-debugloc.ll @@ -5,7 +5,7 @@ ; the branch instruction in the merged basic block still maintains the debug ; location info. ; -; CHECK: [[DLOC:![0-9]+]] = !DILocation(line: 2, column: 2, scope: !{{[0-9]+}}) +; CHECK: [[DLOC:![0-9]+]] = !DILocation(line: 2, column: 2, scope: !{{[0-9]+}}, isImplicitCode: false) ; CHECK: TEST64rr{{.*}}$rsi, renamable $rsi, implicit-def $eflags ; CHECK-NEXT: JNE_1{{.*}}, debug-location [[DLOC]] @@ -39,4 +39,4 @@ !3 = !{i32 2, !"Debug Info Version", i32 3} !4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 3, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, unit: !0) !5 = distinct !DILexicalBlock(scope: !4, file: !1, line: 1, column: 1) -!6 = !DILocation(line: 2, column: 2, scope: !5) +!6 = !DILocation(line: 2, column: 2, scope: !5, isImplicitCode: false) Index: test/CodeGen/X86/xor-combine-debugloc.ll =================================================================== --- test/CodeGen/X86/xor-combine-debugloc.ll +++ test/CodeGen/X86/xor-combine-debugloc.ll @@ -5,8 +5,8 @@ ; instruction, and the branch instructions have a same debug location with the ; br instruction. ; -; CHECK: [[DLOC1:![0-9]+]] = !DILocation(line: 5, column: 9, scope: !{{[0-9]+}}) -; CHECK: [[DLOC2:![0-9]+]] = !DILocation(line: 5, column: 7, scope: !{{[0-9]+}}) +; CHECK: [[DLOC1:![0-9]+]] = !DILocation(line: 5, column: 9, scope: !{{[0-9]+}}, isImplicitCode: false) +; CHECK: [[DLOC2:![0-9]+]] = !DILocation(line: 5, column: 7, scope: !{{[0-9]+}}, isImplicitCode: false) ; CHECK-DAG: [[VREG1:%[^ ]+]]:gr32 = COPY $esi ; CHECK-DAG: [[VREG2:%[^ ]+]]:gr32 = COPY $edi ; CHECK: SUB32rr [[VREG2]], [[VREG1]], implicit-def $eflags, debug-location [[DLOC1]] @@ -59,9 +59,9 @@ !11 = !DIExpression() !12 = !DILocation(line: 4, column: 13, scope: !4) !13 = !DILocation(line: 4, column: 20, scope: !4) -!14 = !DILocation(line: 5, column: 9, scope: !15) +!14 = !DILocation(line: 5, column: 9, scope: !15, isImplicitCode: false) !15 = distinct !DILexicalBlock(scope: !4, file: !1, line: 5, column: 7) -!16 = !DILocation(line: 5, column: 7, scope: !4) +!16 = !DILocation(line: 5, column: 7, scope: !4, isImplicitCode: false) !17 = !DILocation(line: 6, column: 12, scope: !15) !18 = !DILocation(line: 6, column: 5, scope: !15) !19 = !DILocation(line: 8, column: 12, scope: !15) Index: test/DebugInfo/Generic/indvar-discriminator.ll =================================================================== --- test/DebugInfo/Generic/indvar-discriminator.ll +++ test/DebugInfo/Generic/indvar-discriminator.ll @@ -31,7 +31,7 @@ ; CHECK: icmp ne i64 %{{.+}}, %{{.+}}, !dbg ![[ICMPMD:[0-9]+]] ; CHECK-DAG: ![[ICMPMD]] = !DILocation(line: 4, column: 21, scope: ![[ICMPSCOPEMD:[0-9]+]] ; CHECK-DAG: ![[ICMPSCOPEMD]] = !DILexicalBlockFile(scope: !{{[0-9]+}}, file: !{{[0-9]+}}, discriminator: 1) -; CHECK-DAG: ![[INDVARMD]] = !DILocation(line: 4, column: 26, scope: ![[INDVARSCOPEMD:[0-9]+]]) +; CHECK-DAG: ![[INDVARMD]] = !DILocation(line: 4, column: 26, scope: ![[INDVARSCOPEMD:[0-9]+]], isImplicitCode: false) ; CHECK-DAG: ![[INDVARSCOPEMD]] = !DILexicalBlockFile(scope: !{{[0-9]+}}, file: !{{[0-9]+}}, discriminator: 2) target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" @@ -83,7 +83,7 @@ !10 = !DILocation(line: 5, column: 12, scope: !5) !11 = !DILocation(line: 5, column: 5, scope: !5) !12 = !DILocation(line: 5, column: 10, scope: !5) -!13 = !DILocation(line: 4, column: 26, scope: !14) +!13 = !DILocation(line: 4, column: 26, scope: !14, isImplicitCode: false) !14 = !DILexicalBlockFile(scope: !5, file: !1, discriminator: 2) !15 = distinct !{!15, !16} !16 = !DILocation(line: 4, column: 3, scope: !5) Index: test/DebugInfo/Generic/inline-debug-info-multiret.ll =================================================================== --- test/DebugInfo/Generic/inline-debug-info-multiret.ll +++ test/DebugInfo/Generic/inline-debug-info-multiret.ll @@ -11,7 +11,7 @@ ; The branch instruction has the source location of line 9 and its inlined location ; has the source location of line 14. ; CHECK: ![[INL:[0-9]+]] = distinct !DILocation(line: 14, scope: {{.*}}) -; CHECK: ![[MD]] = !DILocation(line: 9, scope: {{.*}}, inlinedAt: ![[INL]]) +; CHECK: ![[MD]] = !DILocation(line: 9, scope: {{.*}}, inlinedAt: ![[INL]], isImplicitCode: false) ; ModuleID = 'test.cpp' target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" @@ -141,7 +141,7 @@ !17 = !DILocation(line: 6, scope: !4) !18 = !DILocation(line: 7, scope: !4) !19 = !DILocation(line: 8, scope: !4) -!20 = !DILocation(line: 9, scope: !4) +!20 = !DILocation(line: 9, scope: !4, isImplicitCode: false) !21 = !DILocation(line: 14, scope: !22) !22 = distinct !DILexicalBlock(line: 13, column: 0, file: !5, scope: !10) !23 = !DILocation(line: 15, scope: !22) Index: test/DebugInfo/Generic/inline-debug-info.ll =================================================================== --- test/DebugInfo/Generic/inline-debug-info.ll +++ test/DebugInfo/Generic/inline-debug-info.ll @@ -32,7 +32,7 @@ ; The branch instruction has the source location of line 9 and its inlined location ; has the source location of line 14. ; CHECK: [[INL:![0-9]*]] = distinct !DILocation(line: 14, scope: {{.*}}) -; CHECK: [[MD]] = !DILocation(line: 9, scope: {{.*}}, inlinedAt: [[INL]]) +; CHECK: [[MD]] = !DILocation(line: 9, scope: {{.*}}, inlinedAt: [[INL]], isImplicitCode: false) ; ModuleID = 'test.cpp' target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" @@ -159,7 +159,7 @@ !17 = !DILocation(line: 6, scope: !4) !18 = !DILocation(line: 7, scope: !4) !19 = !DILocation(line: 8, scope: !4) -!20 = !DILocation(line: 9, scope: !4) +!20 = !DILocation(line: 9, scope: !4, isImplicitCode: false) !21 = !DILocation(line: 14, scope: !22) !22 = distinct !DILexicalBlock(line: 13, column: 0, file: !5, scope: !10) !23 = !DILocation(line: 15, scope: !22) Index: test/DebugInfo/Generic/inline-no-debug-info.ll =================================================================== --- test/DebugInfo/Generic/inline-no-debug-info.ll +++ test/DebugInfo/Generic/inline-no-debug-info.ll @@ -21,11 +21,11 @@ ; Debug location of the code in caller() and of the inlined code that did not ; have any debug location before. -; CHECK-DAG: [[A]] = !DILocation(line: 4, scope: !{{[0-9]+}}) +; CHECK-DAG: [[A]] = !DILocation(line: 4, scope: !{{[0-9]+}}, isImplicitCode: false) ; Debug location of the inlined code. -; CHECK-DAG: [[B]] = !DILocation(line: 2, scope: !{{[0-9]+}}, inlinedAt: [[A_INL:![0-9]*]]) -; CHECK-DAG: [[A_INL]] = distinct !DILocation(line: 4, scope: !{{[0-9]+}}) +; CHECK-DAG: [[B]] = !DILocation(line: 2, scope: !{{[0-9]+}}, inlinedAt: [[A_INL:![0-9]*]], isImplicitCode: false) +; CHECK-DAG: [[A_INL]] = distinct !DILocation(line: 4, scope: !{{[0-9]+}}, isImplicitCode: false) target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" @@ -65,5 +65,5 @@ !8 = !{i32 2, !"Dwarf Version", i32 4} !9 = !{i32 2, !"Debug Info Version", i32 3} !10 = !{!"clang version 3.5.0 (210174)"} -!11 = !DILocation(line: 2, scope: !7) -!12 = !DILocation(line: 4, scope: !4) +!11 = !DILocation(line: 2, scope: !7, isImplicitCode: false) +!12 = !DILocation(line: 4, scope: !4, isImplicitCode: false) Index: test/DebugInfo/MIR/X86/livedebugvalues-limit.mir =================================================================== --- test/DebugInfo/MIR/X86/livedebugvalues-limit.mir +++ test/DebugInfo/MIR/X86/livedebugvalues-limit.mir @@ -16,13 +16,13 @@ ; CHECK: ![[F_SP:[0-9]+]] = distinct !DISubprogram(name: "f", {{.*}}) ; CHECK: ![[A_VAR:[0-9]+]] = !DILocalVariable(name: "a",{{.*}}) ; CHECK: ![[I_VAR:[0-9]+]] = !DILocalVariable(name: "i",{{.*}}) - ; CHECK: ![[I_LOC:[0-9]+]] = !DILocation(line: 4, column: 14, scope: !{{[0-9]+}}) - ; CHECK: ![[INLCS1:[0-9]+]] = !DILocation(line: 3, column: 41, scope: ![[F_SP]], inlinedAt: ![[CS1:[0-9]+]]) - ; CHECK: ![[CS1]] = distinct !DILocation(line: 5, column: 3, scope: !{{[0-9]+}}) - ; CHECK: ![[INLCS2:[0-9]+]] = !DILocation(line: 3, column: 41, scope: ![[F_SP]], inlinedAt: ![[CS2:[0-9]+]]) - ; CHECK: ![[CS2]] = distinct !DILocation(line: 7, column: 5, scope: !{{[0-9]+}}) - ; CHECK: ![[INLCS3:[0-9]+]] = !DILocation(line: 3, column: 41, scope: ![[F_SP]], inlinedAt: ![[CS3:[0-9]+]]) - ; CHECK: ![[CS3]] = distinct !DILocation(line: 8, column: 3, scope: !{{[0-9]+}}) + ; CHECK: ![[I_LOC:[0-9]+]] = !DILocation(line: 4, column: 14, scope: !{{[0-9]+}}, isImplicitCode: false) + ; CHECK: ![[INLCS1:[0-9]+]] = !DILocation(line: 3, column: 41, scope: ![[F_SP]], inlinedAt: ![[CS1:[0-9]+]], isImplicitCode: false) + ; CHECK: ![[CS1]] = distinct !DILocation(line: 5, column: 3, scope: !{{[0-9]+}}, isImplicitCode: false) + ; CHECK: ![[INLCS2:[0-9]+]] = !DILocation(line: 3, column: 41, scope: ![[F_SP]], inlinedAt: ![[CS2:[0-9]+]], isImplicitCode: false) + ; CHECK: ![[CS2]] = distinct !DILocation(line: 7, column: 5, scope: !{{[0-9]+}}, isImplicitCode: false) + ; CHECK: ![[INLCS3:[0-9]+]] = !DILocation(line: 3, column: 41, scope: ![[F_SP]], inlinedAt: ![[CS3:[0-9]+]], isImplicitCode: false) + ; CHECK: ![[CS3]] = distinct !DILocation(line: 8, column: 3, scope: !{{[0-9]+}}, isImplicitCode: false) ; ; CHECK: bb.1.if.then: ; CHECK: DBG_VALUE debug-use $ebx, debug-use $noreg, ![[I_VAR]], !DIExpression(), debug-location ![[I_LOC]] @@ -103,21 +103,21 @@ !17 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 4, type: !8, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !18) !18 = !{!19} !19 = !DILocalVariable(name: "i", arg: 1, scope: !17, file: !1, line: 4, type: !10) - !20 = !DILocation(line: 4, column: 14, scope: !17) - !21 = !DILocation(line: 3, column: 41, scope: !7, inlinedAt: !22) - !22 = distinct !DILocation(line: 5, column: 3, scope: !17) - !23 = !DILocation(line: 3, column: 46, scope: !7, inlinedAt: !22) - !24 = !DILocation(line: 6, column: 7, scope: !25) + !20 = !DILocation(line: 4, column: 14, scope: !17, isImplicitCode: false) + !21 = !DILocation(line: 3, column: 41, scope: !7, inlinedAt: !22, isImplicitCode: false) + !22 = distinct !DILocation(line: 5, column: 3, scope: !17, isImplicitCode: false) + !23 = !DILocation(line: 3, column: 46, scope: !7, inlinedAt: !22, isImplicitCode: false) + !24 = !DILocation(line: 6, column: 7, scope: !25, isImplicitCode: false) !25 = distinct !DILexicalBlock(scope: !17, file: !1, line: 6, column: 7) - !26 = !DILocation(line: 6, column: 7, scope: !17) - !27 = !DILocation(line: 3, column: 41, scope: !7, inlinedAt: !28) - !28 = distinct !DILocation(line: 7, column: 5, scope: !25) - !29 = !DILocation(line: 3, column: 46, scope: !7, inlinedAt: !28) - !30 = !DILocation(line: 7, column: 5, scope: !25) - !31 = !DILocation(line: 3, column: 41, scope: !7, inlinedAt: !32) - !32 = distinct !DILocation(line: 8, column: 3, scope: !17) - !33 = !DILocation(line: 3, column: 46, scope: !7, inlinedAt: !32) - !34 = !DILocation(line: 9, column: 1, scope: !17) + !26 = !DILocation(line: 6, column: 7, scope: !17, isImplicitCode: false) + !27 = !DILocation(line: 3, column: 41, scope: !7, inlinedAt: !28, isImplicitCode: false) + !28 = distinct !DILocation(line: 7, column: 5, scope: !25, isImplicitCode: false) + !29 = !DILocation(line: 3, column: 46, scope: !7, inlinedAt: !28, isImplicitCode: false) + !30 = !DILocation(line: 7, column: 5, scope: !25, isImplicitCode: false) + !31 = !DILocation(line: 3, column: 41, scope: !7, inlinedAt: !32, isImplicitCode: false) + !32 = distinct !DILocation(line: 8, column: 3, scope: !17, isImplicitCode: false) + !33 = !DILocation(line: 3, column: 46, scope: !7, inlinedAt: !32, isImplicitCode: false) + !34 = !DILocation(line: 9, column: 1, scope: !17, isImplicitCode: false) ... --- Index: test/Linker/mdlocation.ll =================================================================== --- test/Linker/mdlocation.ll +++ test/Linker/mdlocation.ll @@ -9,25 +9,25 @@ ; CHECK: !named = !{!0, !7, !8, !9, !10, !11, !15, !16, !17, !18} !named = !{!1, !2, !3, !4, !5} -; CHECK: !0 = !DILocation(line: 3, column: 7, scope: !1) +; CHECK: !0 = !DILocation(line: 3, column: 7, scope: !1, isImplicitCode: false) ; CHECK: !3 = distinct !DISubprogram( -; CHECK: !7 = !DILocation(line: 3, column: 7, scope: !1, inlinedAt: !0) -; CHECK: !8 = !DILocation(line: 3, column: 7, scope: !1, inlinedAt: !7) -; CHECK: !9 = distinct !DILocation(line: 3, column: 7, scope: !1) -; CHECK: !10 = distinct !DILocation(line: 3, column: 7, scope: !1, inlinedAt: !9) -; CHECK: !11 = !DILocation(line: 3, column: 7, scope: !12) +; CHECK: !7 = !DILocation(line: 3, column: 7, scope: !1, inlinedAt: !0, isImplicitCode: false) +; CHECK: !8 = !DILocation(line: 3, column: 7, scope: !1, inlinedAt: !7, isImplicitCode: false) +; CHECK: !9 = distinct !DILocation(line: 3, column: 7, scope: !1, isImplicitCode: false) +; CHECK: !10 = distinct !DILocation(line: 3, column: 7, scope: !1, inlinedAt: !9, isImplicitCode: false) +; CHECK: !11 = !DILocation(line: 3, column: 7, scope: !12, isImplicitCode: false) ; CHECK: !13 = distinct !DISubprogram( -; CHECK: !15 = !DILocation(line: 3, column: 7, scope: !12, inlinedAt: !11) -; CHECK: !16 = !DILocation(line: 3, column: 7, scope: !12, inlinedAt: !15) -; CHECK: !17 = distinct !DILocation(line: 3, column: 7, scope: !12) -; CHECK: !18 = distinct !DILocation(line: 3, column: 7, scope: !12, inlinedAt: !17) +; CHECK: !15 = !DILocation(line: 3, column: 7, scope: !12, inlinedAt: !11, isImplicitCode: false) +; CHECK: !16 = !DILocation(line: 3, column: 7, scope: !12, inlinedAt: !15, isImplicitCode: false) +; CHECK: !17 = distinct !DILocation(line: 3, column: 7, scope: !12, isImplicitCode: false) +; CHECK: !18 = distinct !DILocation(line: 3, column: 7, scope: !12, inlinedAt: !17, isImplicitCode: false) !0 = distinct !DISubprogram(file: !7, scope: !7, line: 1, name: "foo", type: !9, unit: !6) -!1 = !DILocation(line: 3, column: 7, scope: !10) -!2 = !DILocation(line: 3, column: 7, scope: !10, inlinedAt: !1) -!3 = !DILocation(line: 3, column: 7, scope: !10, inlinedAt: !2) +!1 = !DILocation(line: 3, column: 7, scope: !10, isImplicitCode: false) +!2 = !DILocation(line: 3, column: 7, scope: !10, inlinedAt: !1, isImplicitCode: false) +!3 = !DILocation(line: 3, column: 7, scope: !10, inlinedAt: !2, isImplicitCode: false) ; Test distinct nodes. -!4 = distinct !DILocation(line: 3, column: 7, scope: !10) -!5 = distinct !DILocation(line: 3, column: 7, scope: !10, inlinedAt: !4) +!4 = distinct !DILocation(line: 3, column: 7, scope: !10, isImplicitCode: false) +!5 = distinct !DILocation(line: 3, column: 7, scope: !10, inlinedAt: !4, isImplicitCode: false) !llvm.dbg.cu = !{!6} !6 = distinct !DICompileUnit(language: DW_LANG_C89, file: !7) Index: test/Linker/replaced-function-matches-first-subprogram.ll =================================================================== --- test/Linker/replaced-function-matches-first-subprogram.ll +++ test/Linker/replaced-function-matches-first-subprogram.ll @@ -68,5 +68,5 @@ !14 = !DILocation(line: 2, column: 20, scope: !4) ; The same subprogram should be pointed to by inside the !dbg reference. -; CHECK: ![[LOC]] = !DILocation(line: 2, column: 15, scope: ![[SP2]]) -!15 = !DILocation(line: 2, column: 15, scope: !7) +; CHECK: ![[LOC]] = !DILocation(line: 2, column: 15, scope: ![[SP2]], isImplicitCode: false) +!15 = !DILocation(line: 2, column: 15, scope: !7, isImplicitCode: false) Index: test/Linker/subprogram-linkonce-weak.ll =================================================================== --- test/Linker/subprogram-linkonce-weak.ll +++ test/Linker/subprogram-linkonce-weak.ll @@ -56,25 +56,25 @@ ; LW: ![[LCU]] = distinct !DICompileUnit( ; LW: ![[WCU]] = distinct !DICompileUnit( ; LW: ![[BARSP]] = distinct !DISubprogram(name: "bar",{{.*}} unit: ![[LCU]] -; LW: ![[FOOINBAR]] = !DILocation(line: 2, scope: ![[FOOSP:.*]], inlinedAt: ![[BARIA:[0-9]+]]) +; LW: ![[FOOINBAR]] = !DILocation(line: 2, scope: ![[FOOSP:.*]], inlinedAt: ![[BARIA:[0-9]+]], isImplicitCode: false) ; LW: ![[FOOSP]] = distinct !DISubprogram(name: "foo",{{.*}} unit: ![[LCU]] -; LW: ![[BARIA]] = !DILocation(line: 12, scope: ![[BARSP]]) -; LW: ![[BARRET]] = !DILocation(line: 13, scope: ![[BARSP]]) +; LW: ![[BARIA]] = !DILocation(line: 12, scope: ![[BARSP]], isImplicitCode: false) +; LW: ![[BARRET]] = !DILocation(line: 13, scope: ![[BARSP]], isImplicitCode: false) ; LW: ![[WEAKFOOSP]] = distinct !DISubprogram(name: "foo",{{.*}} unit: ![[WCU]] -; LW: ![[FOOCALL]] = !DILocation(line: 52, scope: ![[WEAKFOOSP]]) -; LW: ![[FOORET]] = !DILocation(line: 53, scope: ![[WEAKFOOSP]]) +; LW: ![[FOOCALL]] = !DILocation(line: 52, scope: ![[WEAKFOOSP]], isImplicitCode: false) +; LW: ![[FOORET]] = !DILocation(line: 53, scope: ![[WEAKFOOSP]], isImplicitCode: false) ; Same as above, but reordered. ; WL: ![[WCU]] = distinct !DICompileUnit( ; WL: ![[LCU]] = distinct !DICompileUnit( ; WL: ![[WEAKFOOSP]] = distinct !DISubprogram(name: "foo",{{.*}} unit: ![[WCU]] -; WL: ![[FOOCALL]] = !DILocation(line: 52, scope: ![[WEAKFOOSP]]) -; WL: ![[FOORET]] = !DILocation(line: 53, scope: ![[WEAKFOOSP]]) +; WL: ![[FOOCALL]] = !DILocation(line: 52, scope: ![[WEAKFOOSP]], isImplicitCode: false) +; WL: ![[FOORET]] = !DILocation(line: 53, scope: ![[WEAKFOOSP]], isImplicitCode: false) ; WL: ![[BARSP]] = distinct !DISubprogram(name: "bar",{{.*}} unit: ![[LCU]] -; WL: ![[FOOINBAR]] = !DILocation(line: 2, scope: ![[FOOSP:.*]], inlinedAt: ![[BARIA:[0-9]+]]) +; WL: ![[FOOINBAR]] = !DILocation(line: 2, scope: ![[FOOSP:.*]], inlinedAt: ![[BARIA:[0-9]+]], isImplicitCode: false) ; WL: ![[FOOSP]] = distinct !DISubprogram(name: "foo",{{.*}} unit: ![[LCU]] -; WL: ![[BARIA]] = !DILocation(line: 12, scope: ![[BARSP]]) -; WL: ![[BARRET]] = !DILocation(line: 13, scope: ![[BARSP]]) +; WL: ![[BARIA]] = !DILocation(line: 12, scope: ![[BARSP]], isImplicitCode: false) +; WL: ![[BARRET]] = !DILocation(line: 13, scope: ![[BARSP]], isImplicitCode: false) !1 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, emissionKind: FullDebug) !2 = !DIFile(filename: "bar.c", directory: "/path/to/dir") Index: test/Transforms/AddDiscriminators/basic.ll =================================================================== --- test/Transforms/AddDiscriminators/basic.ll +++ test/Transforms/AddDiscriminators/basic.ll @@ -57,6 +57,6 @@ ; CHECK: ![[FOO:[0-9]+]] = distinct !DISubprogram(name: "foo" ; CHECK: ![[BLOCK:[0-9]+]] = distinct !DILexicalBlock(scope: ![[FOO]],{{.*}} line: 3) -; CHECK: ![[THEN]] = !DILocation(line: 3, scope: ![[BLOCKFILE:[0-9]+]]) +; CHECK: ![[THEN]] = !DILocation(line: 3, scope: ![[BLOCKFILE:[0-9]+]], isImplicitCode: false) ; CHECK: ![[BLOCKFILE]] = !DILexicalBlockFile(scope: ![[BLOCK]],{{.*}} discriminator: 2) -; CHECK: ![[END]] = !DILocation(line: 4, scope: ![[FOO]]) +; CHECK: ![[END]] = !DILocation(line: 4, scope: ![[FOO]], isImplicitCode: false) Index: test/Transforms/AddDiscriminators/call-nested.ll =================================================================== --- test/Transforms/AddDiscriminators/call-nested.ll +++ test/Transforms/AddDiscriminators/call-nested.ll @@ -46,5 +46,5 @@ !13 = !DILocation(line: 4, column: 10, scope: !4) !14 = !DILocation(line: 4, column: 3, scope: !4) -; CHECK: ![[CALL2]] = !DILocation(line: 4, column: 10, scope: ![[CALL2BLOCK:[0-9]+]]) +; CHECK: ![[CALL2]] = !DILocation(line: 4, column: 10, scope: ![[CALL2BLOCK:[0-9]+]], isImplicitCode: false) ; CHECK: ![[CALL2BLOCK]] = !DILexicalBlockFile({{.*}} discriminator: 2) Index: test/Transforms/AddDiscriminators/call.ll =================================================================== --- test/Transforms/AddDiscriminators/call.ll +++ test/Transforms/AddDiscriminators/call.ll @@ -48,7 +48,7 @@ !12 = !DILocation(line: 4, column: 15, scope: !4) !13 = !DILocation(line: 5, column: 1, scope: !4) -; CHECK: ![[CALL1]] = !DILocation(line: 4, column: 9, scope: ![[CALL1BLOCK:[0-9]+]]) +; CHECK: ![[CALL1]] = !DILocation(line: 4, column: 9, scope: ![[CALL1BLOCK:[0-9]+]], isImplicitCode: false) ; CHECK: ![[CALL1BLOCK]] = !DILexicalBlockFile({{.*}} discriminator: 2) -; CHECK: ![[CALL2]] = !DILocation(line: 4, column: 15, scope: ![[CALL2BLOCK:[0-9]+]]) +; CHECK: ![[CALL2]] = !DILocation(line: 4, column: 15, scope: ![[CALL2BLOCK:[0-9]+]], isImplicitCode: false) ; CHECK: ![[CALL2BLOCK]] = !DILexicalBlockFile({{.*}} discriminator: 4) Index: test/Transforms/AddDiscriminators/diamond.ll =================================================================== --- test/Transforms/AddDiscriminators/diamond.ll +++ test/Transforms/AddDiscriminators/diamond.ll @@ -68,5 +68,5 @@ !19 = !DILocation(line: 5, column: 18, scope: !15) !20 = !DILocation(line: 6, column: 1, scope: !4) -; CHECK: ![[ELSE]] = !DILocation(line: 5, column: 18, scope: ![[ELSEBLOCK:[0-9]+]]) +; CHECK: ![[ELSE]] = !DILocation(line: 5, column: 18, scope: ![[ELSEBLOCK:[0-9]+]], isImplicitCode: false) ; CHECK: ![[ELSEBLOCK]] = !DILexicalBlockFile({{.*}} discriminator: 2) Index: test/Transforms/AddDiscriminators/first-only.ll =================================================================== --- test/Transforms/AddDiscriminators/first-only.ll +++ test/Transforms/AddDiscriminators/first-only.ll @@ -75,9 +75,9 @@ ; CHECK: ![[BLOCK2]] = distinct !DILexicalBlock(scope: ![[BLOCK1]],{{.*}} line: 3) !15 = !DILocation(line: 5, scope: !13) -; CHECK: ![[THEN]] = !DILocation(line: 4, scope: ![[BLOCK2]]) +; CHECK: ![[THEN]] = !DILocation(line: 4, scope: ![[BLOCK2]], isImplicitCode: false) !16 = !DILocation(line: 6, scope: !4) -; CHECK: ![[BR]] = !DILocation(line: 5, scope: ![[BLOCK2]]) -; CHECK: ![[END]] = !DILocation(line: 6, scope: ![[FOO]]) +; CHECK: ![[BR]] = !DILocation(line: 5, scope: ![[BLOCK2]], isImplicitCode: false) +; CHECK: ![[END]] = !DILocation(line: 6, scope: ![[FOO]], isImplicitCode: false) Index: test/Transforms/AddDiscriminators/inlined.ll =================================================================== --- test/Transforms/AddDiscriminators/inlined.ll +++ test/Transforms/AddDiscriminators/inlined.ll @@ -75,7 +75,7 @@ !17 = distinct !DILexicalBlock(scope: !7, file: !1, line: 1, column: 9) !18 = !DILocation(line: 1, column: 9, scope: !7) !19 = !DILocation(line: 1, column: 27, scope: !12, inlinedAt: !13) -; CHECK: ![[BR]] = !DILocation(line: 1, column: 9, scope: !14) +; CHECK: ![[BR]] = !DILocation(line: 1, column: 9, scope: !14, isImplicitCode: false) !20 = !DILocation(line: 1, column: 9, scope: !14) !21 = distinct !{!21, !18} !22 = !DILocation(line: 1, column: 56, scope: !12) Index: test/Transforms/AddDiscriminators/memcpy-discriminator.ll =================================================================== --- test/Transforms/AddDiscriminators/memcpy-discriminator.ll +++ test/Transforms/AddDiscriminators/memcpy-discriminator.ll @@ -63,9 +63,9 @@ ; CHECK-NEXT: %call = call i32 @bar({{.*}}), !dbg ![[LOC]] ; CHECK-NEXT: br label %cond.end, !dbg ![[BR_LOC:[0-9]+]] -; CHECK-DAG: ![[LOC]] = !DILocation(line: 16, column: 23, scope: ![[SCOPE:[0-9]+]]) +; CHECK-DAG: ![[LOC]] = !DILocation(line: 16, column: 23, scope: ![[SCOPE:[0-9]+]], isImplicitCode: false) ; CHECK-DAG: ![[SCOPE]] = !DILexicalBlockFile({{.*}}, discriminator: 2) -; CHECK-DAG: ![[BR_LOC]] = !DILocation(line: 16, column: 16, scope: ![[SCOPE]]) +; CHECK-DAG: ![[BR_LOC]] = !DILocation(line: 16, column: 16, scope: ![[SCOPE]], isImplicitCode: false) %0 = bitcast { i64, i32 }* %g_b.coerce to i8*, !dbg !8 %1 = bitcast %struct.B* @g_b to i8*, !dbg !8 Index: test/Transforms/AddDiscriminators/multiple.ll =================================================================== --- test/Transforms/AddDiscriminators/multiple.ll +++ test/Transforms/AddDiscriminators/multiple.ll @@ -66,7 +66,7 @@ !11 = distinct !DILexicalBlock(line: 3, column: 0, file: !1, scope: !4) !12 = !DILocation(line: 4, scope: !4) -; CHECK: ![[THEN]] = !DILocation(line: 3, scope: ![[THENBLOCK:[0-9]+]]) +; CHECK: ![[THEN]] = !DILocation(line: 3, scope: ![[THENBLOCK:[0-9]+]], isImplicitCode: false) ; CHECK: ![[THENBLOCK]] = !DILexicalBlockFile(scope: ![[SCOPE:[0-9]+]],{{.*}} discriminator: 2) -; CHECK: ![[ELSE]] = !DILocation(line: 3, scope: ![[ELSEBLOCK:[0-9]+]]) +; CHECK: ![[ELSE]] = !DILocation(line: 3, scope: ![[ELSEBLOCK:[0-9]+]], isImplicitCode: false) ; CHECK: ![[ELSEBLOCK]] = !DILexicalBlockFile(scope: ![[SCOPE]],{{.*}} discriminator: 4) Index: test/Transforms/AddDiscriminators/no-discriminators.ll =================================================================== --- test/Transforms/AddDiscriminators/no-discriminators.ll +++ test/Transforms/AddDiscriminators/no-discriminators.ll @@ -70,7 +70,7 @@ !13 = !DILocalVariable(name: "i", line: 1, arg: 1, scope: !4, file: !5, type: !9) !14 = !DILocation(line: 1, scope: !4) !15 = !DILocation(line: 2, scope: !16) -; CHECK: ![[ENTRY]] = !DILocation(line: 2, scope: ![[BLOCK:[0-9]+]]) +; CHECK: ![[ENTRY]] = !DILocation(line: 2, scope: ![[BLOCK:[0-9]+]], isImplicitCode: false) !16 = distinct !DILexicalBlock(line: 2, column: 0, file: !1, scope: !4) ; CHECK: ![[BLOCK]] = distinct !DILexicalBlock(scope: ![[FOO]],{{.*}} line: 2) !17 = !DILocation(line: 3, scope: !4) Index: test/Transforms/AddDiscriminators/oneline.ll =================================================================== --- test/Transforms/AddDiscriminators/oneline.ll +++ test/Transforms/AddDiscriminators/oneline.ll @@ -90,12 +90,12 @@ ; CHECK: ![[F:.*]] = distinct !DISubprogram(name: "foo", ; CHECK: ![[IF:.*]] = distinct !DILexicalBlock(scope: ![[F]],{{.*}}line: 2, column: 7) -; CHECK: ![[THEN1]] = !DILocation(line: 2, column: 17, scope: ![[THENBLOCK:[0-9]+]]) +; CHECK: ![[THEN1]] = !DILocation(line: 2, column: 17, scope: ![[THENBLOCK:[0-9]+]], isImplicitCode: false) ; CHECK: ![[THENBLOCK]] = !DILexicalBlockFile(scope: ![[IF]],{{.*}} discriminator: 2) -; CHECK: ![[THEN2]] = !DILocation(line: 2, column: 19, scope: ![[THENBLOCK]]) -; CHECK: ![[THEN3]] = !DILocation(line: 2, column: 7, scope: ![[BRBLOCK:[0-9]+]]) +; CHECK: ![[THEN2]] = !DILocation(line: 2, column: 19, scope: ![[THENBLOCK]], isImplicitCode: false) +; CHECK: ![[THEN3]] = !DILocation(line: 2, column: 7, scope: ![[BRBLOCK:[0-9]+]], isImplicitCode: false) ; CHECK: ![[BRBLOCK]] = !DILexicalBlockFile(scope: ![[F]],{{.*}} discriminator: 2) -; CHECK: ![[ELSE]] = !DILocation(line: 2, column: 25, scope: ![[ELSEBLOCK:[0-9]+]]) +; CHECK: ![[ELSE]] = !DILocation(line: 2, column: 25, scope: ![[ELSEBLOCK:[0-9]+]], isImplicitCode: false) ; CHECK: ![[ELSEBLOCK]] = !DILexicalBlockFile(scope: ![[IF]],{{.*}} discriminator: 4) -; CHECK: ![[COMBINE]] = !DILocation(line: 2, column: 42, scope: ![[COMBINEBLOCK:[0-9]+]]) +; CHECK: ![[COMBINE]] = !DILocation(line: 2, column: 42, scope: ![[COMBINEBLOCK:[0-9]+]], isImplicitCode: false) ; CHECK: ![[COMBINEBLOCK]] = !DILexicalBlockFile(scope: ![[IF]],{{.*}} discriminator: 6) Index: test/Transforms/EntryExitInstrumenter/debug-info.ll =================================================================== --- test/Transforms/EntryExitInstrumenter/debug-info.ll +++ test/Transforms/EntryExitInstrumenter/debug-info.ll @@ -19,8 +19,8 @@ } ; CHECK: ![[SP:[0-9]+]] = distinct !DISubprogram(name: "f" -; CHECK: ![[ENTRYLOC]] = !DILocation(line: 2, scope: ![[SP]]) -; CHECK: ![[EXITLOC]] = !DILocation(line: 4, column: 3, scope: ![[SP]]) +; CHECK: ![[ENTRYLOC]] = !DILocation(line: 2, scope: ![[SP]], isImplicitCode: false) +; CHECK: ![[EXITLOC]] = !DILocation(line: 4, column: 3, scope: ![[SP]], isImplicitCode: false) attributes #0 = { "instrument-function-entry"="__cyg_profile_func_enter" "instrument-function-exit"="__cyg_profile_func_exit" } Index: test/Transforms/GVN/PRE/2017-06-28-pre-load-dbgloc.ll =================================================================== --- test/Transforms/GVN/PRE/2017-06-28-pre-load-dbgloc.ll +++ test/Transforms/GVN/PRE/2017-06-28-pre-load-dbgloc.ll @@ -75,5 +75,5 @@ !11 = !DILocation(line: 15, column: 34, scope: !4) ;ALL: [[SCOPE:![0-9]+]] = distinct !DISubprogram(name: "test",{{.*}} -;ALL: [[LOC_15_6]] = !DILocation(line: 15, column: 6, scope: [[SCOPE]]) -;ALL: [[LOC_16_13]] = !DILocation(line: 16, column: 13, scope: [[SCOPE]]) +;ALL: [[LOC_15_6]] = !DILocation(line: 15, column: 6, scope: [[SCOPE]], isImplicitCode: false) +;ALL: [[LOC_16_13]] = !DILocation(line: 16, column: 13, scope: [[SCOPE]], isImplicitCode: false) Index: test/Transforms/GVN/PRE/2018-06-08-pre-load-dbgloc-no-null-opt.ll =================================================================== --- test/Transforms/GVN/PRE/2018-06-08-pre-load-dbgloc-no-null-opt.ll +++ test/Transforms/GVN/PRE/2018-06-08-pre-load-dbgloc-no-null-opt.ll @@ -78,5 +78,5 @@ !11 = !DILocation(line: 15, column: 34, scope: !4) ;ALL: [[SCOPE:![0-9]+]] = distinct !DISubprogram(name: "test_no_null_opt",{{.*}} -;ALL: [[LOC_15_6]] = !DILocation(line: 15, column: 6, scope: [[SCOPE]]) -;ALL: [[LOC_16_13]] = !DILocation(line: 16, column: 13, scope: [[SCOPE]]) +;ALL: [[LOC_15_6]] = !DILocation(line: 15, column: 6, scope: [[SCOPE]], isImplicitCode: false) +;ALL: [[LOC_16_13]] = !DILocation(line: 16, column: 13, scope: [[SCOPE]], isImplicitCode: false) Index: test/Transforms/GVNHoist/hoist-pr31891.ll =================================================================== --- test/Transforms/GVNHoist/hoist-pr31891.ll +++ test/Transforms/GVNHoist/hoist-pr31891.ll @@ -45,7 +45,7 @@ ; CHECK: br i1 %tobool, label %if.then, label %if.else ; CHECK: ![[sp_hoistit]] = distinct !DISubprogram(name: "hoistit", {{.*}}) -; CHECK: ![[dbgloc]] = !DILocation({{.*}}, scope: ![[sp_hoistit]]) +; CHECK: ![[dbgloc]] = !DILocation({{.*}}, scope: ![[sp_hoistit]], isImplicitCode: false) declare void @useit1(float) Index: test/Transforms/Inline/debug-info-duplicate-calls.ll =================================================================== --- test/Transforms/Inline/debug-info-duplicate-calls.ll +++ test/Transforms/Inline/debug-info-duplicate-calls.ll @@ -39,19 +39,19 @@ ; CHECK-DAG: [[F3:![0-9]+]] = distinct !DISubprogram(name: "f3" ; CHECK-DAG: [[F4:![0-9]+]] = distinct !DISubprogram(name: "f4" -; CHECK-DAG: [[fcs1_f4_f3cs1_f2]] = {{.*}}, scope: [[F2]], inlinedAt: [[fcs1_f4_f3cs1:![0-9]+]]) -; CHECK-DAG: [[fcs1_f4_f3cs1]] = {{.*}}, scope: [[F3]], inlinedAt: [[fcs1_f4:![0-9]+]]) -; CHECK-DAG: [[fcs1_f4]] = {{.*}}, scope: [[F4]], inlinedAt: [[fcs1:![0-9]+]]) -; CHECK-DAG: [[fcs1]] = {{.*}}, scope: [[F]]) -; CHECK-DAG: [[fcs1_f4_f3cs2_f2]] = {{.*}}, scope: [[F2]], inlinedAt: [[fcs1_f4_f3cs2:![0-9]+]]) -; CHECK-DAG: [[fcs1_f4_f3cs2]] = {{.*}}, scope: [[F3]], inlinedAt: [[fcs1_f4]]) - -; CHECK-DAG: [[fcs2_f4_f3cs1_f2]] = {{.*}}, scope: [[F2]], inlinedAt: [[fcs2_f4_f3cs1:![0-9]+]]) -; CHECK-DAG: [[fcs2_f4_f3cs1]] = {{.*}}, scope: [[F3]], inlinedAt: [[fcs2_f4:![0-9]+]]) -; CHECK-DAG: [[fcs2_f4]] = {{.*}}, scope: [[F4]], inlinedAt: [[fcs2:![0-9]+]]) -; CHECK-DAG: [[fcs2]] = {{.*}}, scope: [[F]]) -; CHECK-DAG: [[fcs2_f4_f3cs2_f2]] = {{.*}}, scope: [[F2]], inlinedAt: [[fcs2_f4_f3cs2:![0-9]+]]) -; CHECK-DAG: [[fcs2_f4_f3cs2]] = {{.*}}, scope: [[F3]], inlinedAt: [[fcs2_f4]]) +; CHECK-DAG: [[fcs1_f4_f3cs1_f2]] = {{.*}}, scope: [[F2]], inlinedAt: [[fcs1_f4_f3cs1:![0-9]+]], isImplicitCode: false) +; CHECK-DAG: [[fcs1_f4_f3cs1]] = {{.*}}, scope: [[F3]], inlinedAt: [[fcs1_f4:![0-9]+]], isImplicitCode: false) +; CHECK-DAG: [[fcs1_f4]] = {{.*}}, scope: [[F4]], inlinedAt: [[fcs1:![0-9]+]], isImplicitCode: false) +; CHECK-DAG: [[fcs1]] = {{.*}}, scope: [[F]], isImplicitCode: false) +; CHECK-DAG: [[fcs1_f4_f3cs2_f2]] = {{.*}}, scope: [[F2]], inlinedAt: [[fcs1_f4_f3cs2:![0-9]+]], isImplicitCode: false) +; CHECK-DAG: [[fcs1_f4_f3cs2]] = {{.*}}, scope: [[F3]], inlinedAt: [[fcs1_f4]], isImplicitCode: false) + +; CHECK-DAG: [[fcs2_f4_f3cs1_f2]] = {{.*}}, scope: [[F2]], inlinedAt: [[fcs2_f4_f3cs1:![0-9]+]], isImplicitCode: false) +; CHECK-DAG: [[fcs2_f4_f3cs1]] = {{.*}}, scope: [[F3]], inlinedAt: [[fcs2_f4:![0-9]+]], isImplicitCode: false) +; CHECK-DAG: [[fcs2_f4]] = {{.*}}, scope: [[F4]], inlinedAt: [[fcs2:![0-9]+]], isImplicitCode: false) +; CHECK-DAG: [[fcs2]] = {{.*}}, scope: [[F]], isImplicitCode: false) +; CHECK-DAG: [[fcs2_f4_f3cs2_f2]] = {{.*}}, scope: [[F2]], inlinedAt: [[fcs2_f4_f3cs2:![0-9]+]], isImplicitCode: false) +; CHECK-DAG: [[fcs2_f4_f3cs2]] = {{.*}}, scope: [[F3]], inlinedAt: [[fcs2_f4]], isImplicitCode: false) $_Z2f4v = comdat any Index: test/Transforms/Inline/debug-invoke.ll =================================================================== --- test/Transforms/Inline/debug-invoke.ll +++ test/Transforms/Inline/debug-invoke.ll @@ -5,8 +5,8 @@ ; CHECK: invoke void @test() ; CHECK-NEXT: to label {{.*}} unwind label {{.*}}, !dbg [[INL_LOC:!.*]] ; CHECK: [[SP:.*]] = distinct !DISubprogram( -; CHECK: [[INL_LOC]] = !DILocation(line: 1, scope: [[SP]], inlinedAt: [[INL_AT:.*]]) -; CHECK: [[INL_AT]] = distinct !DILocation(line: 2, scope: [[SP]]) +; CHECK: [[INL_LOC]] = !DILocation(line: 1, scope: [[SP]], inlinedAt: [[INL_AT:.*]], isImplicitCode: false) +; CHECK: [[INL_AT]] = distinct !DILocation(line: 2, scope: [[SP]], isImplicitCode: false) declare void @test() declare i32 @__gxx_personality_v0(...) Index: test/Transforms/Inline/inline_dbg_declare.ll =================================================================== --- test/Transforms/Inline/inline_dbg_declare.ll +++ test/Transforms/Inline/inline_dbg_declare.ll @@ -95,5 +95,5 @@ ; CHECK: [[FOO:![0-9]+]] = distinct !DISubprogram(name: "foo", ; CHECK: [[m23]] = !DILocalVariable(name: "x", arg: 1, scope: [[FOO]] ; CHECK: [[BAR:![0-9]+]] = distinct !DISubprogram(name: "bar", -; CHECK: [[m24]] = !DILocation(line: 1, column: 17, scope: [[FOO]], inlinedAt: [[CALL_SITE:![0-9]+]]) -; CHECK: [[CALL_SITE]] = distinct !DILocation(line: 8, column: 14, scope: [[BAR]]) +; CHECK: [[m24]] = !DILocation(line: 1, column: 17, scope: [[FOO]], inlinedAt: [[CALL_SITE:![0-9]+]], isImplicitCode: false) +; CHECK: [[CALL_SITE]] = distinct !DILocation(line: 8, column: 14, scope: [[BAR]], isImplicitCode: false) Index: test/Transforms/LoopSimplify/dbg-loc.ll =================================================================== --- test/Transforms/LoopSimplify/dbg-loc.ll +++ test/Transforms/LoopSimplify/dbg-loc.ll @@ -72,9 +72,9 @@ ; Function Attrs: nounwind readnone declare void @llvm.dbg.value(metadata, metadata, metadata) -; CHECK-DAG: [[PREHEADER_LOC]] = !DILocation(line: 73, column: 27, scope: !{{[0-9]+}}) -; CHECK-DAG: [[LOOPEXIT_LOC]] = !DILocation(line: 75, column: 9, scope: !{{[0-9]+}}) -; CHECK-DAG: [[LPAD_PREHEADER_LOC]] = !DILocation(line: 85, column: 1, scope: !{{[0-9]+}}) +; CHECK-DAG: [[PREHEADER_LOC]] = !DILocation(line: 73, column: 27, scope: !{{[0-9]+}}, isImplicitCode: false) +; CHECK-DAG: [[LOOPEXIT_LOC]] = !DILocation(line: 75, column: 9, scope: !{{[0-9]+}}, isImplicitCode: false) +; CHECK-DAG: [[LPAD_PREHEADER_LOC]] = !DILocation(line: 85, column: 1, scope: !{{[0-9]+}}, isImplicitCode: false) !llvm.module.flags = !{!0, !1, !2} !llvm.dbg.cu = !{!14} Index: test/Transforms/Mem2Reg/dbg-inline-scope-for-phi.ll =================================================================== --- test/Transforms/Mem2Reg/dbg-inline-scope-for-phi.ll +++ test/Transforms/Mem2Reg/dbg-inline-scope-for-phi.ll @@ -63,7 +63,7 @@ } ; CHECK: [[commonScope:![0-9]+]] = distinct !DILexicalBlock(scope: {{.*}}, file: !1, line: 15, column: 7) -; CHECK: [[mergedLoc]] = !DILocation(line: 0, scope: [[commonScope]]) +; CHECK: [[mergedLoc]] = !DILocation(line: 0, scope: [[commonScope]], isImplicitCode: false) ; CHECK: [[retLoc]] = !DILocation(line: 23, column: 1 declare i32 @cond(...) Index: test/Transforms/SafeStack/ARM/debug.ll =================================================================== --- test/Transforms/SafeStack/ARM/debug.ll +++ test/Transforms/SafeStack/ARM/debug.ll @@ -10,8 +10,8 @@ ; void Capture(char*x); ; void f() { char c[16]; Capture(c); } -; CHECK: !35 = !DILocation(line: 3, column: 11, scope: !17, inlinedAt: !36) -; CHECK: !36 = distinct !DILocation(line: 6, scope: !27) +; CHECK: !35 = !DILocation(line: 3, column: 11, scope: !17, inlinedAt: !36, isImplicitCode: false) +; CHECK: !36 = distinct !DILocation(line: 6, scope: !27, isImplicitCode: false) @addr = common local_unnamed_addr global i8*** null, align 4, !dbg !0 Index: test/Transforms/Util/strip-nonlinetable-debuginfo-loops.ll =================================================================== --- test/Transforms/Util/strip-nonlinetable-debuginfo-loops.ll +++ test/Transforms/Util/strip-nonlinetable-debuginfo-loops.ll @@ -57,7 +57,7 @@ !14 = !DILocalVariable(name: "i", arg: 1, scope: !7, file: !1, line: 1, type: !10) !15 = !DIExpression() !16 = !DILocation(line: 1, column: 22, scope: !7) -; CHECK: ![[BEGIN:[0-9]+]] = !DILocation(line: 2, column: 3, scope: ![[F]]) +; CHECK: ![[BEGIN:[0-9]+]] = !DILocation(line: 2, column: 3, scope: ![[F]], isImplicitCode: false) !17 = !DILocation(line: 2, column: 3, scope: !7) !18 = !DILocation(line: 2, column: 10, scope: !7) !19 = !{!20, !20, i64 0} @@ -66,6 +66,6 @@ !22 = !{!"Simple C/C++ TBAA"} ; CHECK: ![[LOOP]] = distinct !{![[LOOP]], ![[BEGIN]], ![[END:[0-9]+]]} !23 = distinct !{!23, !17, !24} -; CHECK: ![[END]] = !DILocation(line: 3, column: 3, scope: ![[F]]) +; CHECK: ![[END]] = !DILocation(line: 3, column: 3, scope: ![[F]], isImplicitCode: false) !24 = !DILocation(line: 3, column: 3, scope: !7) !25 = !DILocation(line: 4, column: 1, scope: !7) Index: test/Verifier/dbg.ll =================================================================== --- test/Verifier/dbg.ll +++ test/Verifier/dbg.ll @@ -4,7 +4,7 @@ entry: br label %exit, !dbg !DILocation(scope: !1, inlinedAt: !{}) ; CHECK: inlined-at should be a location -; CHECK-NEXT: !{{[0-9]+}} = !DILocation(line: 0, scope: !{{[0-9]+}}, inlinedAt: ![[IA:[0-9]+]]) +; CHECK-NEXT: !{{[0-9]+}} = !DILocation(line: 0, scope: !{{[0-9]+}}, inlinedAt: ![[IA:[0-9]+]], isImplicitCode: false) ; CHECK-NEXT: ![[IA]] = !{} exit: