diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -4371,8 +4371,13 @@ // Create the descriptor for the variable. llvm::DILocalVariable *D = nullptr; if (ArgNo) { + llvm::DINodeArray Annotations = nullptr; + if (VD->hasAttr()) + Annotations = CollectBTFTagAnnotations(VD); + D = DBuilder.createParameterVariable(Scope, Name, *ArgNo, Unit, Line, Ty, - CGM.getLangOpts().Optimize, Flags); + CGM.getLangOpts().Optimize, Flags, + Annotations); } else { // For normal local variable, we will try to find out whether 'VD' is the // copy parameter of coroutine. diff --git a/clang/test/CodeGen/attr-btf_tag-parameter.c b/clang/test/CodeGen/attr-btf_tag-parameter.c new file mode 100644 --- /dev/null +++ b/clang/test/CodeGen/attr-btf_tag-parameter.c @@ -0,0 +1,18 @@ +// REQUIRES: x86-registered-target +// RUN: %clang -target x86_64 -g -S -emit-llvm -o - %s | FileCheck %s + +#define __tag1 __attribute__((btf_tag("tag1"))) +#define __tag2 __attribute__((btf_tag("tag2"))) + +struct t1 { + int a; +}; + +int foo(struct t1 __tag1 __tag2 *arg) { + return arg->a; +} + +// CHECK: !DILocalVariable(name: "arg", arg: 1, scope: ![[#]], file: ![[#]], line: [[#]], type: ![[#]], annotations: ![[ANNOT:[0-9]+]]) +// CHECK: ![[ANNOT]] = !{![[TAG1:[0-9]+]], ![[TAG2:[0-9]+]]} +// CHECK: ![[TAG1]] = !{!"btf_tag", !"tag1"} +// CHECK: ![[TAG2]] = !{!"btf_tag", !"tag2"} diff --git a/llvm/include/llvm/IR/DIBuilder.h b/llvm/include/llvm/IR/DIBuilder.h --- a/llvm/include/llvm/IR/DIBuilder.h +++ b/llvm/include/llvm/IR/DIBuilder.h @@ -685,7 +685,8 @@ createParameterVariable(DIScope *Scope, StringRef Name, unsigned ArgNo, DIFile *File, unsigned LineNo, DIType *Ty, bool AlwaysPreserve = false, - DINode::DIFlags Flags = DINode::FlagZero); + DINode::DIFlags Flags = DINode::FlagZero, + DINodeArray Annotations = nullptr); /// Create a new descriptor for the specified /// variable which has a complex address expression for its address. diff --git a/llvm/include/llvm/IR/DebugInfoMetadata.h b/llvm/include/llvm/IR/DebugInfoMetadata.h --- a/llvm/include/llvm/IR/DebugInfoMetadata.h +++ b/llvm/include/llvm/IR/DebugInfoMetadata.h @@ -3116,34 +3116,37 @@ static DILocalVariable *getImpl(LLVMContext &Context, DIScope *Scope, StringRef Name, DIFile *File, unsigned Line, DIType *Type, unsigned Arg, DIFlags Flags, - uint32_t AlignInBits, StorageType Storage, - bool ShouldCreate = true) { + uint32_t AlignInBits, DINodeArray Annotations, + StorageType Storage, bool ShouldCreate = true) { return getImpl(Context, Scope, getCanonicalMDString(Context, Name), File, - Line, Type, Arg, Flags, AlignInBits, Storage, ShouldCreate); + Line, Type, Arg, Flags, AlignInBits, Annotations.get(), Storage, + ShouldCreate); } static DILocalVariable *getImpl(LLVMContext &Context, Metadata *Scope, MDString *Name, Metadata *File, unsigned Line, Metadata *Type, unsigned Arg, DIFlags Flags, - uint32_t AlignInBits, StorageType Storage, - bool ShouldCreate = true); + uint32_t AlignInBits, Metadata *Annotations, + StorageType Storage, bool ShouldCreate = true); TempDILocalVariable cloneImpl() const { return getTemporary(getContext(), getScope(), getName(), getFile(), getLine(), getType(), getArg(), getFlags(), - getAlignInBits()); + getAlignInBits(), getAnnotations()); } public: DEFINE_MDNODE_GET(DILocalVariable, (DILocalScope * Scope, StringRef Name, DIFile *File, unsigned Line, DIType *Type, unsigned Arg, DIFlags Flags, - uint32_t AlignInBits), - (Scope, Name, File, Line, Type, Arg, Flags, AlignInBits)) + uint32_t AlignInBits, DINodeArray Annotations), + (Scope, Name, File, Line, Type, Arg, Flags, AlignInBits, + Annotations)) DEFINE_MDNODE_GET(DILocalVariable, (Metadata * Scope, MDString *Name, Metadata *File, unsigned Line, Metadata *Type, unsigned Arg, - DIFlags Flags, uint32_t AlignInBits), - (Scope, Name, File, Line, Type, Arg, Flags, AlignInBits)) + DIFlags Flags, uint32_t AlignInBits, Metadata *Annotations), + (Scope, Name, File, Line, Type, Arg, Flags, AlignInBits, + Annotations)) TempDILocalVariable clone() const { return cloneImpl(); } @@ -3158,6 +3161,11 @@ unsigned getArg() const { return Arg; } DIFlags getFlags() const { return Flags; } + DINodeArray getAnnotations() const { + return cast_or_null(getRawAnnotations()); + } + Metadata *getRawAnnotations() const { return getOperand(4); } + bool isArtificial() const { return getFlags() & FlagArtificial; } bool isObjectPointer() const { return getFlags() & FlagObjectPointer; } diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/lib/AsmParser/LLParser.cpp @@ -4977,13 +4977,15 @@ OPTIONAL(line, LineField, ); \ OPTIONAL(type, MDField, ); \ OPTIONAL(flags, DIFlagField, ); \ - OPTIONAL(align, MDUnsignedField, (0, UINT32_MAX)); + OPTIONAL(align, MDUnsignedField, (0, UINT32_MAX)); \ + OPTIONAL(annotations, MDField, ); PARSE_MD_FIELDS(); #undef VISIT_MD_FIELDS Result = GET_OR_DISTINCT(DILocalVariable, (Context, scope.Val, name.Val, file.Val, line.Val, - type.Val, arg.Val, flags.Val, align.Val)); + type.Val, arg.Val, flags.Val, align.Val, + annotations.Val)); return false; } diff --git a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp --- a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp +++ b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp @@ -1962,18 +1962,23 @@ bool HasTag = !HasAlignment && Record.size() > 8; DINode::DIFlags Flags = static_cast(Record[7 + HasTag]); uint32_t AlignInBits = 0; + Metadata *Annotations = nullptr; if (HasAlignment) { - if (Record[8 + HasTag] > (uint64_t)std::numeric_limits::max()) + if (Record[8] > (uint64_t)std::numeric_limits::max()) return error("Alignment value is too large"); - AlignInBits = Record[8 + HasTag]; + AlignInBits = Record[8]; + if (Record.size() > 9) + Annotations = getMDOrNull(Record[9]); } + MetadataList.assignValue( GET_OR_DISTINCT(DILocalVariable, (Context, getMDOrNull(Record[1 + HasTag]), getMDString(Record[2 + HasTag]), getMDOrNull(Record[3 + HasTag]), Record[4 + HasTag], getDITypeRefOrNull(Record[5 + HasTag]), - Record[6 + HasTag], Flags, AlignInBits)), + Record[6 + HasTag], Flags, AlignInBits, + Annotations)), NextMetadataNo); NextMetadataNo++; break; diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -1992,6 +1992,7 @@ Record.push_back(N->getArg()); Record.push_back(N->getFlags()); Record.push_back(N->getAlignInBits()); + Record.push_back(VE.getMetadataOrNullID(N->getAnnotations().get())); Stream.EmitRecord(bitc::METADATA_LOCAL_VAR, Record, Abbrev); Record.clear(); diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp --- a/llvm/lib/IR/AsmWriter.cpp +++ b/llvm/lib/IR/AsmWriter.cpp @@ -2316,6 +2316,7 @@ Printer.printMetadata("type", N->getRawType()); Printer.printDIFlags("flags", N->getFlags()); Printer.printInt("align", N->getAlignInBits()); + Printer.printMetadata("annotations", N->getRawAnnotations()); Out << ")"; } diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp --- a/llvm/lib/IR/DIBuilder.cpp +++ b/llvm/lib/IR/DIBuilder.cpp @@ -741,7 +741,7 @@ DenseMap> &PreservedVariables, DIScope *Scope, StringRef Name, unsigned ArgNo, DIFile *File, unsigned LineNo, DIType *Ty, bool AlwaysPreserve, DINode::DIFlags Flags, - uint32_t AlignInBits) { + uint32_t AlignInBits, DINodeArray Annotations = nullptr) { // FIXME: Why getNonCompileUnitScope()? // FIXME: Why is "!Context" okay here? // FIXME: Why doesn't this check for a subprogram or lexical block (AFAICT @@ -750,7 +750,8 @@ auto *Node = DILocalVariable::get(VMContext, cast_or_null(Context), Name, - File, LineNo, Ty, ArgNo, Flags, AlignInBits); + File, LineNo, Ty, ArgNo, Flags, AlignInBits, + Annotations); if (AlwaysPreserve) { // The optimizer may remove local variables. If there is an interest // to preserve variable info in such situation then stash it in a @@ -774,11 +775,12 @@ DILocalVariable *DIBuilder::createParameterVariable( DIScope *Scope, StringRef Name, unsigned ArgNo, DIFile *File, - unsigned LineNo, DIType *Ty, bool AlwaysPreserve, DINode::DIFlags Flags) { + unsigned LineNo, DIType *Ty, bool AlwaysPreserve, DINode::DIFlags Flags, + DINodeArray Annotations) { assert(ArgNo && "Expected non-zero argument number for parameter"); return createLocalVariable(VMContext, PreservedVariables, Scope, Name, ArgNo, File, LineNo, Ty, AlwaysPreserve, Flags, - /* AlignInBits */0); + /* AlignInBits */0, Annotations); } DILabel *DIBuilder::createLabel( diff --git a/llvm/lib/IR/DebugInfoMetadata.cpp b/llvm/lib/IR/DebugInfoMetadata.cpp --- a/llvm/lib/IR/DebugInfoMetadata.cpp +++ b/llvm/lib/IR/DebugInfoMetadata.cpp @@ -1011,6 +1011,7 @@ unsigned Line, Metadata *Type, unsigned Arg, DIFlags Flags, uint32_t AlignInBits, + Metadata *Annotations, StorageType Storage, bool ShouldCreate) { // 64K ought to be enough for any frontend. @@ -1020,8 +1021,8 @@ assert(isCanonical(Name) && "Expected canonical MDString"); DEFINE_GETIMPL_LOOKUP(DILocalVariable, (Scope, Name, File, Line, Type, Arg, Flags, - AlignInBits)); - Metadata *Ops[] = {Scope, Name, File, Type}; + AlignInBits, Annotations)); + Metadata *Ops[] = {Scope, Name, File, Type, Annotations}; DEFINE_GETIMPL_STORE(DILocalVariable, (Line, Arg, Flags, AlignInBits), Ops); } diff --git a/llvm/lib/IR/LLVMContextImpl.h b/llvm/lib/IR/LLVMContextImpl.h --- a/llvm/lib/IR/LLVMContextImpl.h +++ b/llvm/lib/IR/LLVMContextImpl.h @@ -1042,22 +1042,25 @@ unsigned Arg; unsigned Flags; uint32_t AlignInBits; + Metadata *Annotations; MDNodeKeyImpl(Metadata *Scope, MDString *Name, Metadata *File, unsigned Line, Metadata *Type, unsigned Arg, unsigned Flags, - uint32_t AlignInBits) + uint32_t AlignInBits, Metadata *Annotations) : Scope(Scope), Name(Name), File(File), Line(Line), Type(Type), Arg(Arg), - Flags(Flags), AlignInBits(AlignInBits) {} + Flags(Flags), AlignInBits(AlignInBits), Annotations(Annotations) {} MDNodeKeyImpl(const DILocalVariable *N) : Scope(N->getRawScope()), Name(N->getRawName()), File(N->getRawFile()), Line(N->getLine()), Type(N->getRawType()), Arg(N->getArg()), - Flags(N->getFlags()), AlignInBits(N->getAlignInBits()) {} + Flags(N->getFlags()), AlignInBits(N->getAlignInBits()), + Annotations(N->getRawAnnotations()) {} bool isKeyOf(const DILocalVariable *RHS) const { return Scope == RHS->getRawScope() && Name == RHS->getRawName() && File == RHS->getRawFile() && Line == RHS->getLine() && Type == RHS->getRawType() && Arg == RHS->getArg() && - Flags == RHS->getFlags() && AlignInBits == RHS->getAlignInBits(); + Flags == RHS->getFlags() && AlignInBits == RHS->getAlignInBits() && + Annotations == RHS->getRawAnnotations(); } unsigned getHashValue() const { @@ -1068,7 +1071,7 @@ // clang/test/CodeGen/debug-info-257-args.c is an example of this problem, // generated IR is random for each run and test fails with Align included. // TODO: make hashing work fine with such situations - return hash_combine(Scope, Name, File, Line, Type, Arg, Flags); + return hash_combine(Scope, Name, File, Line, Type, Arg, Flags, Annotations); } }; diff --git a/llvm/test/Bitcode/attr-btf_tag-parameter.ll b/llvm/test/Bitcode/attr-btf_tag-parameter.ll new file mode 100644 --- /dev/null +++ b/llvm/test/Bitcode/attr-btf_tag-parameter.ll @@ -0,0 +1,46 @@ +; REQUIRES: x86-registered-target +; RUN: llvm-as < %s | llvm-dis | FileCheck %s + +; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone uwtable willreturn +define dso_local i32 @f(i32 %a) local_unnamed_addr #0 !dbg !8 { +entry: + call void @llvm.dbg.value(metadata i32 %a, metadata !13, metadata !DIExpression()), !dbg !17 + ret i32 0, !dbg !18 +} + +; Function Attrs: nofree nosync nounwind readnone speculatable willreturn +declare void @llvm.dbg.value(metadata, metadata, metadata) #1 + +attributes #0 = { mustprogress nofree norecurse nosync nounwind readnone uwtable willreturn "frame-pointer"="none" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } +attributes #1 = { nofree nosync nounwind readnone speculatable willreturn } + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!3, !4, !5, !6} +!llvm.ident = !{!7} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 13.0.0 (https://github.com/llvm/llvm-project.git c9e3139e00bcef23b236a02890b909a130d1b3d9)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None) +!1 = !DIFile(filename: "func.c", directory: "/home/yhs/work/tests/llvm/btf_tag") +!2 = !{} +!3 = !{i32 7, !"Dwarf Version", i32 4} +!4 = !{i32 2, !"Debug Info Version", i32 3} +!5 = !{i32 1, !"wchar_size", i32 4} +!6 = !{i32 7, !"uwtable", i32 1} +!7 = !{!"clang version 13.0.0 (https://github.com/llvm/llvm-project.git c9e3139e00bcef23b236a02890b909a130d1b3d9)"} +!8 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !9, scopeLine: 1, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !12) +!9 = !DISubroutineType(types: !10) +!10 = !{!11, !11} +!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) +!12 = !{!13} +!13 = !DILocalVariable(name: "a", arg: 1, scope: !8, file: !1, line: 1, type: !11, annotations: !14) +!14 = !{!15, !16} +!15 = !{!"btf_tag", !"a"} +!16 = !{!"btf_tag", !"b"} + +; CHECK: !DILocalVariable(name: "a", arg: 1, +; CHECK-SAME: annotations: ![[ANNOT:[0-9]+]] +; CHECK: ![[ANNOT]] = !{![[TAG1:[0-9]+]], ![[TAG2:[0-9]+]]} +; CHECK: ![[TAG1]] = !{!"btf_tag", !"a"} +; CHECK: ![[TAG2]] = !{!"btf_tag", !"b"} + +!17 = !DILocation(line: 0, scope: !8) +!18 = !DILocation(line: 1, column: 76, scope: !8) diff --git a/llvm/unittests/IR/MetadataTest.cpp b/llvm/unittests/IR/MetadataTest.cpp --- a/llvm/unittests/IR/MetadataTest.cpp +++ b/llvm/unittests/IR/MetadataTest.cpp @@ -1171,7 +1171,7 @@ DIType *Type = getDerivedType(); DINode::DIFlags Flags = static_cast(7); auto *VlaExpr = DILocalVariable::get(Context, Scope, "vla_expr", File, 8, - Type, 2, Flags, 8); + Type, 2, Flags, 8, nullptr); auto *N = DISubrange::get(Context, VlaExpr, 0); auto Count = N->getCount(); @@ -1199,7 +1199,7 @@ auto *UIother = ConstantAsMetadata::get( ConstantInt::getSigned(Type::getInt64Ty(Context), 20)); auto *UVother = DILocalVariable::get(Context, Scope, "ubother", File, 8, Type, - 2, Flags, 8); + 2, Flags, 8, nullptr); auto *UEother = DIExpression::get(Context, {5, 6}); auto *LIZero = ConstantAsMetadata::get( ConstantInt::getSigned(Type::getInt64Ty(Context), 0)); @@ -1242,13 +1242,16 @@ DIType *Type = getDerivedType(); DINode::DIFlags Flags = static_cast(7); auto *LV = - DILocalVariable::get(Context, Scope, "lb", File, 8, Type, 2, Flags, 8); + DILocalVariable::get(Context, Scope, "lb", File, 8, Type, 2, Flags, 8, + nullptr); auto *UV = - DILocalVariable::get(Context, Scope, "ub", File, 8, Type, 2, Flags, 8); + DILocalVariable::get(Context, Scope, "ub", File, 8, Type, 2, Flags, 8, + nullptr); auto *SV = - DILocalVariable::get(Context, Scope, "st", File, 8, Type, 2, Flags, 8); + DILocalVariable::get(Context, Scope, "st", File, 8, Type, 2, Flags, 8, + nullptr); auto *SVother = DILocalVariable::get(Context, Scope, "stother", File, 8, Type, - 2, Flags, 8); + 2, Flags, 8, nullptr); auto *SIother = ConstantAsMetadata::get( ConstantInt::getSigned(Type::getInt64Ty(Context), 20)); auto *SEother = DIExpression::get(Context, {5, 6}); @@ -1289,7 +1292,7 @@ auto *LIother = ConstantAsMetadata::get( ConstantInt::getSigned(Type::getInt64Ty(Context), 20)); auto *LVother = DILocalVariable::get(Context, Scope, "lbother", File, 8, Type, - 2, Flags, 8); + 2, Flags, 8, nullptr); auto *N = DISubrange::get(Context, nullptr, LE, UE, SE); @@ -1328,7 +1331,7 @@ auto *SI = DIExpression::get(Context, {dwarf::DW_OP_consts, 4}); auto *UIother = DIExpression::get(Context, {dwarf::DW_OP_consts, 20}); auto *UVother = DILocalVariable::get(Context, Scope, "ubother", File, 8, Type, - 2, Flags, 8); + 2, Flags, 8, nullptr); auto *UEother = DIExpression::get(Context, {5, 6}); auto *LIZero = DIExpression::get(Context, {dwarf::DW_OP_consts, 0}); auto *UIZero = DIExpression::get(Context, {dwarf::DW_OP_consts, 0}); @@ -1371,13 +1374,16 @@ DIType *Type = getDerivedType(); DINode::DIFlags Flags = static_cast(7); auto *LV = - DILocalVariable::get(Context, Scope, "lb", File, 8, Type, 2, Flags, 8); + DILocalVariable::get(Context, Scope, "lb", File, 8, Type, 2, Flags, 8, + nullptr); auto *UV = - DILocalVariable::get(Context, Scope, "ub", File, 8, Type, 2, Flags, 8); + DILocalVariable::get(Context, Scope, "ub", File, 8, Type, 2, Flags, 8, + nullptr); auto *SV = - DILocalVariable::get(Context, Scope, "st", File, 8, Type, 2, Flags, 8); + DILocalVariable::get(Context, Scope, "st", File, 8, Type, 2, Flags, 8, + nullptr); auto *SVother = DILocalVariable::get(Context, Scope, "stother", File, 8, Type, - 2, Flags, 8); + 2, Flags, 8, nullptr); auto *SIother = DIExpression::get( Context, {dwarf::DW_OP_consts, static_cast(-1)}); auto *SEother = DIExpression::get(Context, {5, 6}); @@ -1412,12 +1418,12 @@ DIType *Type = getDerivedType(); DINode::DIFlags Flags = static_cast(7); auto *LV = - DILocalVariable::get(Context, Scope, "lb", File, 8, Type, 2, Flags, 8); + DILocalVariable::get(Context, Scope, "lb", File, 8, Type, 2, Flags, 8, nullptr); auto *UE = DIExpression::get(Context, {2, 3}); auto *SE = DIExpression::get(Context, {3, 4}); auto *LVother = DILocalVariable::get(Context, Scope, "lbother", File, 8, Type, - 2, Flags, 8); + 2, Flags, 8, nullptr); auto *LIother = DIExpression::get( Context, {dwarf::DW_OP_consts, static_cast(-1)}); @@ -1917,9 +1923,9 @@ StringRef Identifier = "some id"; DIType *Type = getDerivedType(); Metadata *DlVar1 = DILocalVariable::get(Context, Scope, "dl_var1", File, 8, - Type, 2, Flags, 8); + Type, 2, Flags, 8, nullptr); Metadata *DlVar2 = DILocalVariable::get(Context, Scope, "dl_var2", File, 8, - Type, 2, Flags, 8); + Type, 2, Flags, 8, nullptr); uint64_t Elements1[] = {dwarf::DW_OP_push_object_address, dwarf::DW_OP_deref}; Metadata *DataLocation1 = DIExpression::get(Context, Elements1); @@ -2697,7 +2703,7 @@ auto *N = DILocalVariable::get(Context, Scope, Name, File, Line, Type, Arg, Flags, - AlignInBits); + AlignInBits, nullptr); EXPECT_TRUE(N->isParameter()); EXPECT_EQ(Scope, N->getScope()); EXPECT_EQ(Name, N->getName()); @@ -2708,25 +2714,26 @@ EXPECT_EQ(Flags, N->getFlags()); EXPECT_EQ(AlignInBits, N->getAlignInBits()); EXPECT_EQ(N, DILocalVariable::get(Context, Scope, Name, File, Line, Type, Arg, - Flags, AlignInBits)); + Flags, AlignInBits, nullptr)); EXPECT_FALSE( DILocalVariable::get(Context, Scope, Name, File, Line, Type, 0, Flags, - AlignInBits)->isParameter()); + AlignInBits, nullptr)->isParameter()); EXPECT_NE(N, DILocalVariable::get(Context, getSubprogram(), Name, File, Line, - Type, Arg, Flags, AlignInBits)); + Type, Arg, Flags, AlignInBits, nullptr)); EXPECT_NE(N, DILocalVariable::get(Context, Scope, "other", File, Line, Type, - Arg, Flags, AlignInBits)); + Arg, Flags, AlignInBits, nullptr)); EXPECT_NE(N, DILocalVariable::get(Context, Scope, Name, getFile(), Line, Type, - Arg, Flags, AlignInBits)); + Arg, Flags, AlignInBits, nullptr)); EXPECT_NE(N, DILocalVariable::get(Context, Scope, Name, File, Line + 1, Type, - Arg, Flags, AlignInBits)); + Arg, Flags, AlignInBits, nullptr)); EXPECT_NE(N, DILocalVariable::get(Context, Scope, Name, File, Line, - getDerivedType(), Arg, Flags, AlignInBits)); + getDerivedType(), Arg, Flags, AlignInBits, + nullptr)); EXPECT_NE(N, DILocalVariable::get(Context, Scope, Name, File, Line, Type, - Arg + 1, Flags, AlignInBits)); + Arg + 1, Flags, AlignInBits, nullptr)); EXPECT_NE(N, DILocalVariable::get(Context, Scope, Name, File, Line, Type, - Arg, Flags, (AlignInBits << 1))); + Arg, Flags, (AlignInBits << 1), nullptr)); TempDILocalVariable Temp = N->clone(); EXPECT_EQ(N, MDNode::replaceWithUniqued(std::move(Temp))); @@ -2734,17 +2741,21 @@ TEST_F(DILocalVariableTest, getArg256) { EXPECT_EQ(255u, DILocalVariable::get(Context, getSubprogram(), "", getFile(), - 0, nullptr, 255, DINode::FlagZero, 0) + 0, nullptr, 255, DINode::FlagZero, 0, + nullptr) ->getArg()); EXPECT_EQ(256u, DILocalVariable::get(Context, getSubprogram(), "", getFile(), - 0, nullptr, 256, DINode::FlagZero, 0) + 0, nullptr, 256, DINode::FlagZero, 0, + nullptr) ->getArg()); EXPECT_EQ(257u, DILocalVariable::get(Context, getSubprogram(), "", getFile(), - 0, nullptr, 257, DINode::FlagZero, 0) + 0, nullptr, 257, DINode::FlagZero, 0, + nullptr) ->getArg()); unsigned Max = UINT16_MAX; EXPECT_EQ(Max, DILocalVariable::get(Context, getSubprogram(), "", getFile(), - 0, nullptr, Max, DINode::FlagZero, 0) + 0, nullptr, Max, DINode::FlagZero, 0, + nullptr) ->getArg()); } @@ -3456,9 +3467,9 @@ DILocation *InlinedLoc = DILocation::get(Context, 2, 7, Scope); DILocalVariable *VarA = - DILocalVariable::get(Context, Scope, "A", File, 5, Type, 2, Flags, 8); + DILocalVariable::get(Context, Scope, "A", File, 5, Type, 2, Flags, 8, nullptr); DILocalVariable *VarB = - DILocalVariable::get(Context, Scope, "B", File, 7, Type, 3, Flags, 8); + DILocalVariable::get(Context, Scope, "B", File, 7, Type, 3, Flags, 8, nullptr); DebugVariable DebugVariableA(VarA, NoneType(), nullptr); DebugVariable DebugVariableInlineA(VarA, NoneType(), InlinedLoc);