Skip to content

Commit 8a81671

Browse files
committed
[C-API] Add implicit DIBuilder CreateObjectPointerType for backwards compatability
llvm#122928 Introduces a change to the C DebugInfo API which breaks compatability with older versions. This patch proposes the same functionality through a new function instead. I'm not that familiar with Clang development, but from how things are described in the original patch (and its parent) it seems like it should be an avoidable breakage.
1 parent 585858a commit 8a81671

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

llvm/include/llvm-c/DebugInfo.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,14 @@ LLVMDIBuilderCreateObjCProperty(LLVMDIBuilderRef Builder,
869869
unsigned PropertyAttributes,
870870
LLVMMetadataRef Ty);
871871

872+
/**
873+
* Create a uniqued DIType* clone with FlagObjectPointer.
874+
* \param Builder The DIBuilder.
875+
* \param Type The underlying type to which this pointer points.
876+
*/
877+
LLVMMetadataRef LLVMDIBuilderCreateObjectPointerType(LLVMDIBuilderRef Builder,
878+
LLVMMetadataRef Type);
879+
872880
/**
873881
* Create a uniqued DIType* clone with FlagObjectPointer. If \c Implicit
874882
* is true, then also set FlagArtificial.
@@ -877,9 +885,9 @@ LLVMDIBuilderCreateObjCProperty(LLVMDIBuilderRef Builder,
877885
* \param Implicit Indicates whether this pointer was implicitly generated
878886
* (i.e., not spelled out in source).
879887
*/
880-
LLVMMetadataRef LLVMDIBuilderCreateObjectPointerType(LLVMDIBuilderRef Builder,
881-
LLVMMetadataRef Type,
882-
LLVMBool Implicit);
888+
LLVMMetadataRef
889+
LLVMDIBuilderCreateImplicitObjectPointerType(LLVMDIBuilderRef Builder,
890+
LLVMMetadataRef Type);
883891

884892
/**
885893
* Create debugging information entry for a qualified

llvm/lib/IR/DebugInfo.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1433,10 +1433,16 @@ LLVMDIBuilderCreateObjCProperty(LLVMDIBuilderRef Builder,
14331433
}
14341434

14351435
LLVMMetadataRef LLVMDIBuilderCreateObjectPointerType(LLVMDIBuilderRef Builder,
1436-
LLVMMetadataRef Type,
1437-
LLVMBool Implicit) {
1436+
LLVMMetadataRef Type) {
14381437
return wrap(unwrap(Builder)->createObjectPointerType(unwrapDI<DIType>(Type),
1439-
Implicit));
1438+
/*Implicit=*/false));
1439+
}
1440+
1441+
LLVMMetadataRef
1442+
LLVMDIBuilderCreateImplicitObjectPointerType(LLVMDIBuilderRef Builder,
1443+
LLVMMetadataRef Type) {
1444+
return wrap(unwrap(Builder)->createObjectPointerType(unwrapDI<DIType>(Type),
1445+
/*Implicit=*/true));
14401446
}
14411447

14421448
LLVMMetadataRef

0 commit comments

Comments
 (0)