Skip to content

Commit 249ee83

Browse files
committed
Fix unwrap, use unwrapDI to cope with nulls
1 parent c2324e1 commit 249ee83

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

llvm/include/llvm-c/DebugInfo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -751,9 +751,9 @@ LLVMMetadataRef LLVMDIBuilderCreateSubrangeType(
751751
* \param Subscripts Subscripts.
752752
* \param NumSubscripts Number of subscripts.
753753
* \param DataLocation DataLocation.
754-
* \param Associated Associated (not NULL).
755-
* \param Allocated Allocated (not NULL).
756-
* \param Rank Rank (not NULL).
754+
* \param Associated Associated.
755+
* \param Allocated Allocated.
756+
* \param Rank Rank.
757757
* \param BitStride BitStride.
758758
*/
759759
LLVMMetadataRef LLVMDIBuilderCreateDynamicArrayType(

llvm/lib/IR/DebugInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,8 +1355,8 @@ LLVMMetadataRef LLVMDIBuilderCreateDynamicArrayType(
13551355
return wrap(unwrap(Builder)->createArrayType(
13561356
unwrapDI<DIScope>(Scope), {Name, NameLen}, unwrapDI<DIFile>(File), LineNo,
13571357
Size, AlignInBits, unwrapDI<DIType>(Ty), Subs,
1358-
unwrapDI<DIExpression>(DataLocation), unwrap<DIExpression>(Associated),
1359-
unwrap<DIExpression>(Allocated), unwrap<DIExpression>(Rank),
1358+
unwrapDI<DIExpression>(DataLocation), unwrapDI<DIExpression>(Associated),
1359+
unwrapDI<DIExpression>(Allocated), unwrapDI<DIExpression>(Rank),
13601360
unwrap(BitStride)));
13611361
}
13621362

llvm/tools/llvm-c-test/debuginfo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ int llvm_test_dibuilder(void) {
264264
LLVMMetadataRef L = LLVMDIBuilderCreateExpression(DIB, NULL, 0);
265265
LLVMMetadataRef DynamicArrayMetadataTy = LLVMDIBuilderCreateDynamicArrayType(
266266
DIB, File, "foo", 3, 42, File, 64 * 10, 0, Int64Ty, DynSubscripts, 1, L,
267-
L, L, L, NULL);
267+
NULL, NULL, NULL, NULL);
268268
LLVMAddNamedMetadataOperand(
269269
M, "DynType",
270270
LLVMMetadataAsValue(LLVMGetModuleContext(M), DynamicArrayMetadataTy));

0 commit comments

Comments
 (0)