diff options
| author | Patrick Walton <pcwalton@fb.com> | 2022-06-20 16:26:51 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@fb.com> | 2022-07-08 11:31:08 -0700 |
| commit | 1e0ad0c1d4fdca7a37221e05fd5e39739d9084f5 (patch) | |
| tree | 14b27ca538f026f36bd50438734954f68071b2c2 /compiler/rustc_codegen_llvm/src/debuginfo | |
| parent | 45263fc66d253f762b3880764ae48611a25bf887 (diff) | |
| download | rust-1e0ad0c1d4fdca7a37221e05fd5e39739d9084f5.tar.gz rust-1e0ad0c1d4fdca7a37221e05fd5e39739d9084f5.zip | |
Implement support for DWARF version 5.
DWARF version 5 brings a number of improvements over version 4. Quoting from the announcement [1]: > Version 5 incorporates improvements in many areas: better data compression, > separation of debugging data from executable files, improved description of > macros and source files, faster searching for symbols, improved debugging > optimized code, as well as numerous improvements in functionality and > performance. On platforms where DWARF version 5 is supported (Linux, primarily), this commit adds support for it behind a new `-Z dwarf-version=5` flag. [1]: https://dwarfstd.org/Public_Review.php
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/debuginfo')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/debuginfo/mod.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs b/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs index 64ecbc82c56..730048d061b 100644 --- a/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs +++ b/compiler/rustc_codegen_llvm/src/debuginfo/mod.rs @@ -103,14 +103,14 @@ impl<'ll, 'tcx> CodegenUnitDebugContext<'ll, 'tcx> { // 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 let Some(version) = sess.target.dwarf_version { - llvm::LLVMRustAddModuleFlag( - self.llmod, - llvm::LLVMModFlagBehavior::Warning, - "Dwarf Version\0".as_ptr().cast(), - version, - ) - } + let dwarf_version = + sess.opts.debugging_opts.dwarf_version.unwrap_or(sess.target.default_dwarf_version); + llvm::LLVMRustAddModuleFlag( + self.llmod, + llvm::LLVMModFlagBehavior::Warning, + "Dwarf Version\0".as_ptr().cast(), + dwarf_version, + ); // Indicate that we want CodeView debug information on MSVC if sess.target.is_like_msvc { |
