From ea7b20d8f279ea8c63b9a4b8e9129fce0e3c2b5d Mon Sep 17 00:00:00 2001 From: comex Date: Tue, 28 Jan 2014 00:05:33 -0500 Subject: 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. --- src/rustllvm/RustWrapper.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/rustllvm/RustWrapper.cpp') 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(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)); } -- cgit 1.4.1-3-g733a5