Skip to content

Commit a9308c4

Browse files
committed
IR: Give 'DI' prefix to debug info metadata
Finish off PR23080 by renaming the debug info IR constructs from `MD*` to `DI*`. The last of the `DIDescriptor` classes were deleted in r235356, and the last of the related typedefs removed in r235413, so this has all baked for about a week. Note: If you have out-of-tree code (like a frontend), I recommend that you get everything compiling and tests passing with the *previous* commit before updating to this one. It'll be easier to keep track of what code is using the `DIDescriptor` hierarchy and what you've already updated, and I think you're extremely unlikely to insert bugs. YMMV of course. Back to *this* commit: I did this using the rename-md-di-nodes.sh upgrade script I've attached to PR23080 (both code and testcases) and filtered through clang-format-diff.py. I edited the tests for test/Assembler/invalid-generic-debug-node-*.ll by hand since the columns were off-by-three. It should work on your out-of-tree testcases (and code, if you've followed the advice in the previous paragraph). Some of the tests are in badly named files now (e.g., test/Assembler/invalid-mdcompositetype-missing-tag.ll should be 'dicompositetype'); I'll come back and move the files in a follow-up commit. llvm-svn: 236120
1 parent 7539548 commit a9308c4

File tree

548 files changed

+11213
-11224
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

548 files changed

+11213
-11224
lines changed

llvm/bindings/go/llvm/DIBuilderBindings.cpp

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ LLVMMetadataRef LLVMDIBuilderCreateLexicalBlock(LLVMDIBuilderRef Dref,
5656
unsigned Line,
5757
unsigned Column) {
5858
DIBuilder *D = unwrap(Dref);
59-
auto *LB = D->createLexicalBlock(unwrap<MDLocalScope>(Scope),
60-
unwrap<MDFile>(File), Line, Column);
59+
auto *LB = D->createLexicalBlock(unwrap<DILocalScope>(Scope),
60+
unwrap<DIFile>(File), Line, Column);
6161
return wrap(LB);
6262
}
6363

@@ -66,8 +66,8 @@ LLVMMetadataRef LLVMDIBuilderCreateLexicalBlockFile(LLVMDIBuilderRef Dref,
6666
LLVMMetadataRef File,
6767
unsigned Discriminator) {
6868
DIBuilder *D = unwrap(Dref);
69-
return wrap(D->createLexicalBlockFile(unwrap<MDLocalScope>(Scope),
70-
unwrap<MDFile>(File), Discriminator));
69+
return wrap(D->createLexicalBlockFile(unwrap<DILocalScope>(Scope),
70+
unwrap<DIFile>(File), Discriminator));
7171
}
7272

7373
LLVMMetadataRef LLVMDIBuilderCreateFunction(
@@ -76,9 +76,9 @@ LLVMMetadataRef LLVMDIBuilderCreateFunction(
7676
LLVMMetadataRef CompositeType, int IsLocalToUnit, int IsDefinition,
7777
unsigned ScopeLine, unsigned Flags, int IsOptimized, LLVMValueRef Func) {
7878
DIBuilder *D = unwrap(Dref);
79-
return wrap(D->createFunction(unwrap<MDScope>(Scope), Name, LinkageName,
80-
File ? unwrap<MDFile>(File) : nullptr, Line,
81-
unwrap<MDSubroutineType>(CompositeType),
79+
return wrap(D->createFunction(unwrap<DIScope>(Scope), Name, LinkageName,
80+
File ? unwrap<DIFile>(File) : nullptr, Line,
81+
unwrap<DISubroutineType>(CompositeType),
8282
IsLocalToUnit, IsDefinition, ScopeLine, Flags,
8383
IsOptimized, unwrap<Function>(Func)));
8484
}
@@ -89,8 +89,8 @@ LLVMMetadataRef LLVMDIBuilderCreateLocalVariable(
8989
int AlwaysPreserve, unsigned Flags, unsigned ArgNo) {
9090
DIBuilder *D = unwrap(Dref);
9191
return wrap(D->createLocalVariable(
92-
Tag, unwrap<MDScope>(Scope), Name, unwrap<MDFile>(File), Line,
93-
unwrap<MDType>(Ty), AlwaysPreserve, Flags, ArgNo));
92+
Tag, unwrap<DIScope>(Scope), Name, unwrap<DIFile>(File), Line,
93+
unwrap<DIType>(Ty), AlwaysPreserve, Flags, ArgNo));
9494
}
9595

9696
LLVMMetadataRef LLVMDIBuilderCreateBasicType(LLVMDIBuilderRef Dref,
@@ -108,7 +108,7 @@ LLVMMetadataRef LLVMDIBuilderCreatePointerType(LLVMDIBuilderRef Dref,
108108
uint64_t AlignInBits,
109109
const char *Name) {
110110
DIBuilder *D = unwrap(Dref);
111-
return wrap(D->createPointerType(unwrap<MDType>(PointeeType), SizeInBits,
111+
return wrap(D->createPointerType(unwrap<DIType>(PointeeType), SizeInBits,
112112
AlignInBits, Name));
113113
}
114114

@@ -117,8 +117,8 @@ LLVMDIBuilderCreateSubroutineType(LLVMDIBuilderRef Dref, LLVMMetadataRef File,
117117
LLVMMetadataRef ParameterTypes) {
118118
DIBuilder *D = unwrap(Dref);
119119
return wrap(
120-
D->createSubroutineType(File ? unwrap<MDFile>(File) : nullptr,
121-
MDTypeRefArray(unwrap<MDTuple>(ParameterTypes))));
120+
D->createSubroutineType(File ? unwrap<DIFile>(File) : nullptr,
121+
DITypeRefArray(unwrap<MDTuple>(ParameterTypes))));
122122
}
123123

124124
LLVMMetadataRef LLVMDIBuilderCreateStructType(
@@ -128,10 +128,10 @@ LLVMMetadataRef LLVMDIBuilderCreateStructType(
128128
LLVMMetadataRef ElementTypes) {
129129
DIBuilder *D = unwrap(Dref);
130130
return wrap(D->createStructType(
131-
unwrap<MDScope>(Scope), Name, File ? unwrap<MDFile>(File) : nullptr, Line,
131+
unwrap<DIScope>(Scope), Name, File ? unwrap<DIFile>(File) : nullptr, Line,
132132
SizeInBits, AlignInBits, Flags,
133-
DerivedFrom ? unwrap<MDType>(DerivedFrom) : nullptr,
134-
ElementTypes ? DebugNodeArray(unwrap<MDTuple>(ElementTypes)) : nullptr));
133+
DerivedFrom ? unwrap<DIType>(DerivedFrom) : nullptr,
134+
ElementTypes ? DINodeArray(unwrap<MDTuple>(ElementTypes)) : nullptr));
135135
}
136136

137137
LLVMMetadataRef LLVMDIBuilderCreateReplaceableCompositeType(
@@ -141,7 +141,7 @@ LLVMMetadataRef LLVMDIBuilderCreateReplaceableCompositeType(
141141
unsigned Flags) {
142142
DIBuilder *D = unwrap(Dref);
143143
return wrap(D->createReplaceableCompositeType(
144-
Tag, Name, unwrap<MDScope>(Scope), File ? unwrap<MDFile>(File) : nullptr,
144+
Tag, Name, unwrap<DIScope>(Scope), File ? unwrap<DIFile>(File) : nullptr,
145145
Line, RuntimeLang, SizeInBits, AlignInBits, Flags));
146146
}
147147

@@ -153,8 +153,8 @@ LLVMDIBuilderCreateMemberType(LLVMDIBuilderRef Dref, LLVMMetadataRef Scope,
153153
unsigned Flags, LLVMMetadataRef Ty) {
154154
DIBuilder *D = unwrap(Dref);
155155
return wrap(D->createMemberType(
156-
unwrap<MDScope>(Scope), Name, File ? unwrap<MDFile>(File) : nullptr, Line,
157-
SizeInBits, AlignInBits, OffsetInBits, Flags, unwrap<MDType>(Ty)));
156+
unwrap<DIScope>(Scope), Name, File ? unwrap<DIFile>(File) : nullptr, Line,
157+
SizeInBits, AlignInBits, OffsetInBits, Flags, unwrap<DIType>(Ty)));
158158
}
159159

160160
LLVMMetadataRef LLVMDIBuilderCreateArrayType(LLVMDIBuilderRef Dref,
@@ -164,18 +164,18 @@ LLVMMetadataRef LLVMDIBuilderCreateArrayType(LLVMDIBuilderRef Dref,
164164
LLVMMetadataRef Subscripts) {
165165
DIBuilder *D = unwrap(Dref);
166166
return wrap(D->createArrayType(SizeInBits, AlignInBits,
167-
unwrap<MDType>(ElementType),
168-
DebugNodeArray(unwrap<MDTuple>(Subscripts))));
167+
unwrap<DIType>(ElementType),
168+
DINodeArray(unwrap<MDTuple>(Subscripts))));
169169
}
170170

171171
LLVMMetadataRef LLVMDIBuilderCreateTypedef(LLVMDIBuilderRef Dref,
172172
LLVMMetadataRef Ty, const char *Name,
173173
LLVMMetadataRef File, unsigned Line,
174174
LLVMMetadataRef Context) {
175175
DIBuilder *D = unwrap(Dref);
176-
return wrap(D->createTypedef(unwrap<MDType>(Ty), Name,
177-
File ? unwrap<MDFile>(File) : nullptr, Line,
178-
Context ? unwrap<MDScope>(Context) : nullptr));
176+
return wrap(D->createTypedef(unwrap<DIType>(Ty), Name,
177+
File ? unwrap<DIFile>(File) : nullptr, Line,
178+
Context ? unwrap<DIScope>(Context) : nullptr));
179179
}
180180

181181
LLVMMetadataRef LLVMDIBuilderGetOrCreateSubrange(LLVMDIBuilderRef Dref,
@@ -190,7 +190,7 @@ LLVMMetadataRef LLVMDIBuilderGetOrCreateArray(LLVMDIBuilderRef Dref,
190190
DIBuilder *D = unwrap(Dref);
191191
Metadata **DataValue = unwrap(Data);
192192
ArrayRef<Metadata *> Elements(DataValue, Length);
193-
DebugNodeArray A = D->getOrCreateArray(Elements);
193+
DINodeArray A = D->getOrCreateArray(Elements);
194194
return wrap(A.get());
195195
}
196196

@@ -200,7 +200,7 @@ LLVMMetadataRef LLVMDIBuilderGetOrCreateTypeArray(LLVMDIBuilderRef Dref,
200200
DIBuilder *D = unwrap(Dref);
201201
Metadata **DataValue = unwrap(Data);
202202
ArrayRef<Metadata *> Elements(DataValue, Length);
203-
MDTypeRefArray A = D->getOrCreateTypeArray(Elements);
203+
DITypeRefArray A = D->getOrCreateTypeArray(Elements);
204204
return wrap(A.get());
205205
}
206206

@@ -221,8 +221,8 @@ LLVMValueRef LLVMDIBuilderInsertDeclareAtEnd(LLVMDIBuilderRef Dref,
221221

222222
DIBuilder *D = unwrap(Dref);
223223
Instruction *Instr = D->insertDeclare(
224-
unwrap(Storage), unwrap<MDLocalVariable>(VarInfo),
225-
unwrap<MDExpression>(Expr), /* DebugLoc */ nullptr, unwrap(Block));
224+
unwrap(Storage), unwrap<DILocalVariable>(VarInfo),
225+
unwrap<DIExpression>(Expr), /* DebugLoc */ nullptr, unwrap(Block));
226226
return wrap(Instr);
227227
}
228228

@@ -237,7 +237,7 @@ LLVMValueRef LLVMDIBuilderInsertValueAtEnd(LLVMDIBuilderRef Dref,
237237

238238
DIBuilder *D = unwrap(Dref);
239239
Instruction *Instr = D->insertDbgValueIntrinsic(
240-
unwrap(Val), Offset, unwrap<MDLocalVariable>(VarInfo),
241-
unwrap<MDExpression>(Expr), /* DebugLoc */ nullptr, unwrap(Block));
240+
unwrap(Val), Offset, unwrap<DILocalVariable>(VarInfo),
241+
unwrap<DIExpression>(Expr), /* DebugLoc */ nullptr, unwrap(Block));
242242
return wrap(Instr);
243243
}

llvm/docs/CommandGuide/FileCheck.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,9 @@ For example, the following works like you'd expect:
200200

201201
.. code-block:: llvm
202202
203-
!0 = !MDLocation(line: 5, scope: !1, inlinedAt: !2)
203+
!0 = !DILocation(line: 5, scope: !1, inlinedAt: !2)
204204
205-
; CHECK: !MDLocation(line: 5,
205+
; CHECK: !DILocation(line: 5,
206206
; CHECK-NOT: column:
207207
; CHECK-SAME: scope: ![[SCOPE:[0-9]+]]
208208

0 commit comments

Comments
 (0)