diff options
| author | Erick Tryzelaar <idadesub@users.sourceforge.net> | 2010-02-28 09:45:59 +0000 |
|---|---|---|
| committer | Erick Tryzelaar <idadesub@users.sourceforge.net> | 2010-02-28 09:45:59 +0000 |
| commit | be03d1674c9f3aa8051de063c3946feaf8cf2650 (patch) | |
| tree | f3225fd81e03d98416d92c08cbce02e04100596f /include/llvm-c | |
| parent | b76fe97493a56ee73d7f7be394920fe61558c1d8 (diff) | |
| download | external_llvm-be03d1674c9f3aa8051de063c3946feaf8cf2650.zip external_llvm-be03d1674c9f3aa8051de063c3946feaf8cf2650.tar.gz external_llvm-be03d1674c9f3aa8051de063c3946feaf8cf2650.tar.bz2 | |
Add metadata functions to llvm-c and ocaml.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97375 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm-c')
| -rw-r--r-- | include/llvm-c/Core.h | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/include/llvm-c/Core.h b/include/llvm-c/Core.h index 8d4fca1..1a29463 100644 --- a/include/llvm-c/Core.h +++ b/include/llvm-c/Core.h @@ -282,13 +282,19 @@ typedef enum { void LLVMDisposeMessage(char *Message); -/*===-- Modules -----------------------------------------------------------===*/ +/*===-- Contexts ----------------------------------------------------------===*/ /* Create and destroy contexts. */ LLVMContextRef LLVMContextCreate(void); LLVMContextRef LLVMGetGlobalContext(void); void LLVMContextDispose(LLVMContextRef C); +unsigned LLVMGetMDKindIDInContext(LLVMContextRef C, const char* Name, + unsigned SLen); +unsigned LLVMGetMDKindID(const char* Name, unsigned SLen); + +/*===-- Modules -----------------------------------------------------------===*/ + /* Create and destroy modules. */ /** See llvm::Module::Module. */ LLVMModuleRef LLVMModuleCreateWithName(const char *ModuleID); @@ -497,6 +503,9 @@ const char *LLVMGetValueName(LLVMValueRef Val); void LLVMSetValueName(LLVMValueRef Val, const char *Name); void LLVMDumpValue(LLVMValueRef Val); void LLVMReplaceAllUsesWith(LLVMValueRef OldVal, LLVMValueRef NewVal); +int LLVMHasMetadata(LLVMValueRef Val); +LLVMValueRef LLVMGetMetadata(LLVMValueRef Val, unsigned KindID); +void LLVMSetMetadata(LLVMValueRef Val, unsigned KindID, LLVMValueRef Node); /* Conversion functions. Return the input value if it is an instance of the specified class, otherwise NULL. See llvm::dyn_cast_or_null<>. */ @@ -522,6 +531,14 @@ LLVMBool LLVMIsNull(LLVMValueRef Val); LLVMBool LLVMIsUndef(LLVMValueRef Val); LLVMValueRef LLVMConstPointerNull(LLVMTypeRef Ty); +/* Operations on metadata */ +LLVMValueRef LLVMMDStringInContext(LLVMContextRef C, const char *Str, + unsigned SLen); +LLVMValueRef LLVMMDString(const char *Str, unsigned SLen); +LLVMValueRef LLVMMDNodeInContext(LLVMContextRef C, LLVMValueRef *Vals, + unsigned Count); +LLVMValueRef LLVMMDNode(LLVMValueRef *Vals, unsigned Count); + /* Operations on scalar constants */ LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N, LLVMBool SignExtend); @@ -773,6 +790,11 @@ void LLVMInsertIntoBuilderWithName(LLVMBuilderRef Builder, LLVMValueRef Instr, const char *Name); void LLVMDisposeBuilder(LLVMBuilderRef Builder); +/* Metadata */ +void LLVMSetCurrentDebugLocation(LLVMBuilderRef Builder, LLVMValueRef L); +LLVMValueRef LLVMGetCurrentDebugLocation(LLVMBuilderRef Builder); +void LLVMSetInstDebugLocation(LLVMBuilderRef Builder, LLVMValueRef Inst); + /* Terminators */ LLVMValueRef LLVMBuildRetVoid(LLVMBuilderRef); LLVMValueRef LLVMBuildRet(LLVMBuilderRef, LLVMValueRef V); |
