-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PassWrapper: update for llvm/llvm-project@a3319371970b #122143
Conversation
This comment has been minimized.
This comment has been minimized.
@rustbot label: +llvm-main
886a109
to
ef626d7
Compare
if (!strcmp("zlib", DebugInfoCompression) && llvm::compression::zlib::isAvailable()) { | ||
#if LLVM_VERSION_GE(19, 0) | ||
Options.MCOptions.CompressDebugSections = DebugCompressionType::Zlib; | ||
#else | ||
Options.CompressDebugSections = DebugCompressionType::Zlib; | ||
#endif | ||
} else if (!strcmp("zstd", DebugInfoCompression) && llvm::compression::zstd::isAvailable()) { | ||
#if LLVM_VERSION_GE(19, 0) | ||
Options.MCOptions.CompressDebugSections = DebugCompressionType::Zstd; | ||
#else | ||
Options.CompressDebugSections = DebugCompressionType::Zstd; | ||
#endif | ||
} else if (!strcmp("none", DebugInfoCompression)) { | ||
#if LLVM_VERSION_GE(19, 0) | ||
Options.MCOptions.CompressDebugSections = DebugCompressionType::None; | ||
#else | ||
Options.CompressDebugSections = DebugCompressionType::None; | ||
#endif | ||
} | ||
|
||
#if LLVM_VERSION_GE(19, 0) | ||
Options.MCOptions.X86RelaxRelocations = RelaxELFRelocations; | ||
#else | ||
Options.RelaxELFRelocations = RelaxELFRelocations; | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not deeply familiar with C++, but is it possible to use the pattern of
#if LLVM_VERSION_GE(19,0)
DebugCompressionType& compress_debug_sections = &Options.MCOptions.CompressDebugSections;
#else
DebugCompressionType& compress_debug_sections = &Options.CompressDebugSections;
#endif
if (!strcmp("zlib", DebugInfoCompression) && llvm::compression::zlib::isAvailable()) {
compress_debug_sections = DebugCompressionType::Zlib;
} else
etc.
to reduce the repeated nesting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It....might be, but I'd have to think hard about it. It's readable to my brain to not have the indirection of the reference in the C++, so I think I'd rather leave it as-is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fine then. I find the current form a little challenging to read but I agree that it's closer to a wash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another way to approach that is to assign the desired DebugCompressionType
to a local and then have one conditional assignment block.
@bors r+ rollup |
…s, r=workingjubilee PassWrapper: update for llvm/llvm-project@a3319371970b `@rustbot` label: +llvm-main
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#118623 (Improve std::fs::read_to_string example) - rust-lang#119365 (Add asm goto support to `asm!`) - rust-lang#120608 (Docs for std::ptr::slice_from_raw_parts) - rust-lang#121885 (Move generic `NonZero` `rustc_layout_scalar_valid_range_start` attribute to inner type.) - rust-lang#121938 (Fix quadratic behavior of repeated vectored writes) - rust-lang#122099 (Add `#[inline]` to `BTreeMap::new` constructor) - rust-lang#122143 (PassWrapper: update for llvm/llvm-project@a3319371970b) Failed merges: - rust-lang#122076 (Tweak the way we protect in-place function arguments in interpreters) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#118623 (Improve std::fs::read_to_string example) - rust-lang#119365 (Add asm goto support to `asm!`) - rust-lang#120608 (Docs for std::ptr::slice_from_raw_parts) - rust-lang#121832 (Add new Tier-3 target: `loongarch64-unknown-linux-musl`) - rust-lang#121938 (Fix quadratic behavior of repeated vectored writes) - rust-lang#122099 (Add `#[inline]` to `BTreeMap::new` constructor) - rust-lang#122103 (Make TAITs and ATPITs capture late-bound lifetimes in scope) - rust-lang#122143 (PassWrapper: update for llvm/llvm-project@a3319371970b) Failed merges: - rust-lang#122076 (Tweak the way we protect in-place function arguments in interpreters) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#122143 - durin42:llvm-19-compression-options, r=workingjubilee PassWrapper: update for llvm/llvm-project@a3319371970b ``@rustbot`` label: +llvm-main
@rustbot label: +llvm-main