about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorcomex <comexk@gmail.com>2014-01-28 00:05:33 -0500
committercomex <comexk@gmail.com>2014-01-28 00:05:33 -0500
commitea7b20d8f279ea8c63b9a4b8e9129fce0e3c2b5d (patch)
tree4da18db71394fcd2a3e2092e8f8282594083e429 /src/rustllvm/RustWrapper.cpp
parent760ddb3081acb038ff3c6bcc918bfa293dfc5acd (diff)
downloadrust-ea7b20d8f279ea8c63b9a4b8e9129fce0e3c2b5d.tar.gz
rust-ea7b20d8f279ea8c63b9a4b8e9129fce0e3c2b5d.zip
Add appropriate LLVM module flags for debug info.
Set "Dwarf Version" to 2 on OS X to avoid toolchain incompatibility, and
set "Debug Info Version" to prevent debug info from being stripped from
bitcode.

Fixes #11352.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
-rw-r--r--src/rustllvm/RustWrapper.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
index 280df8cb10f..2107f7c39a2 100644
--- a/src/rustllvm/RustWrapper.cpp
+++ b/src/rustllvm/RustWrapper.cpp
@@ -156,6 +156,14 @@ DIT unwrapDI(LLVMValueRef ref) {
     return DIT(ref ? unwrap<MDNode>(ref) : NULL);
 }
 
+extern "C" const uint32_t LLVMRustDebugMetadataVersion = DEBUG_METADATA_VERSION;
+
+extern "C" void LLVMRustAddModuleFlag(LLVMModuleRef M,
+                                      const char *name,
+                                      uint32_t value) {
+    unwrap(M)->addModuleFlag(Module::Warning, name, value);
+}
+
 extern "C" DIBuilderRef LLVMDIBuilderCreate(LLVMModuleRef M) {
     return new DIBuilder(*unwrap(M));
 }