From 10030a37d50f5c3ae681709598be201153e0b1e5 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Thu, 10 Nov 2011 00:55:09 -0500 Subject: Generate basic debug info for files, functions and compile units. --- src/rustllvm/RustWrapper.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/rustllvm/RustWrapper.cpp') 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(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(Val)); +} -- cgit 1.4.1-3-g733a5