diff options
| author | Josh Matthews <josh@joshmatthews.net> | 2011-11-10 00:55:09 -0500 |
|---|---|---|
| committer | Josh Matthews <josh@joshmatthews.net> | 2011-12-18 23:39:54 -0500 |
| commit | 10030a37d50f5c3ae681709598be201153e0b1e5 (patch) | |
| tree | 00b9b1e2325dc1300f466fd75fea782509ac3c8b /src/rustllvm/RustWrapper.cpp | |
| parent | fa27724a4bb213f896d4003ed129bf7caff7f3a0 (diff) | |
| download | rust-10030a37d50f5c3ae681709598be201153e0b1e5.tar.gz rust-10030a37d50f5c3ae681709598be201153e0b1e5.zip | |
Generate basic debug info for files, functions and compile units.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
| -rw-r--r-- | src/rustllvm/RustWrapper.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp index d50cc527dfd..ad7fec1586b 100644 --- a/src/rustllvm/RustWrapper.cpp +++ b/src/rustllvm/RustWrapper.cpp @@ -165,3 +165,17 @@ extern "C" LLVMValueRef LLVMGetOrInsertFunction(LLVMModuleRef M, return wrap(unwrap(M)->getOrInsertFunction(Name, unwrap<FunctionType>(FunctionTy))); } + +extern "C" LLVMTypeRef LLVMMetadataTypeInContext(LLVMContextRef C) { + return wrap(Type::getMetadataTy(*unwrap(C))); +} +extern "C" LLVMTypeRef LLVMMetadataType(void) { + return LLVMMetadataTypeInContext(LLVMGetGlobalContext()); +} + +extern "C" void LLVMAddNamedMetadataOperand(LLVMModuleRef M, const char *Str, + unsigned SLen, LLVMValueRef Val) +{ + NamedMDNode *N = unwrap(M)->getOrInsertNamedMetadata(StringRef(Str, SLen)); + N->addOperand(unwrap<MDNode>(Val)); +} |
