about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2011-11-10 00:55:09 -0500
committerJosh Matthews <josh@joshmatthews.net>2011-12-18 23:39:54 -0500
commit10030a37d50f5c3ae681709598be201153e0b1e5 (patch)
tree00b9b1e2325dc1300f466fd75fea782509ac3c8b /src/rustllvm/RustWrapper.cpp
parentfa27724a4bb213f896d4003ed129bf7caff7f3a0 (diff)
downloadrust-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.cpp14
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));
+}