Skip to content

Commit

Permalink
Rollup merge of rust-lang#60097 - cuviper:llvm8-mergefunc-use-aliases…
Browse files Browse the repository at this point in the history
…, r=rkruppe

Use -mergefunc-use-aliases for any LLVM >= 8

This functionality is not specific to Rust's LLVM, but any starting in LLVM 8.0,
as noted in <rust-lang#56358 (comment)>.

cc @nikic
r? @rkruppe
  • Loading branch information
Centril authored Apr 19, 2019
2 parents 69a3822 + a1099ae commit 39ab46a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
1 change: 0 additions & 1 deletion src/librustc_codegen_llvm/llvm/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1382,7 +1382,6 @@ extern "C" {
pub fn LLVMRustDebugMetadataVersion() -> u32;
pub fn LLVMRustVersionMajor() -> u32;
pub fn LLVMRustVersionMinor() -> u32;
pub fn LLVMRustIsRustLLVM() -> bool;

pub fn LLVMRustAddModuleFlag(M: &Module, name: *const c_char, value: u32);

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_codegen_llvm/llvm_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ unsafe fn configure_llvm(sess: &Session) {
if sess.opts.debugging_opts.disable_instrumentation_preinliner {
add("-disable-preinline");
}
if llvm::LLVMRustIsRustLLVM() {
if get_major_version() >= 8 {
match sess.opts.debugging_opts.merge_functions
.unwrap_or(sess.target.target.options.merge_functions) {
MergeFunctions::Disabled |
Expand Down
8 changes: 0 additions & 8 deletions src/rustllvm/RustWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -613,14 +613,6 @@ extern "C" uint32_t LLVMRustVersionMinor() { return LLVM_VERSION_MINOR; }

extern "C" uint32_t LLVMRustVersionMajor() { return LLVM_VERSION_MAJOR; }

extern "C" bool LLVMRustIsRustLLVM() {
#ifdef LLVM_RUSTLLVM
return 1;
#else
return 0;
#endif
}

extern "C" void LLVMRustAddModuleFlag(LLVMModuleRef M, const char *Name,
uint32_t Value) {
unwrap(M)->addModuleFlag(Module::Warning, Name, Value);
Expand Down

0 comments on commit 39ab46a

Please sign in to comment.