diff options
| author | Austin Shafer <ashafer@badland.io> | 2020-10-09 15:08:18 -0400 |
|---|---|---|
| committer | Austin Shafer <ashafer@badland.io> | 2020-10-13 15:56:30 -0400 |
| commit | 4511f8b9f3fc31af6bb96794c3940db911193003 (patch) | |
| tree | 782017227646cbd37c6df4490c2475685fb00f79 /compiler/rustc_codegen_llvm/src | |
| parent | 08764ad1638d49ee8303a8e5b1a9e439cbbc87f6 (diff) | |
| download | rust-4511f8b9f3fc31af6bb96794c3940db911193003.tar.gz rust-4511f8b9f3fc31af6bb96794c3940db911193003.zip | |
Add a target option for selecting a DWARF version
Certain platforms need to limit the DWARF version emitted (oxs, *bsd). This change adds a dwarf_version entry to the options that allows a platform to specify the dwarf version to use. By default this option is none and the default DWARF version is selected. Also adds an option for printing Option<u32> json keys
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/debuginfo/mod.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs b/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs index 7cdd366175d..6516869e47b 100644 --- a/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs +++ b/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs @@ -120,10 +120,8 @@ pub fn finalize(cx: &CodegenCx<'_, '_>) { // for macOS to understand. For more info see #11352 // This can be overridden using --llvm-opts -dwarf-version,N. // Android has the same issue (#22398) - if cx.sess().target.target.options.is_like_osx - || cx.sess().target.target.options.is_like_android - { - llvm::LLVMRustAddModuleFlag(cx.llmod, "Dwarf Version\0".as_ptr().cast(), 2) + if let Some(version) = cx.sess().target.target.options.dwarf_version { + llvm::LLVMRustAddModuleFlag(cx.llmod, "Dwarf Version\0".as_ptr().cast(), version) } // Indicate that we want CodeView debug information on MSVC |
