Skip to content

Commit 694679c

Browse files
committed
Revert "[DebugInfo] Swap 'Unit' and 'Type' positions in DISubprogram."
This reverts commit 40d316d.
1 parent 40d316d commit 694679c

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

llvm/include/llvm/IR/DebugInfoMetadata.h

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,11 +1865,6 @@ class DISubprogram : public DILocalScope {
18651865
/// Only used by clients of CloneFunction, and only right after the cloning.
18661866
void replaceLinkageName(MDString *LN) { replaceOperandWith(3, LN); }
18671867

1868-
DICompileUnit *getUnit() const {
1869-
return cast_or_null<DICompileUnit>(getRawUnit());
1870-
}
1871-
void replaceUnit(DICompileUnit *CU) { replaceOperandWith(4, CU); }
1872-
18731868
DISubroutineType *getType() const {
18741869
return cast_or_null<DISubroutineType>(getRawType());
18751870
}
@@ -1878,9 +1873,13 @@ class DISubprogram : public DILocalScope {
18781873
}
18791874
void replaceType(DISubroutineType *Ty) {
18801875
assert(isDistinct() && "Only distinct nodes can mutate");
1881-
replaceOperandWith(5, Ty);
1876+
replaceOperandWith(4, Ty);
18821877
}
18831878

1879+
DICompileUnit *getUnit() const {
1880+
return cast_or_null<DICompileUnit>(getRawUnit());
1881+
}
1882+
void replaceUnit(DICompileUnit *CU) { replaceOperandWith(5, CU); }
18841883
DITemplateParameterArray getTemplateParams() const {
18851884
return cast_or_null<MDTuple>(getRawTemplateParams());
18861885
}
@@ -1904,8 +1903,8 @@ class DISubprogram : public DILocalScope {
19041903
Metadata *getRawScope() const { return getOperand(1); }
19051904
MDString *getRawName() const { return getOperandAs<MDString>(2); }
19061905
MDString *getRawLinkageName() const { return getOperandAs<MDString>(3); }
1907-
Metadata *getRawUnit() const { return getOperand(4); }
1908-
Metadata *getRawType() const { return getOperand(5); }
1906+
Metadata *getRawType() const { return getOperand(4); }
1907+
Metadata *getRawUnit() const { return getOperand(5); }
19091908
Metadata *getRawDeclaration() const { return getOperand(6); }
19101909
Metadata *getRawRetainedNodes() const { return getOperand(7); }
19111910
Metadata *getRawContainingType() const {

llvm/lib/IR/DebugInfoMetadata.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,9 +1138,10 @@ DISubprogram *DISubprogram::getImpl(
11381138
RetainedNodes, ThrownTypes, Annotations,
11391139
TargetFuncName));
11401140
SmallVector<Metadata *, 13> Ops = {
1141-
File, Scope, Name, LinkageName, Unit,
1142-
Type, Declaration, RetainedNodes, ContainingType, TemplateParams,
1143-
ThrownTypes, Annotations, TargetFuncName};
1141+
File, Scope, Name, LinkageName,
1142+
Type, Unit, Declaration, RetainedNodes,
1143+
ContainingType, TemplateParams, ThrownTypes, Annotations,
1144+
TargetFuncName};
11441145
if (!TargetFuncName) {
11451146
Ops.pop_back();
11461147
if (!Annotations) {

0 commit comments

Comments
 (0)