1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00

[LLVM-C] Add bindings to create enumerators

Summary: The C API don't have the bindings to create enumerators, needed to create an enumeration.

Reviewers: whitequark, CodaFi, harlanhaskins, deadalnix

Reviewed By: whitequark, CodaFi, harlanhaskins

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D58323

llvm-svn: 354237
This commit is contained in:
Robert Widmann 2019-02-17 21:25:47 +00:00
parent c5ae84d6e4
commit fe4cc31798
2 changed files with 21 additions and 0 deletions

View File

@ -478,6 +478,19 @@ LLVMDIBuilderCreateSubroutineType(LLVMDIBuilderRef Builder,
unsigned NumParameterTypes,
LLVMDIFlags Flags);
/**
* Create debugging information entry for an enumerator.
* @param Builder The DIBuilder.
* @param Name Enumerator name.
* @param NameLen Length of enumerator name.
* @param Value Enumerator value.
* @param IsUnsigned True if the value is unsigned.
*/
LLVMMetadataRef LLVMDIBuilderCreateEnumerator(LLVMDIBuilderRef Builder,
const char *Name, size_t NameLen,
int64_t Value,
LLVMBool IsUnsigned);
/**
* Create debugging information entry for an enumeration.
* \param Builder The DIBuilder.

View File

@ -899,6 +899,14 @@ LLVMMetadataRef LLVMDILocationGetScope(LLVMMetadataRef Location) {
return wrap(unwrapDI<DILocation>(Location)->getScope());
}
LLVMMetadataRef LLVMDIBuilderCreateEnumerator(LLVMDIBuilderRef Builder,
const char *Name, size_t NameLen,
int64_t Value,
LLVMBool IsUnsigned) {
return wrap(unwrap(Builder)->createEnumerator({Name, NameLen}, Value,
IsUnsigned != 0));
}
LLVMMetadataRef LLVMDIBuilderCreateEnumerationType(
LLVMDIBuilderRef Builder, LLVMMetadataRef Scope, const char *Name,
size_t NameLen, LLVMMetadataRef File, unsigned LineNumber,