llvm.org GIT mirror llvm / bd79db2
[codeview] Add DISubprogram::ThisAdjustment Summary: This represents the adjustment applied to the implicit 'this' parameter in the prologue of a virtual method in the MS C++ ABI. The adjustment is always zero unless multiple inheritance is involved. This increases the size of DISubprogram by 8 bytes, unfortunately. The adjustment really is a signed 32-bit integer. If this size increase is too much, we could probably win it back by splitting out a subclass with info specific to virtual methods (virtuality, vindex, thisadjustment, containingType). Reviewers: aprantl, dexonsmith Subscribers: aaboud, amccarth, llvm-commits Differential Revision: http://reviews.llvm.org/D21614 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274325 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Kleckner 4 years ago
15 changed file(s) with 671 addition(s) and 156 deletion(s). Raw diff Collapse all Expand all
559559 /// virtual function.
560560 /// \param VTableIndex Index no of this method in virtual table, or -1u if
561561 /// unrepresentable.
562 /// \param ThisAdjustment
563 /// MS ABI-specific adjustment of 'this' that occurs
564 /// in the prologue.
562565 /// \param VTableHolder Type that holds vtable.
563566 /// \param Flags e.g. is this function prototyped or not.
564567 /// This flags are used to emit dwarf attributes.
568571 createMethod(DIScope *Scope, StringRef Name, StringRef LinkageName,
569572 DIFile *File, unsigned LineNo, DISubroutineType *Ty,
570573 bool isLocalToUnit, bool isDefinition, unsigned Virtuality = 0,
571 unsigned VTableIndex = 0, DIType *VTableHolder = nullptr,
572 unsigned Flags = 0, bool isOptimized = false,
574 unsigned VTableIndex = 0, int ThisAdjustment = 0,
575 DIType *VTableHolder = nullptr, unsigned Flags = 0,
576 bool isOptimized = false,
573577 DITemplateParameterArray TParams = nullptr);
574578
575579 /// This creates new descriptor for a namespace with the specified
12791279 unsigned ScopeLine;
12801280 unsigned VirtualIndex;
12811281
1282 /// In the MS ABI, the implicit 'this' parameter is adjusted in the prologue
1283 /// of method overrides from secondary bases by this amount. It may be
1284 /// negative.
1285 int ThisAdjustment;
1286
12821287 // Virtuality can only assume three values, so we can pack
12831288 // in 2 bits (none/pure/pure_virtual).
12841289 unsigned Virtuality : 2;
12951300
12961301 DISubprogram(LLVMContext &C, StorageType Storage, unsigned Line,
12971302 unsigned ScopeLine, unsigned Virtuality, unsigned VirtualIndex,
1298 unsigned Flags, bool IsLocalToUnit, bool IsDefinition,
1299 bool IsOptimized, ArrayRef Ops)
1303 int ThisAdjustment, unsigned Flags, bool IsLocalToUnit,
1304 bool IsDefinition, bool IsOptimized, ArrayRef Ops)
13001305 : DILocalScope(C, DISubprogramKind, Storage, dwarf::DW_TAG_subprogram,
13011306 Ops),
13021307 Line(Line), ScopeLine(ScopeLine), VirtualIndex(VirtualIndex),
1303 Virtuality(Virtuality), Flags(Flags), IsLocalToUnit(IsLocalToUnit),
1304 IsDefinition(IsDefinition), IsOptimized(IsOptimized) {
1308 ThisAdjustment(ThisAdjustment), Virtuality(Virtuality), Flags(Flags),
1309 IsLocalToUnit(IsLocalToUnit), IsDefinition(IsDefinition),
1310 IsOptimized(IsOptimized) {
13051311 static_assert(dwarf::DW_VIRTUALITY_max < 4, "Virtuality out of range");
13061312 assert(Virtuality < 4 && "Virtuality out of range");
13071313 assert((Flags < (1 << 27)) && "Flags out of range");
13131319 StringRef LinkageName, DIFile *File, unsigned Line,
13141320 DISubroutineType *Type, bool IsLocalToUnit, bool IsDefinition,
13151321 unsigned ScopeLine, DITypeRef ContainingType, unsigned Virtuality,
1316 unsigned VirtualIndex, unsigned Flags, bool IsOptimized,
1317 DICompileUnit *Unit, DITemplateParameterArray TemplateParams,
1318 DISubprogram *Declaration, DILocalVariableArray Variables,
1319 StorageType Storage, bool ShouldCreate = true) {
1322 unsigned VirtualIndex, int ThisAdjustment, unsigned Flags,
1323 bool IsOptimized, DICompileUnit *Unit,
1324 DITemplateParameterArray TemplateParams, DISubprogram *Declaration,
1325 DILocalVariableArray Variables, StorageType Storage,
1326 bool ShouldCreate = true) {
13201327 return getImpl(Context, Scope, getCanonicalMDString(Context, Name),
13211328 getCanonicalMDString(Context, LinkageName), File, Line, Type,
13221329 IsLocalToUnit, IsDefinition, ScopeLine, ContainingType,
1323 Virtuality, VirtualIndex, Flags, IsOptimized, Unit,
1324 TemplateParams.get(), Declaration, Variables.get(), Storage,
1325 ShouldCreate);
1330 Virtuality, VirtualIndex, ThisAdjustment, Flags, IsOptimized,
1331 Unit, TemplateParams.get(), Declaration, Variables.get(),
1332 Storage, ShouldCreate);
13261333 }
13271334 static DISubprogram *
13281335 getImpl(LLVMContext &Context, Metadata *Scope, MDString *Name,
13291336 MDString *LinkageName, Metadata *File, unsigned Line, Metadata *Type,
13301337 bool IsLocalToUnit, bool IsDefinition, unsigned ScopeLine,
13311338 Metadata *ContainingType, unsigned Virtuality, unsigned VirtualIndex,
1332 unsigned Flags, bool IsOptimized, Metadata *Unit,
1339 int ThisAdjustment, unsigned Flags, bool IsOptimized, Metadata *Unit,
13331340 Metadata *TemplateParams, Metadata *Declaration, Metadata *Variables,
13341341 StorageType Storage, bool ShouldCreate = true);
13351342
13361343 TempDISubprogram cloneImpl() const {
1337 return getTemporary(getContext(), getScope(), getName(), getLinkageName(),
1338 getFile(), getLine(), getType(), isLocalToUnit(),
1339 isDefinition(), getScopeLine(), getContainingType(),
1340 getVirtuality(), getVirtualIndex(), getFlags(),
1341 isOptimized(), getUnit(), getTemplateParams(),
1342 getDeclaration(), getVariables());
1344 return getTemporary(
1345 getContext(), getScope(), getName(), getLinkageName(), getFile(),
1346 getLine(), getType(), isLocalToUnit(), isDefinition(), getScopeLine(),
1347 getContainingType(), getVirtuality(), getVirtualIndex(),
1348 getThisAdjustment(), getFlags(), isOptimized(), getUnit(),
1349 getTemplateParams(), getDeclaration(), getVariables());
13431350 }
13441351
13451352 public:
13481355 DIFile *File, unsigned Line, DISubroutineType *Type,
13491356 bool IsLocalToUnit, bool IsDefinition, unsigned ScopeLine,
13501357 DITypeRef ContainingType, unsigned Virtuality,
1351 unsigned VirtualIndex, unsigned Flags, bool IsOptimized,
1352 DICompileUnit *Unit,
1358 unsigned VirtualIndex, int ThisAdjustment, unsigned Flags,
1359 bool IsOptimized, DICompileUnit *Unit,
13531360 DITemplateParameterArray TemplateParams = nullptr,
13541361 DISubprogram *Declaration = nullptr,
13551362 DILocalVariableArray Variables = nullptr),
13561363 (Scope, Name, LinkageName, File, Line, Type, IsLocalToUnit,
13571364 IsDefinition, ScopeLine, ContainingType, Virtuality,
1358 VirtualIndex, Flags, IsOptimized, Unit, TemplateParams,
1359 Declaration, Variables))
1365 VirtualIndex, ThisAdjustment, Flags, IsOptimized, Unit,
1366 TemplateParams, Declaration, Variables))
13601367 DEFINE_MDNODE_GET(
13611368 DISubprogram,
13621369 (Metadata * Scope, MDString *Name, MDString *LinkageName, Metadata *File,
13631370 unsigned Line, Metadata *Type, bool IsLocalToUnit, bool IsDefinition,
13641371 unsigned ScopeLine, Metadata *ContainingType, unsigned Virtuality,
1365 unsigned VirtualIndex, unsigned Flags, bool IsOptimized,
1366 Metadata *Unit, Metadata *TemplateParams = nullptr,
1372 unsigned VirtualIndex, int ThisAdjustment, unsigned Flags,
1373 bool IsOptimized, Metadata *Unit, Metadata *TemplateParams = nullptr,
13671374 Metadata *Declaration = nullptr, Metadata *Variables = nullptr),
13681375 (Scope, Name, LinkageName, File, Line, Type, IsLocalToUnit, IsDefinition,
1369 ScopeLine, ContainingType, Virtuality, VirtualIndex, Flags, IsOptimized,
1370 Unit, TemplateParams, Declaration, Variables))
1376 ScopeLine, ContainingType, Virtuality, VirtualIndex, ThisAdjustment,
1377 Flags, IsOptimized, Unit, TemplateParams, Declaration, Variables))
13711378
13721379 TempDISubprogram clone() const { return cloneImpl(); }
13731380
13751382 unsigned getLine() const { return Line; }
13761383 unsigned getVirtuality() const { return Virtuality; }
13771384 unsigned getVirtualIndex() const { return VirtualIndex; }
1385 int getThisAdjustment() const { return ThisAdjustment; }
13781386 unsigned getScopeLine() const { return ScopeLine; }
13791387 unsigned getFlags() const { return Flags; }
13801388 bool isLocalToUnit() const { return IsLocalToUnit; }
39823982 /// file: !1, line: 7, type: !2, isLocal: false,
39833983 /// isDefinition: true, scopeLine: 8, containingType: !3,
39843984 /// virtuality: DW_VIRTUALTIY_pure_virtual,
3985 /// virtualIndex: 10, flags: 11,
3985 /// virtualIndex: 10, thisAdjustment: 4, flags: 11,
39863986 /// isOptimized: false, templateParams: !4, declaration: !5,
39873987 /// variables: !6)
39883988 bool LLParser::ParseDISubprogram(MDNode *&Result, bool IsDistinct) {
40004000 OPTIONAL(containingType, MDField, ); \
40014001 OPTIONAL(virtuality, DwarfVirtualityField, ); \
40024002 OPTIONAL(virtualIndex, MDUnsignedField, (0, UINT32_MAX)); \
4003 OPTIONAL(thisAdjustment, MDSignedField, (0, INT32_MIN, INT32_MAX)); \
40034004 OPTIONAL(flags, DIFlagField, ); \
40044005 OPTIONAL(isOptimized, MDBoolField, ); \
40054006 OPTIONAL(unit, MDField, ); \
40184019 DISubprogram, (Context, scope.Val, name.Val, linkageName.Val, file.Val,
40194020 line.Val, type.Val, isLocal.Val, isDefinition.Val,
40204021 scopeLine.Val, containingType.Val, virtuality.Val,
4021 virtualIndex.Val, flags.Val, isOptimized.Val, unit.Val,
4022 templateParams.Val, declaration.Val, variables.Val));
4022 virtualIndex.Val, thisAdjustment.Val, flags.Val,
4023 isOptimized.Val, unit.Val, templateParams.Val,
4024 declaration.Val, variables.Val));
40234025 return false;
40244026 }
40254027
24652465 break;
24662466 }
24672467 case bitc::METADATA_SUBPROGRAM: {
2468 if (Record.size() != 18 && Record.size() != 19)
2468 if (Record.size() < 18 || Record.size() > 20)
24692469 return error("Invalid record");
24702470
24712471 IsDistinct =
24732473 // Version 1 has a Function as Record[15].
24742474 // Version 2 has removed Record[15].
24752475 // Version 3 has the Unit as Record[15].
2476 // Version 4 added thisAdjustment.
24762477 bool HasUnit = Record[0] >= 2;
2477 if (HasUnit && Record.size() != 19)
2478 if (HasUnit && Record.size() < 19)
24782479 return error("Invalid record");
24792480 Metadata *CUorFn = getMDOrNull(Record[15]);
2480 unsigned Offset = Record.size() == 19 ? 1 : 0;
2481 unsigned Offset = Record.size() >= 19 ? 1 : 0;
24812482 bool HasFn = Offset && !HasUnit;
2483 bool HasThisAdj = Record.size() >= 20;
24822484 DISubprogram *SP = GET_OR_DISTINCT(
2483 DISubprogram,
2484 (Context, getDITypeRefOrNull(Record[1]), getMDString(Record[2]),
2485 getMDString(Record[3]), getMDOrNull(Record[4]), Record[5],
2486 getMDOrNull(Record[6]), Record[7], Record[8], Record[9],
2487 getDITypeRefOrNull(Record[10]), Record[11], Record[12], Record[13],
2488 Record[14], HasUnit ? CUorFn : nullptr,
2489 getMDOrNull(Record[15 + Offset]), getMDOrNull(Record[16 + Offset]),
2490 getMDOrNull(Record[17 + Offset])));
2485 DISubprogram, (Context,
2486 getDITypeRefOrNull(Record[1]), // scope
2487 getMDString(Record[2]), // name
2488 getMDString(Record[3]), // linkageName
2489 getMDOrNull(Record[4]), // file
2490 Record[5], // line
2491 getMDOrNull(Record[6]), // type
2492 Record[7], // isLocal
2493 Record[8], // isDefinition
2494 Record[9], // scopeLine
2495 getDITypeRefOrNull(Record[10]), // containingType
2496 Record[11], // virtuality
2497 Record[12], // virtualIndex
2498 HasThisAdj ? Record[19] : 0, // thisAdjustment
2499 Record[13], // flags
2500 Record[14], // isOptimized
2501 HasUnit ? CUorFn : nullptr, // unit
2502 getMDOrNull(Record[15 + Offset]), // templateParams
2503 getMDOrNull(Record[16 + Offset]), // declaration
2504 getMDOrNull(Record[17 + Offset]) // variables
2505 ));
24912506 MetadataList.assignValue(SP, NextMetadataNo++);
24922507
24932508 // Upgrade sp->function mapping to function->sp mapping.
15421542 Record.push_back(VE.getMetadataOrNullID(N->getTemplateParams().get()));
15431543 Record.push_back(VE.getMetadataOrNullID(N->getDeclaration()));
15441544 Record.push_back(VE.getMetadataOrNullID(N->getVariables().get()));
1545 Record.push_back(N->getThisAdjustment());
15451546
15461547 Stream.EmitRecord(bitc::METADATA_SUBPROGRAM, Record, Abbrev);
15471548 Record.clear();
155155 return getQualifiedName(QualifiedNameComponents, Name);
156156 }
157157
158 struct CodeViewDebug::TypeLoweringScope {
159 TypeLoweringScope(CodeViewDebug &CVD) : CVD(CVD) { ++CVD.TypeEmissionLevel; }
160 ~TypeLoweringScope() {
161 // Don't decrement TypeEmissionLevel until after emitting deferred types, so
162 // inner TypeLoweringScopes don't attempt to emit deferred types.
163 if (CVD.TypeEmissionLevel == 1)
164 CVD.emitDeferredCompleteTypes();
165 --CVD.TypeEmissionLevel;
166 }
167 CodeViewDebug &CVD;
168 };
169
158170 TypeIndex CodeViewDebug::getScopeIndex(const DIScope *Scope) {
159171 // No scope means global scope and that uses the zero index.
160172 if (!Scope || isa(Scope))
212224
213225 TypeIndex CodeViewDebug::getMemberFunctionType(const DISubprogram *SP,
214226 const DICompositeType *Class) {
227 // Always use the method declaration as the key for the function type. The
228 // method declaration contains the this adjustment.
229 if (SP->getDeclaration())
230 SP = SP->getDeclaration();
231 assert(!SP->getDeclaration() && "should use declaration as key");
232
215233 // Key the MemberFunctionRecord into the map as {SP, Class}. It won't collide
216234 // with the MemberFuncIdRecord, which is keyed in as {SP, nullptr}.
217 auto I = TypeIndices.find({SP, nullptr});
235 auto I = TypeIndices.find({SP, Class});
218236 if (I != TypeIndices.end())
219237 return I->second;
220238
221 // FIXME: Get the ThisAdjustment off of SP when it is available.
239 // Make sure complete type info for the class is emitted *after* the member
240 // function type, as the complete class type is likely to reference this
241 // member function type.
242 TypeLoweringScope S(*this);
222243 TypeIndex TI =
223 lowerTypeMemberFunction(SP->getType(), Class, /*ThisAdjustment=*/0);
224
244 lowerTypeMemberFunction(SP->getType(), Class, SP->getThisAdjustment());
225245 return recordTypeIndexForDINode(SP, TI, Class);
226246 }
227247
15811601 return VBPType;
15821602 }
15831603
1584 struct CodeViewDebug::TypeLoweringScope {
1585 TypeLoweringScope(CodeViewDebug &CVD) : CVD(CVD) { ++CVD.TypeEmissionLevel; }
1586 ~TypeLoweringScope() {
1587 // Don't decrement TypeEmissionLevel until after emitting deferred types, so
1588 // inner TypeLoweringScopes don't attempt to emit deferred types.
1589 if (CVD.TypeEmissionLevel == 1)
1590 CVD.emitDeferredCompleteTypes();
1591 --CVD.TypeEmissionLevel;
1592 }
1593 CodeViewDebug &CVD;
1594 };
1595
15961604 TypeIndex CodeViewDebug::getTypeIndex(DITypeRef TypeRef, DITypeRef ClassTyRef) {
15971605 const DIType *Ty = TypeRef.resolve();
15981606 const DIType *ClassTy = ClassTyRef.resolve();
16081616 if (I != TypeIndices.end())
16091617 return I->second;
16101618
1611 TypeIndex TI;
1612 {
1613 TypeLoweringScope S(*this);
1614 TI = lowerType(Ty, ClassTy);
1615 recordTypeIndexForDINode(Ty, TI, ClassTy);
1616 }
1617
1618 return TI;
1619 TypeLoweringScope S(*this);
1620 TypeIndex TI = lowerType(Ty, ClassTy);
1621 return recordTypeIndexForDINode(Ty, TI, ClassTy);
16191622 }
16201623
16211624 TypeIndex CodeViewDebug::getCompleteTypeIndex(DITypeRef TypeRef) {
17191719 if (N->getVirtuality() != dwarf::DW_VIRTUALITY_none ||
17201720 N->getVirtualIndex() != 0)
17211721 Printer.printInt("virtualIndex", N->getVirtualIndex(), false);
1722 Printer.printInt("thisAdjustment", N->getThisAdjustment());
17221723 Printer.printDIFlags("flags", N->getFlags());
17231724 Printer.printBool("isOptimized", N->isOptimized());
17241725 Printer.printMetadata("unit", N->getRawUnit());
666666 auto *Node = getSubprogram(
667667 /* IsDistinct = */ isDefinition, VMContext,
668668 getNonCompileUnitScope(Context), Name, LinkageName, File, LineNo, Ty,
669 isLocalToUnit, isDefinition, ScopeLine, nullptr, 0, 0, Flags, isOptimized,
670 isDefinition ? CUNode : nullptr, TParams, Decl,
669 isLocalToUnit, isDefinition, ScopeLine, nullptr, 0, 0, 0, Flags,
670 isOptimized, isDefinition ? CUNode : nullptr, TParams, Decl,
671671 MDTuple::getTemporary(VMContext, None).release());
672672
673673 if (isDefinition)
684684 return DISubprogram::getTemporary(
685685 VMContext, getNonCompileUnitScope(Context), Name, LinkageName,
686686 File, LineNo, Ty, isLocalToUnit, isDefinition, ScopeLine, nullptr,
687 0, 0, Flags, isOptimized, isDefinition ? CUNode : nullptr, TParams,
688 Decl, nullptr)
687 0, 0, 0, Flags, isOptimized, isDefinition ? CUNode : nullptr,
688 TParams, Decl, nullptr)
689689 .release();
690690 }
691691
693693 DIBuilder::createMethod(DIScope *Context, StringRef Name, StringRef LinkageName,
694694 DIFile *F, unsigned LineNo, DISubroutineType *Ty,
695695 bool isLocalToUnit, bool isDefinition, unsigned VK,
696 unsigned VIndex, DIType *VTableHolder, unsigned Flags,
697 bool isOptimized, DITemplateParameterArray TParams) {
696 unsigned VIndex, int ThisAdjustment,
697 DIType *VTableHolder, unsigned Flags, bool isOptimized,
698 DITemplateParameterArray TParams) {
698699 assert(getNonCompileUnitScope(Context) &&
699700 "Methods should have both a Context and a context that isn't "
700701 "the compile unit.");
702703 auto *SP = getSubprogram(
703704 /* IsDistinct = */ isDefinition, VMContext, cast(Context), Name,
704705 LinkageName, F, LineNo, Ty, isLocalToUnit, isDefinition, LineNo,
705 VTableHolder, VK, VIndex, Flags, isOptimized,
706 VTableHolder, VK, VIndex, ThisAdjustment, Flags, isOptimized,
706707 isDefinition ? CUNode : nullptr, TParams, nullptr, nullptr);
707708
708709 if (isDefinition)
411411 MDString *LinkageName, Metadata *File, unsigned Line, Metadata *Type,
412412 bool IsLocalToUnit, bool IsDefinition, unsigned ScopeLine,
413413 Metadata *ContainingType, unsigned Virtuality, unsigned VirtualIndex,
414 unsigned Flags, bool IsOptimized, Metadata *Unit, Metadata *TemplateParams,
415 Metadata *Declaration, Metadata *Variables, StorageType Storage,
416 bool ShouldCreate) {
414 int ThisAdjustment, unsigned Flags, bool IsOptimized, Metadata *Unit,
415 Metadata *TemplateParams, Metadata *Declaration, Metadata *Variables,
416 StorageType Storage, bool ShouldCreate) {
417417 assert(isCanonical(Name) && "Expected canonical MDString");
418418 assert(isCanonical(LinkageName) && "Expected canonical MDString");
419 DEFINE_GETIMPL_LOOKUP(DISubprogram,
420 (Scope, Name, LinkageName, File, Line, Type,
421 IsLocalToUnit, IsDefinition, ScopeLine, ContainingType,
422 Virtuality, VirtualIndex, Flags, IsOptimized, Unit,
423 TemplateParams, Declaration, Variables));
419 DEFINE_GETIMPL_LOOKUP(
420 DISubprogram,
421 (Scope, Name, LinkageName, File, Line, Type, IsLocalToUnit, IsDefinition,
422 ScopeLine, ContainingType, Virtuality, VirtualIndex, ThisAdjustment,
423 Flags, IsOptimized, Unit, TemplateParams, Declaration, Variables));
424424 Metadata *Ops[] = {File, Scope, Name, Name,
425425 LinkageName, Type, ContainingType, Unit,
426426 TemplateParams, Declaration, Variables};
427 DEFINE_GETIMPL_STORE(DISubprogram,
428 (Line, ScopeLine, Virtuality, VirtualIndex, Flags,
429 IsLocalToUnit, IsDefinition, IsOptimized),
427 DEFINE_GETIMPL_STORE(DISubprogram, (Line, ScopeLine, Virtuality, VirtualIndex,
428 ThisAdjustment, Flags, IsLocalToUnit,
429 IsDefinition, IsOptimized),
430430 Ops);
431431 }
432432
527527 Metadata *ContainingType;
528528 unsigned Virtuality;
529529 unsigned VirtualIndex;
530 int ThisAdjustment;
530531 unsigned Flags;
531532 bool IsOptimized;
532533 Metadata *Unit;
538539 Metadata *File, unsigned Line, Metadata *Type,
539540 bool IsLocalToUnit, bool IsDefinition, unsigned ScopeLine,
540541 Metadata *ContainingType, unsigned Virtuality,
541 unsigned VirtualIndex, unsigned Flags, bool IsOptimized,
542 Metadata *Unit, Metadata *TemplateParams, Metadata *Declaration,
543 Metadata *Variables)
542 unsigned VirtualIndex, int ThisAdjustment, unsigned Flags,
543 bool IsOptimized, Metadata *Unit, Metadata *TemplateParams,
544 Metadata *Declaration, Metadata *Variables)
544545 : Scope(Scope), Name(Name), LinkageName(LinkageName), File(File),
545546 Line(Line), Type(Type), IsLocalToUnit(IsLocalToUnit),
546547 IsDefinition(IsDefinition), ScopeLine(ScopeLine),
547548 ContainingType(ContainingType), Virtuality(Virtuality),
548 VirtualIndex(VirtualIndex), Flags(Flags), IsOptimized(IsOptimized),
549 Unit(Unit), TemplateParams(TemplateParams), Declaration(Declaration),
549 VirtualIndex(VirtualIndex), ThisAdjustment(ThisAdjustment),
550 Flags(Flags), IsOptimized(IsOptimized), Unit(Unit),
551 TemplateParams(TemplateParams), Declaration(Declaration),
550552 Variables(Variables) {}
551553 MDNodeKeyImpl(const DISubprogram *N)
552554 : Scope(N->getRawScope()), Name(N->getRawName()),
555557 IsLocalToUnit(N->isLocalToUnit()), IsDefinition(N->isDefinition()),
556558 ScopeLine(N->getScopeLine()), ContainingType(N->getRawContainingType()),
557559 Virtuality(N->getVirtuality()), VirtualIndex(N->getVirtualIndex()),
558 Flags(N->getFlags()), IsOptimized(N->isOptimized()),
559 Unit(N->getRawUnit()), TemplateParams(N->getRawTemplateParams()),
560 ThisAdjustment(N->getThisAdjustment()), Flags(N->getFlags()),
561 IsOptimized(N->isOptimized()), Unit(N->getRawUnit()),
562 TemplateParams(N->getRawTemplateParams()),
560563 Declaration(N->getRawDeclaration()), Variables(N->getRawVariables()) {}
561564
562565 bool isKeyOf(const DISubprogram *RHS) const {
568571 ScopeLine == RHS->getScopeLine() &&
569572 ContainingType == RHS->getRawContainingType() &&
570573 Virtuality == RHS->getVirtuality() &&
571 VirtualIndex == RHS->getVirtualIndex() && Flags == RHS->getFlags() &&
572 IsOptimized == RHS->isOptimized() && Unit == RHS->getUnit() &&
574 VirtualIndex == RHS->getVirtualIndex() &&
575 ThisAdjustment == RHS->getThisAdjustment() &&
576 Flags == RHS->getFlags() && IsOptimized == RHS->isOptimized() &&
577 Unit == RHS->getUnit() &&
573578 TemplateParams == RHS->getRawTemplateParams() &&
574579 Declaration == RHS->getRawDeclaration() &&
575580 Variables == RHS->getRawVariables();
2727 ; CHECK: !9 = !DISubprogram(scope: null, isLocal: false, isDefinition: false, isOptimized: false)
2828 !9 = !DISubprogram(isDefinition: false)
2929
30 ; CHECK: !10 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1, file: !2, line: 7, type: !3, isLocal: true, isDefinition: true, scopeLine: 8, containingType: !4, virtuality: DW_VIRTUALITY_pure_virtual, virtualIndex: 10, flags: DIFlagPrototyped, isOptimized: true, unit: !8, templateParams: !5, declaration: !9, variables: !6)
30 ; CHECK: !10 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1, file: !2, line: 7, type: !3, isLocal: true, isDefinition: true, scopeLine: 8, containingType: !4, virtuality: DW_VIRTUALITY_pure_virtual, virtualIndex: 10, thisAdjustment: 3, flags: DIFlagPrototyped, isOptimized: true, unit: !8, templateParams: !5, declaration: !9, variables: !6)
3131 !10 = distinct !DISubprogram(name: "foo", linkageName: "_Zfoov", scope: !1,
3232 file: !2, line: 7, type: !3, isLocal: true,
3333 isDefinition: true, scopeLine: 8,
3434 containingType: !4,
3535 virtuality: DW_VIRTUALITY_pure_virtual,
36 virtualIndex: 10, flags: DIFlagPrototyped,
36 virtualIndex: 10, thisAdjustment: 3, flags: DIFlagPrototyped,
3737 isOptimized: true, unit: !8, templateParams: !5,
3838 declaration: !9, variables: !6)
3939
0 ; RUN: llvm-dis < %s.bc | FileCheck %s
1 ; RUN: verify-uselistorder < %s.bc
2
3 ; Test upgrading from bitcode without a this adjustment record. It will fill in
4 ; an implicit zero thisAdjustment, so it will not be present in the output.
5
6 ; CHECK: DISubprogram(name: "f",
7 ; CHECK-NOT: thisAdjustment
8 ; CHECK-SAME: ){{$}}
9
10 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
11 target triple = "x86_64-pc-windows-msvc19.0.23918"
12
13 ; Function Attrs: nounwind uwtable
14 define void @f() !dbg !7 {
15 entry:
16 ret void, !dbg !10
17 }
18
19 !llvm.dbg.cu = !{!0}
20 !llvm.module.flags = !{!4}
21
22 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, emissionKind: FullDebug)
23 !1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
24 !2 = !{}
25 !4 = !{i32 2, !"Debug Info Version", i32 3}
26 !7 = distinct !DISubprogram(name: "f", linkageName: "\01?f@@YAXXZ", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
27 !8 = !DISubroutineType(types: !9)
28 !9 = !{null}
29 !10 = !DILocation(line: 1, column: 11, scope: !7)
0 ; RUN: llc < %s -filetype=obj | llvm-readobj - -codeview | FileCheck %s
1
2 ; C++ source used to generate IR:
3 ; $ cat t.cpp
4 ; struct A {
5 ; virtual int f();
6 ; };
7 ; struct B {
8 ; virtual int g() = 0;
9 ; };
10 ; struct C : A, B {
11 ; int c = 42;
12 ; virtual int g();
13 ; };
14 ; int C::g() { return c; }
15 ; struct D : virtual B {
16 ; int d = 13;
17 ; virtual int g();
18 ; };
19 ; int D::g() { return d; }
20 ; $ clang t.cpp -S -emit-llvm -fstandalone-debug -g -gcodeview -o t.ll
21
22 ; A::f
23 ; CHECK: MemberFunction ({{.*}}) {
24 ; CHECK-NEXT: TypeLeafKind: LF_MFUNCTION (0x1009)
25 ; CHECK-NEXT: ReturnType: int (0x74)
26 ; CHECK-NEXT: ClassType: A ({{.*}})
27 ; CHECK-NEXT: ThisType: A* ({{.*}})
28 ; CHECK-NEXT: CallingConvention: NearC (0x0)
29 ; CHECK-NEXT: FunctionOptions [ (0x0)
30 ; CHECK-NEXT: ]
31 ; CHECK-NEXT: NumParameters: 0
32 ; CHECK-NEXT: ArgListType: () ({{.*}})
33 ; CHECK-NEXT: ThisAdjustment: 0
34 ; CHECK-NEXT: }
35
36 ; A::g
37 ; CHECK: MemberFunction ({{.*}}) {
38 ; CHECK-NEXT: TypeLeafKind: LF_MFUNCTION (0x1009)
39 ; CHECK-NEXT: ReturnType: int (0x74)
40 ; CHECK-NEXT: ClassType: B ({{.*}})
41 ; CHECK-NEXT: ThisType: B* ({{.*}})
42 ; CHECK-NEXT: CallingConvention: NearC (0x0)
43 ; CHECK-NEXT: FunctionOptions [ (0x0)
44 ; CHECK-NEXT: ]
45 ; CHECK-NEXT: NumParameters: 0
46 ; CHECK-NEXT: ArgListType: () ({{.*}})
47 ; CHECK-NEXT: ThisAdjustment: 0
48 ; CHECK-NEXT: }
49
50 ; C::g
51 ; CHECK: MemberFunction ([[C_g:.*]]) {
52 ; CHECK-NEXT: TypeLeafKind: LF_MFUNCTION (0x1009)
53 ; CHECK-NEXT: ReturnType: int (0x74)
54 ; CHECK-NEXT: ClassType: C ({{.*}})
55 ; CHECK-NEXT: ThisType: C* ({{.*}})
56 ; CHECK-NEXT: CallingConvention: NearC (0x0)
57 ; CHECK-NEXT: FunctionOptions [ (0x0)
58 ; CHECK-NEXT: ]
59 ; CHECK-NEXT: NumParameters: 0
60 ; CHECK-NEXT: ArgListType: () ({{.*}})
61 ; CHECK-NEXT: ThisAdjustment: 8
62 ; CHECK-NEXT: }
63
64 ; CHECK: FieldList ({{.*}}) {
65 ; CHECK: OneMethod {
66 ; CHECK-NEXT: AccessSpecifier: Public (0x3)
67 ; CHECK-NEXT: MethodKind: Virtual (0x1)
68 ; CHECK-NEXT: Type: int C::() ([[C_g]])
69 ; CHECK-NEXT: Name: g
70 ; CHECK-NEXT: }
71 ; CHECK-NEXT: }
72
73 ; D::g
74 ; CHECK: MemberFunction ([[D_g:.*]]) {
75 ; CHECK-NEXT: TypeLeafKind: LF_MFUNCTION (0x1009)
76 ; CHECK-NEXT: ReturnType: int (0x74)
77 ; CHECK-NEXT: ClassType: D ({{.*}})
78 ; CHECK-NEXT: ThisType: D* ({{.*}})
79 ; CHECK-NEXT: CallingConvention: NearC (0x0)
80 ; CHECK-NEXT: FunctionOptions [ (0x0)
81 ; CHECK-NEXT: ]
82 ; CHECK-NEXT: NumParameters: 0
83 ; CHECK-NEXT: ArgListType: () ({{.*}})
84 ; CHECK-NEXT: ThisAdjustment: 16
85 ; CHECK-NEXT: }
86
87 ; CHECK: FieldList ({{.*}}) {
88 ; CHECK: OneMethod {
89 ; CHECK-NEXT: AccessSpecifier: Public (0x3)
90 ; CHECK-NEXT: MethodKind: Virtual (0x1)
91 ; CHECK-NEXT: Type: int D::() ([[D_g]])
92 ; CHECK-NEXT: Name: g
93 ; CHECK-NEXT: }
94 ; CHECK-NEXT: }
95
96 ; Need to skip constructor IDs...
97 ; CHECK: MemberFuncId ({{.*}}) {
98 ; CHECK: TypeLeafKind: LF_MFUNC_ID (0x1602)
99 ; CHECK: ClassType: A
100 ; CHECK: FunctionType: void A::()
101 ; CHECK: Name: A
102 ; CHECK: }
103 ; CHECK: MemberFuncId ({{.*}}) {
104 ; CHECK: TypeLeafKind: LF_MFUNC_ID (0x1602)
105 ; CHECK: ClassType: B
106 ; CHECK: FunctionType: void B::()
107 ; CHECK: Name: B
108 ; CHECK: }
109 ; CHECK: MemberFuncId ({{.*}}) {
110 ; CHECK: TypeLeafKind: LF_MFUNC_ID (0x1602)
111 ; CHECK: ClassType: C
112 ; CHECK: FunctionType: void C::()
113 ; CHECK: Name: C
114 ; CHECK: }
115 ; CHECK: MemberFuncId ({{.*}}) {
116 ; CHECK: TypeLeafKind: LF_MFUNC_ID (0x1602)
117 ; CHECK: ClassType: D
118 ; CHECK: FunctionType: void D::()
119 ; CHECK: Name: D
120 ; CHECK: }
121
122 ; CHECK: MemberFuncId ({{.*}}) {
123 ; CHECK-NEXT: TypeLeafKind: LF_MFUNC_ID (0x1602)
124 ; CHECK-NEXT: ClassType: C ({{.*}})
125 ; CHECK-NEXT: FunctionType: int C::() ([[C_g]])
126 ; CHECK-NEXT: Name: g
127 ; CHECK-NEXT: }
128
129 ; CHECK: MemberFuncId ({{.*}}) {
130 ; CHECK-NEXT: TypeLeafKind: LF_MFUNC_ID (0x1602)
131 ; CHECK-NEXT: ClassType: D ({{.*}})
132 ; CHECK-NEXT: FunctionType: int D::() ([[D_g]])
133 ; CHECK-NEXT: Name: g
134 ; CHECK-NEXT: }
135
136 ; ModuleID = 't.cpp'
137 source_filename = "t.cpp"
138 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
139 target triple = "x86_64-pc-windows-msvc19.0.23918"
140
141 %struct.A = type { i32 (...)** }
142 %struct.B = type { i32 (...)** }
143 %struct.C = type { %struct.A, %struct.B, i32 }
144 %struct.D = type { i32*, i32, %struct.B }
145
146 $"\01??0A@@QEAA@XZ" = comdat any
147
148 $"\01??0B@@QEAA@XZ" = comdat any
149
150 $"\01??0C@@QEAA@XZ" = comdat any
151
152 $"\01??0D@@QEAA@XZ" = comdat any
153
154 $"\01?g@C@@UEAAHXZ" = comdat any
155
156 $"\01?g@D@@UEAAHXZ" = comdat any
157
158 $"\01??_7A@@6B@" = comdat any
159
160 $"\01??_7B@@6B@" = comdat any
161
162 $"\01??_7C@@6BA@@@" = comdat any
163
164 $"\01??_7C@@6BB@@@" = comdat any
165
166 $"\01??_8D@@7B@" = comdat any
167
168 $"\01??_7D@@6B@" = comdat any
169
170 @"\01??_7A@@6B@" = linkonce_odr unnamed_addr constant [1 x i8*] [i8* bitcast (i32 (%struct.A*)* @"\01?f@A@@UEAAHXZ" to i8*)], comdat
171 @"\01??_7B@@6B@" = linkonce_odr unnamed_addr constant [1 x i8*] [i8* bitcast (i32 (%struct.B*)* @"\01?g@B@@UEAAHXZ" to i8*)], comdat
172 @"\01??_7C@@6BA@@@" = linkonce_odr unnamed_addr constant [1 x i8*] [i8* bitcast (i32 (%struct.A*)* @"\01?f@A@@UEAAHXZ" to i8*)], comdat
173 @"\01??_7C@@6BB@@@" = linkonce_odr unnamed_addr constant [1 x i8*] [i8* bitcast (i32 (i8*)* @"\01?g@C@@UEAAHXZ" to i8*)], comdat
174 @"\01??_8D@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 0, i32 16], comdat
175 @"\01??_7D@@6B@" = linkonce_odr unnamed_addr constant [1 x i8*] [i8* bitcast (i32 (i8*)* @"\01?g@D@@UEAAHXZ" to i8*)], comdat
176
177 ; Function Attrs: uwtable
178 define void @"\01?usetypes@@YAXXZ"() #0 !dbg !7 {
179 entry:
180 %a = alloca %struct.A, align 8
181 %b = alloca %struct.B, align 8
182 %c = alloca %struct.C, align 8
183 %d = alloca %struct.D, align 8
184 call void @llvm.dbg.declare(metadata %struct.A* %a, metadata !10, metadata !23), !dbg !24
185 %call = call %struct.A* @"\01??0A@@QEAA@XZ"(%struct.A* %a) #5, !dbg !24
186 call void @llvm.dbg.declare(metadata %struct.B* %b, metadata !25, metadata !23), !dbg !33
187 %call1 = call %struct.B* @"\01??0B@@QEAA@XZ"(%struct.B* %b) #5, !dbg !33
188 call void @llvm.dbg.declare(metadata %struct.C* %c, metadata !34, metadata !23), !dbg !44
189 %call2 = call %struct.C* @"\01??0C@@QEAA@XZ"(%struct.C* %c) #5, !dbg !44
190 call void @llvm.dbg.declare(metadata %struct.D* %d, metadata !45, metadata !23), !dbg !55
191 %call3 = call %struct.D* @"\01??0D@@QEAA@XZ"(%struct.D* %d, i32 1) #5, !dbg !55
192 %0 = bitcast %struct.C* %c to i8*, !dbg !56
193 %1 = getelementptr i8, i8* %0, i64 8, !dbg !56
194 %call4 = call i32 @"\01?g@C@@UEAAHXZ"(i8* %1), !dbg !56
195 ret void, !dbg !57
196 }
197
198 ; Function Attrs: nounwind readnone
199 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
200
201 ; Function Attrs: inlinehint nounwind uwtable
202 define linkonce_odr %struct.A* @"\01??0A@@QEAA@XZ"(%struct.A* returned %this) unnamed_addr #2 comdat align 2 !dbg !58 {
203 entry:
204 %this.addr = alloca %struct.A*, align 8
205 store %struct.A* %this, %struct.A** %this.addr, align 8
206 call void @llvm.dbg.declare(metadata %struct.A** %this.addr, metadata !62, metadata !23), !dbg !64
207 %this1 = load %struct.A*, %struct.A** %this.addr, align 8
208 %0 = bitcast %struct.A* %this1 to i32 (...)***, !dbg !65
209 store i32 (...)** bitcast ([1 x i8*]* @"\01??_7A@@6B@" to i32 (...)**), i32 (...)*** %0, align 8, !dbg !65
210 ret %struct.A* %this1, !dbg !65
211 }
212
213 ; Function Attrs: inlinehint nounwind uwtable
214 define linkonce_odr %struct.B* @"\01??0B@@QEAA@XZ"(%struct.B* returned %this) unnamed_addr #2 comdat align 2 !dbg !66 {
215 entry:
216 %this.addr = alloca %struct.B*, align 8
217 store %struct.B* %this, %struct.B** %this.addr, align 8
218 call void @llvm.dbg.declare(metadata %struct.B** %this.addr, metadata !70, metadata !23), !dbg !72
219 %this1 = load %struct.B*, %struct.B** %this.addr, align 8
220 %0 = bitcast %struct.B* %this1 to i32 (...)***, !dbg !73
221 store i32 (...)** bitcast ([1 x i8*]* @"\01??_7B@@6B@" to i32 (...)**), i32 (...)*** %0, align 8, !dbg !73
222 ret %struct.B* %this1, !dbg !73
223 }
224
225 ; Function Attrs: inlinehint nounwind uwtable
226 define linkonce_odr %struct.C* @"\01??0C@@QEAA@XZ"(%struct.C* returned %this) unnamed_addr #2 comdat align 2 !dbg !74 {
227 entry:
228 %this.addr = alloca %struct.C*, align 8
229 store %struct.C* %this, %struct.C** %this.addr, align 8
230 call void @llvm.dbg.declare(metadata %struct.C** %this.addr, metadata !78, metadata !23), !dbg !80
231 %this1 = load %struct.C*, %struct.C** %this.addr, align 8
232 %0 = bitcast %struct.C* %this1 to %struct.A*, !dbg !81
233 %call = call %struct.A* @"\01??0A@@QEAA@XZ"(%struct.A* %0) #5, !dbg !81
234 %1 = bitcast %struct.C* %this1 to i8*, !dbg !81
235 %2 = getelementptr inbounds i8, i8* %1, i64 8, !dbg !81
236 %3 = bitcast i8* %2 to %struct.B*, !dbg !81
237 %call2 = call %struct.B* @"\01??0B@@QEAA@XZ"(%struct.B* %3) #5, !dbg !81
238 %4 = bitcast %struct.C* %this1 to i32 (...)***, !dbg !81
239 store i32 (...)** bitcast ([1 x i8*]* @"\01??_7C@@6BA@@@" to i32 (...)**), i32 (...)*** %4, align 8, !dbg !81
240 %5 = bitcast %struct.C* %this1 to i8*, !dbg !81
241 %add.ptr = getelementptr inbounds i8, i8* %5, i64 8, !dbg !81
242 %6 = bitcast i8* %add.ptr to i32 (...)***, !dbg !81
243 store i32 (...)** bitcast ([1 x i8*]* @"\01??_7C@@6BB@@@" to i32 (...)**), i32 (...)*** %6, align 8, !dbg !81
244 %c = getelementptr inbounds %struct.C, %struct.C* %this1, i32 0, i32 2, !dbg !82
245 store i32 42, i32* %c, align 8, !dbg !82
246 ret %struct.C* %this1, !dbg !81
247 }
248
249 ; Function Attrs: inlinehint nounwind uwtable
250 define linkonce_odr %struct.D* @"\01??0D@@QEAA@XZ"(%struct.D* returned %this, i32 %is_most_derived) unnamed_addr #2 comdat align 2 !dbg !83 {
251 entry:
252 %retval = alloca %struct.D*, align 8
253 %is_most_derived.addr = alloca i32, align 4
254 %this.addr = alloca %struct.D*, align 8
255 store i32 %is_most_derived, i32* %is_most_derived.addr, align 4
256 call void @llvm.dbg.declare(metadata i32* %is_most_derived.addr, metadata !87, metadata !23), !dbg !88
257 store %struct.D* %this, %struct.D** %this.addr, align 8
258 call void @llvm.dbg.declare(metadata %struct.D** %this.addr, metadata !89, metadata !23), !dbg !88
259 %this1 = load %struct.D*, %struct.D** %this.addr, align 8
260 store %struct.D* %this1, %struct.D** %retval, align 8
261 %is_most_derived2 = load i32, i32* %is_most_derived.addr, align 4
262 %is_complete_object = icmp ne i32 %is_most_derived2, 0, !dbg !91
263 br i1 %is_complete_object, label %ctor.init_vbases, label %ctor.skip_vbases, !dbg !91
264
265 ctor.init_vbases: ; preds = %entry
266 %this.int8 = bitcast %struct.D* %this1 to i8*, !dbg !91
267 %0 = getelementptr inbounds i8, i8* %this.int8, i64 0, !dbg !91
268 %vbptr.D = bitcast i8* %0 to i32**, !dbg !91
269 store i32* getelementptr inbounds ([2 x i32], [2 x i32]* @"\01??_8D@@7B@", i32 0, i32 0), i32** %vbptr.D, align 8, !dbg !91
270 %1 = bitcast %struct.D* %this1 to i8*, !dbg !91
271 %2 = getelementptr inbounds i8, i8* %1, i64 16, !dbg !91
272 %3 = bitcast i8* %2 to %struct.B*, !dbg !91
273 %call = call %struct.B* @"\01??0B@@QEAA@XZ"(%struct.B* %3) #5, !dbg !91
274 br label %ctor.skip_vbases, !dbg !91
275
276 ctor.skip_vbases: ; preds = %ctor.init_vbases, %entry
277 %4 = bitcast %struct.D* %this1 to i8*, !dbg !91
278 %vbptr = getelementptr inbounds i8, i8* %4, i64 0, !dbg !91
279 %5 = bitcast i8* %vbptr to i32**, !dbg !91
280 %vbtable = load i32*, i32** %5, align 8, !dbg !91
281 %6 = getelementptr inbounds i32, i32* %vbtable, i32 1, !dbg !91
282 %vbase_offs = load i32, i32* %6, align 4, !dbg !91
283 %7 = sext i32 %vbase_offs to i64, !dbg !91
284 %8 = add nsw i64 0, %7, !dbg !91
285 %9 = bitcast %struct.D* %this1 to i8*, !dbg !91
286 %add.ptr = getelementptr inbounds i8, i8* %9, i64 %8, !dbg !91
287 %10 = bitcast i8* %add.ptr to i32 (...)***, !dbg !91
288 store i32 (...)** bitcast ([1 x i8*]* @"\01??_7D@@6B@" to i32 (...)**), i32 (...)*** %10, align 8, !dbg !91
289 %d = getelementptr inbounds %struct.D, %struct.D* %this1, i32 0, i32 1, !dbg !92
290 store i32 13, i32* %d, align 8, !dbg !92
291 %11 = load %struct.D*, %struct.D** %retval, align 8, !dbg !91
292 ret %struct.D* %11, !dbg !91
293 }
294
295 ; Function Attrs: nounwind uwtable
296 define linkonce_odr i32 @"\01?g@C@@UEAAHXZ"(i8*) unnamed_addr #3 comdat align 2 !dbg !93 {
297 entry:
298 %this.addr = alloca %struct.C*, align 8
299 %1 = getelementptr inbounds i8, i8* %0, i32 -8
300 %this = bitcast i8* %1 to %struct.C*
301 store %struct.C* %this, %struct.C** %this.addr, align 8
302 call void @llvm.dbg.declare(metadata %struct.C** %this.addr, metadata !94, metadata !23), !dbg !95
303 %this1 = load %struct.C*, %struct.C** %this.addr, align 8
304 %c = getelementptr inbounds %struct.C, %struct.C* %this1, i32 0, i32 2, !dbg !96
305 %2 = load i32, i32* %c, align 8, !dbg !96
306 ret i32 %2, !dbg !97
307 }
308
309 declare i32 @"\01?f@A@@UEAAHXZ"(%struct.A*) unnamed_addr #4
310
311 declare i32 @"\01?g@B@@UEAAHXZ"(%struct.B*) unnamed_addr #4
312
313 ; Function Attrs: nounwind uwtable
314 define linkonce_odr i32 @"\01?g@D@@UEAAHXZ"(i8*) unnamed_addr #3 comdat align 2 !dbg !98 {
315 entry:
316 %this.addr = alloca %struct.D*, align 8
317 %1 = getelementptr inbounds i8, i8* %0, i32 -16
318 %this = bitcast i8* %1 to %struct.D*
319 store %struct.D* %this, %struct.D** %this.addr, align 8
320 call void @llvm.dbg.declare(metadata %struct.D** %this.addr, metadata !99, metadata !23), !dbg !100
321 %this1 = load %struct.D*, %struct.D** %this.addr, align 8
322 %d = getelementptr inbounds %struct.D, %struct.D* %this1, i32 0, i32 1, !dbg !101
323 %2 = load i32, i32* %d, align 8, !dbg !101
324 ret i32 %2, !dbg !102
325 }
326
327 attributes #0 = { uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
328 attributes #1 = { nounwind readnone }
329 attributes #2 = { inlinehint nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
330 attributes #3 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
331 attributes #4 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
332 attributes #5 = { nounwind }
333
334 !llvm.dbg.cu = !{!0}
335 !llvm.module.flags = !{!3, !4, !5}
336 !llvm.ident = !{!6}
337
338 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
339 !1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
340 !2 = !{}
341 !3 = !{i32 2, !"CodeView", i32 1}
342 !4 = !{i32 2, !"Debug Info Version", i32 3}
343 !5 = !{i32 1, !"PIC Level", i32 2}
344 !6 = !{!"clang version 3.9.0 "}
345 !7 = distinct !DISubprogram(name: "usetypes", linkageName: "\01?usetypes@@YAXXZ", scope: !1, file: !1, line: 15, type: !8, isLocal: false, isDefinition: true, scopeLine: 15, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
346 !8 = !DISubroutineType(types: !9)
347 !9 = !{null}
348 !10 = !DILocalVariable(name: "a", scope: !7, file: !1, line: 16, type: !11)
349 !11 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !1, line: 1, size: 64, align: 64, elements: !12, vtableHolder: !11, identifier: ".?AUA@@")
350 !12 = !{!13, !19}
351 !13 = !DIDerivedType(tag: DW_TAG_member, name: "_vptr$A", scope: !1, file: !1, baseType: !14, size: 64, flags: DIFlagArtificial)
352 !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !15, size: 64)
353 !15 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "__vtbl_ptr_type", baseType: !16, size: 64)
354 !16 = !DISubroutineType(types: !17)
355 !17 = !{!18}
356 !18 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
357 !19 = !DISubprogram(name: "f", linkageName: "\01?f@A@@UEAAHXZ", scope: !11, file: !1, line: 2, type: !20, isLocal: false, isDefinition: false, scopeLine: 2, containingType: !11, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 0, flags: DIFlagPrototyped | DIFlagIntroducedVirtual, isOptimized: false)
358 !20 = !DISubroutineType(types: !21)
359 !21 = !{!18, !22}
360 !22 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !11, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
361 !23 = !DIExpression()
362 !24 = !DILocation(line: 16, column: 5, scope: !7)
363 !25 = !DILocalVariable(name: "b", scope: !7, file: !1, line: 17, type: !26)
364 !26 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "B", file: !1, line: 4, size: 64, align: 64, elements: !27, vtableHolder: !26, identifier: ".?AUB@@")
365 !27 = !{!28, !29}
366 !28 = !DIDerivedType(tag: DW_TAG_member, name: "_vptr$B", scope: !1, file: !1, baseType: !14, size: 64, flags: DIFlagArtificial)
367 !29 = !DISubprogram(name: "g", linkageName: "\01?g@B@@UEAAHXZ", scope: !26, file: !1, line: 5, type: !30, isLocal: false, isDefinition: false, scopeLine: 5, containingType: !26, virtuality: DW_VIRTUALITY_pure_virtual, virtualIndex: 0, flags: DIFlagPrototyped | DIFlagIntroducedVirtual, isOptimized: false)
368 !30 = !DISubroutineType(types: !31)
369 !31 = !{!18, !32}
370 !32 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !26, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
371 !33 = !DILocation(line: 17, column: 5, scope: !7)
372 !34 = !DILocalVariable(name: "c", scope: !7, file: !1, line: 18, type: !35)
373 !35 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "C", file: !1, line: 7, size: 192, align: 64, elements: !36, vtableHolder: !11, identifier: ".?AUC@@")
374 !36 = !{!37, !38, !39, !40}
375 !37 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !35, baseType: !11)
376 !38 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !35, baseType: !26, offset: 64)
377 !39 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !35, file: !1, line: 8, baseType: !18, size: 32, align: 32, offset: 128)
378 !40 = !DISubprogram(name: "g", linkageName: "\01?g@C@@UEAAHXZ", scope: !35, file: !1, line: 9, type: !41, isLocal: false, isDefinition: false, scopeLine: 9, containingType: !35, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 0, thisAdjustment: 8, flags: DIFlagPrototyped, isOptimized: false)
379 !41 = !DISubroutineType(types: !42)
380 !42 = !{!18, !43}
381 !43 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !35, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
382 !44 = !DILocation(line: 18, column: 5, scope: !7)
383 !45 = !DILocalVariable(name: "d", scope: !7, file: !1, line: 19, type: !46)
384 !46 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "D", file: !1, line: 11, size: 192, align: 64, elements: !47, vtableHolder: !46, identifier: ".?AUD@@")
385 !47 = !{!48, !49, !50, !51}
386 !48 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !46, baseType: !26, offset: 4, flags: DIFlagVirtual)
387 !49 = !DIDerivedType(tag: DW_TAG_member, name: "_vptr$D", scope: !1, file: !1, baseType: !14, size: 64, flags: DIFlagArtificial)
388 !50 = !DIDerivedType(tag: DW_TAG_member, name: "d", scope: !46, file: !1, line: 12, baseType: !18, size: 32, align: 32, offset: 64)
389 !51 = !DISubprogram(name: "g", linkageName: "\01?g@D@@UEAAHXZ", scope: !46, file: !1, line: 13, type: !52, isLocal: false, isDefinition: false, scopeLine: 13, containingType: !46, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 0, thisAdjustment: 16, flags: DIFlagPrototyped, isOptimized: false)
390 !52 = !DISubroutineType(types: !53)
391 !53 = !{!18, !54}
392 !54 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !46, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
393 !55 = !DILocation(line: 19, column: 5, scope: !7)
394 !56 = !DILocation(line: 20, column: 5, scope: !7)
395 !57 = !DILocation(line: 21, column: 1, scope: !7)
396 !58 = distinct !DISubprogram(name: "A", linkageName: "\01??0A@@QEAA@XZ", scope: !11, file: !1, line: 1, type: !59, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, unit: !0, declaration: !61, variables: !2)
397 !59 = !DISubroutineType(types: !60)
398 !60 = !{null, !22}
399 !61 = !DISubprogram(name: "A", scope: !11, type: !59, isLocal: false, isDefinition: false, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false)
400 !62 = !DILocalVariable(name: "this", arg: 1, scope: !58, type: !63, flags: DIFlagArtificial | DIFlagObjectPointer)
401 !63 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !11, size: 64, align: 64)
402 !64 = !DILocation(line: 0, scope: !58)
403 !65 = !DILocation(line: 1, column: 8, scope: !58)
404 !66 = distinct !DISubprogram(name: "B", linkageName: "\01??0B@@QEAA@XZ", scope: !26, file: !1, line: 4, type: !67, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, unit: !0, declaration: !69, variables: !2)
405 !67 = !DISubroutineType(types: !68)
406 !68 = !{null, !32}
407 !69 = !DISubprogram(name: "B", scope: !26, type: !67, isLocal: false, isDefinition: false, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false)
408 !70 = !DILocalVariable(name: "this", arg: 1, scope: !66, type: !71, flags: DIFlagArtificial | DIFlagObjectPointer)
409 !71 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !26, size: 64, align: 64)
410 !72 = !DILocation(line: 0, scope: !66)
411 !73 = !DILocation(line: 4, column: 8, scope: !66)
412 !74 = distinct !DISubprogram(name: "C", linkageName: "\01??0C@@QEAA@XZ", scope: !35, file: !1, line: 7, type: !75, isLocal: false, isDefinition: true, scopeLine: 7, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, unit: !0, declaration: !77, variables: !2)
413 !75 = !DISubroutineType(types: !76)
414 !76 = !{null, !43}
415 !77 = !DISubprogram(name: "C", scope: !35, type: !75, isLocal: false, isDefinition: false, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false)
416 !78 = !DILocalVariable(name: "this", arg: 1, scope: !74, type: !79, flags: DIFlagArtificial | DIFlagObjectPointer)
417 !79 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !35, size: 64, align: 64)
418 !80 = !DILocation(line: 0, scope: !74)
419 !81 = !DILocation(line: 7, column: 8, scope: !74)
420 !82 = !DILocation(line: 8, column: 7, scope: !74)
421 !83 = distinct !DISubprogram(name: "D", linkageName: "\01??0D@@QEAA@XZ", scope: !46, file: !1, line: 11, type: !84, isLocal: false, isDefinition: true, scopeLine: 11, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, unit: !0, declaration: !86, variables: !2)
422 !84 = !DISubroutineType(types: !85)
423 !85 = !{null, !54}
424 !86 = !DISubprogram(name: "D", scope: !46, type: !84, isLocal: false, isDefinition: false, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false)
425 !87 = !DILocalVariable(name: "is_most_derived", arg: 2, scope: !83, type: !18, flags: DIFlagArtificial)
426 !88 = !DILocation(line: 0, scope: !83)
427 !89 = !DILocalVariable(name: "this", arg: 1, scope: !83, type: !90, flags: DIFlagArtificial | DIFlagObjectPointer)
428 !90 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !46, size: 64, align: 64)
429 !91 = !DILocation(line: 11, column: 8, scope: !83)
430 !92 = !DILocation(line: 12, column: 7, scope: !83)
431 !93 = distinct !DISubprogram(name: "g", linkageName: "\01?g@C@@UEAAHXZ", scope: !35, file: !1, line: 9, type: !41, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: false, unit: !0, declaration: !40, variables: !2)
432 !94 = !DILocalVariable(name: "this", arg: 1, scope: !93, type: !79, flags: DIFlagArtificial | DIFlagObjectPointer)
433 !95 = !DILocation(line: 0, scope: !93)
434 !96 = !DILocation(line: 9, column: 28, scope: !93)
435 !97 = !DILocation(line: 9, column: 21, scope: !93)
436 !98 = distinct !DISubprogram(name: "g", linkageName: "\01?g@D@@UEAAHXZ", scope: !46, file: !1, line: 13, type: !52, isLocal: false, isDefinition: true, scopeLine: 13, flags: DIFlagPrototyped, isOptimized: false, unit: !0, declaration: !51, variables: !2)
437 !99 = !DILocalVariable(name: "this", arg: 1, scope: !98, type: !90, flags: DIFlagArtificial | DIFlagObjectPointer)
438 !100 = !DILocation(line: 0, scope: !98)
439 !101 = !DILocation(line: 13, column: 28, scope: !98)
440 !102 = !DILocation(line: 13, column: 21, scope: !98)
8484 DISubprogram *getSubprogram() {
8585 return DISubprogram::getDistinct(Context, nullptr, "", "", nullptr, 0,
8686 nullptr, false, false, 0, nullptr,
87 0, 0, 0, false, nullptr);
87 0, 0, 0, 0, false, nullptr);
8888 }
8989 DIFile *getFile() {
9090 return DIFile::getDistinct(Context, "file.c", "/path/to/dir");
14211421 DIType *ContainingType = getCompositeType();
14221422 unsigned Virtuality = 2;
14231423 unsigned VirtualIndex = 5;
1424 int ThisAdjustment = -3;
14241425 unsigned Flags = 6;
14251426 unsigned NotFlags = (~Flags) & ((1 << 27) - 1);
14261427 bool IsOptimized = false;
14291430 MDTuple *Variables = getTuple();
14301431 DICompileUnit *Unit = getUnit();
14311432
1432 auto *N = DISubprogram::get(
1433 Context, Scope, Name, LinkageName, File, Line, Type, IsLocalToUnit,
1434 IsDefinition, ScopeLine, ContainingType, Virtuality, VirtualIndex, Flags,
1435 IsOptimized, Unit, TemplateParams, Declaration, Variables);
1433 auto *N = DISubprogram::get(Context, Scope, Name, LinkageName, File, Line,
1434 Type, IsLocalToUnit, IsDefinition, ScopeLine,
1435 ContainingType, Virtuality, VirtualIndex,
1436 ThisAdjustment, Flags, IsOptimized, Unit,
1437 TemplateParams, Declaration, Variables);
14361438
14371439 EXPECT_EQ(dwarf::DW_TAG_subprogram, N->getTag());
14381440 EXPECT_EQ(Scope, N->getScope());
14471449 EXPECT_EQ(ContainingType, N->getContainingType());
14481450 EXPECT_EQ(Virtuality, N->getVirtuality());
14491451 EXPECT_EQ(VirtualIndex, N->getVirtualIndex());
1452 EXPECT_EQ(ThisAdjustment, N->getThisAdjustment());
14501453 EXPECT_EQ(Flags, N->getFlags());
14511454 EXPECT_EQ(IsOptimized, N->isOptimized());
14521455 EXPECT_EQ(Unit, N->getUnit());
14561459 EXPECT_EQ(N, DISubprogram::get(Context, Scope, Name, LinkageName, File, Line,
14571460 Type, IsLocalToUnit, IsDefinition, ScopeLine,
14581461 ContainingType, Virtuality, VirtualIndex,
1459 Flags, IsOptimized, Unit, TemplateParams,
1460 Declaration, Variables));
1461
1462 EXPECT_NE(N, DISubprogram::get(Context, getCompositeType(), Name, LinkageName,
1463 File, Line, Type, IsLocalToUnit, IsDefinition,
1464 ScopeLine, ContainingType, Virtuality,
1465 VirtualIndex, Flags, IsOptimized, Unit,
1462 ThisAdjustment, Flags, IsOptimized, Unit,
14661463 TemplateParams, Declaration, Variables));
1467 EXPECT_NE(N, DISubprogram::get(Context, Scope, "other", LinkageName, File,
1468 Line, Type, IsLocalToUnit, IsDefinition,
1469 ScopeLine, ContainingType, Virtuality,
1470 VirtualIndex, Flags, IsOptimized, Unit,
1471 TemplateParams, Declaration, Variables));
1464
1465 EXPECT_NE(N, DISubprogram::get(
1466 Context, getCompositeType(), Name, LinkageName, File, Line,
1467 Type, IsLocalToUnit, IsDefinition, ScopeLine, ContainingType,
1468 Virtuality, VirtualIndex, ThisAdjustment, Flags, IsOptimized,
1469 Unit, TemplateParams, Declaration, Variables));
1470 EXPECT_NE(N, DISubprogram::get(
1471 Context, Scope, "other", LinkageName, File, Line, Type,
1472 IsLocalToUnit, IsDefinition, ScopeLine, ContainingType,
1473 Virtuality, VirtualIndex, ThisAdjustment, Flags, IsOptimized,
1474 Unit, TemplateParams, Declaration, Variables));
14721475 EXPECT_NE(N, DISubprogram::get(Context, Scope, Name, "other", File, Line,
14731476 Type, IsLocalToUnit, IsDefinition, ScopeLine,
14741477 ContainingType, Virtuality, VirtualIndex,
1475 Flags, IsOptimized, Unit, TemplateParams,
1476 Declaration, Variables));
1477 EXPECT_NE(N, DISubprogram::get(Context, Scope, Name, LinkageName, getFile(),
1478 Line, Type, IsLocalToUnit, IsDefinition,
1479 ScopeLine, ContainingType, Virtuality,
1480 VirtualIndex, Flags, IsOptimized, Unit,
1478 ThisAdjustment, Flags, IsOptimized, Unit,
14811479 TemplateParams, Declaration, Variables));
1482 EXPECT_NE(N, DISubprogram::get(Context, Scope, Name, LinkageName, File,
1483 Line + 1, Type, IsLocalToUnit, IsDefinition,
1484 ScopeLine, ContainingType, Virtuality,
1485 VirtualIndex, Flags, IsOptimized, Unit,
1486 TemplateParams, Declaration, Variables));
1487 EXPECT_NE(N, DISubprogram::get(Context, Scope, Name, LinkageName, File, Line,
1488 getSubroutineType(), IsLocalToUnit,
1489 IsDefinition, ScopeLine, ContainingType,
1490 Virtuality, VirtualIndex, Flags, IsOptimized,
1491 Unit, TemplateParams, Declaration, Variables));
1480 EXPECT_NE(N, DISubprogram::get(
1481 Context, Scope, Name, LinkageName, getFile(), Line, Type,
1482 IsLocalToUnit, IsDefinition, ScopeLine, ContainingType,
1483 Virtuality, VirtualIndex, ThisAdjustment, Flags, IsOptimized,
1484 Unit, TemplateParams, Declaration, Variables));
1485 EXPECT_NE(N, DISubprogram::get(
1486 Context, Scope, Name, LinkageName, File, Line + 1, Type,
1487 IsLocalToUnit, IsDefinition, ScopeLine, ContainingType,
1488 Virtuality, VirtualIndex, ThisAdjustment, Flags, IsOptimized,
1489 Unit, TemplateParams, Declaration, Variables));
1490 EXPECT_NE(N,
1491 DISubprogram::get(Context, Scope, Name, LinkageName, File, Line,
1492 getSubroutineType(), IsLocalToUnit, IsDefinition,
1493 ScopeLine, ContainingType, Virtuality,
1494 VirtualIndex, ThisAdjustment, Flags, IsOptimized,
1495 Unit, TemplateParams, Declaration, Variables));
14921496 EXPECT_NE(N, DISubprogram::get(Context, Scope, Name, LinkageName, File, Line,
14931497 Type, !IsLocalToUnit, IsDefinition, ScopeLine,
14941498 ContainingType, Virtuality, VirtualIndex,
1495 Flags, IsOptimized, Unit, TemplateParams,
1496 Declaration, Variables));
1499 ThisAdjustment, Flags, IsOptimized, Unit,
1500 TemplateParams, Declaration, Variables));
14971501 EXPECT_NE(N, DISubprogram::get(Context, Scope, Name, LinkageName, File, Line,
14981502 Type, IsLocalToUnit, !IsDefinition, ScopeLine,
14991503 ContainingType, Virtuality, VirtualIndex,
1500 Flags, IsOptimized, Unit, TemplateParams,
1501 Declaration, Variables));
1504 ThisAdjustment, Flags, IsOptimized, Unit,
1505 TemplateParams, Declaration, Variables));
1506 EXPECT_NE(N, DISubprogram::get(
1507 Context, Scope, Name, LinkageName, File, Line, Type,
1508 IsLocalToUnit, IsDefinition, ScopeLine + 1, ContainingType,
1509 Virtuality, VirtualIndex, ThisAdjustment, Flags, IsOptimized,
1510 Unit, TemplateParams, Declaration, Variables));
15021511 EXPECT_NE(N, DISubprogram::get(Context, Scope, Name, LinkageName, File, Line,
1503 Type, IsLocalToUnit, IsDefinition,
1504 ScopeLine + 1, ContainingType, Virtuality,
1505 VirtualIndex, Flags, IsOptimized, Unit,
1512 Type, IsLocalToUnit, IsDefinition, ScopeLine,
1513 getCompositeType(), Virtuality, VirtualIndex,
1514 ThisAdjustment, Flags, IsOptimized, Unit,
15061515 TemplateParams, Declaration, Variables));
15071516 EXPECT_NE(N, DISubprogram::get(Context, Scope, Name, LinkageName, File, Line,
15081517 Type, IsLocalToUnit, IsDefinition, ScopeLine,
1509 getCompositeType(), Virtuality, VirtualIndex,
1510 Flags, IsOptimized, Unit, TemplateParams,
1511 Declaration, Variables));
1512 EXPECT_NE(N, DISubprogram::get(Context, Scope, Name, LinkageName, File, Line,
1513 Type, IsLocalToUnit, IsDefinition, ScopeLine,
15141518 ContainingType, Virtuality + 1, VirtualIndex,
1515 Flags, IsOptimized, Unit, TemplateParams,
1516 Declaration, Variables));
1519 ThisAdjustment, Flags, IsOptimized, Unit,
1520 TemplateParams, Declaration, Variables));
15171521 EXPECT_NE(N, DISubprogram::get(Context, Scope, Name, LinkageName, File, Line,
15181522 Type, IsLocalToUnit, IsDefinition, ScopeLine,
15191523 ContainingType, Virtuality, VirtualIndex + 1,
1520 Flags, IsOptimized, Unit, TemplateParams,
1521 Declaration, Variables));
1524 ThisAdjustment, Flags, IsOptimized, Unit,
1525 TemplateParams, Declaration, Variables));
15221526 EXPECT_NE(N, DISubprogram::get(Context, Scope, Name, LinkageName, File, Line,
15231527 Type, IsLocalToUnit, IsDefinition, ScopeLine,
15241528 ContainingType, Virtuality, VirtualIndex,
1525 NotFlags, IsOptimized, Unit, TemplateParams,
1526 Declaration, Variables));
1529 ThisAdjustment, NotFlags, IsOptimized, Unit,
1530 TemplateParams, Declaration, Variables));
15271531 EXPECT_NE(N, DISubprogram::get(Context, Scope, Name, LinkageName, File, Line,
15281532 Type, IsLocalToUnit, IsDefinition, ScopeLine,
15291533 ContainingType, Virtuality, VirtualIndex,
1530 Flags, !IsOptimized, Unit, TemplateParams,
1531 Declaration, Variables));
1534 ThisAdjustment, Flags, !IsOptimized, Unit,
1535 TemplateParams, Declaration, Variables));
15321536 EXPECT_NE(N, DISubprogram::get(Context, Scope, Name, LinkageName, File, Line,
15331537 Type, IsLocalToUnit, IsDefinition, ScopeLine,
15341538 ContainingType, Virtuality, VirtualIndex,
1535 Flags, IsOptimized, nullptr, TemplateParams,
1536 Declaration, Variables));
1539 ThisAdjustment, Flags, IsOptimized, nullptr,
1540 TemplateParams, Declaration, Variables));
15371541 EXPECT_NE(N, DISubprogram::get(Context, Scope, Name, LinkageName, File, Line,
15381542 Type, IsLocalToUnit, IsDefinition, ScopeLine,
15391543 ContainingType, Virtuality, VirtualIndex,
1540 Flags, IsOptimized, Unit, getTuple(),
1541 Declaration, Variables));
1544 ThisAdjustment, Flags, IsOptimized, Unit,
1545 getTuple(), Declaration, Variables));
15421546 EXPECT_NE(N, DISubprogram::get(Context, Scope, Name, LinkageName, File, Line,
15431547 Type, IsLocalToUnit, IsDefinition, ScopeLine,
15441548 ContainingType, Virtuality, VirtualIndex,
1545 Flags, IsOptimized, Unit, TemplateParams,
1546 getSubprogram(), Variables));
1549 ThisAdjustment, Flags, IsOptimized, Unit,
1550 TemplateParams, getSubprogram(), Variables));
15471551 EXPECT_NE(N, DISubprogram::get(Context, Scope, Name, LinkageName, File, Line,
15481552 Type, IsLocalToUnit, IsDefinition, ScopeLine,
15491553 ContainingType, Virtuality, VirtualIndex,
1550 Flags, IsOptimized, Unit, TemplateParams,
1551 Declaration, getTuple()));
1554 ThisAdjustment, Flags, IsOptimized, Unit,
1555 TemplateParams, Declaration, getTuple()));
15521556
15531557 TempDISubprogram Temp = N->clone();
15541558 EXPECT_EQ(N, MDNode::replaceWithUniqued(std::move(Temp)));