Skip to content

Commit a37446a

Browse files
authored
Rollup merge of rust-lang#60097 - cuviper:llvm8-mergefunc-use-aliases, 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
2 parents 8ba6c29 + a1099ae commit a37446a

File tree

3 files changed

+1
-10
lines changed

3 files changed

+1
-10
lines changed

src/librustc_codegen_llvm/llvm/ffi.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1382,7 +1382,6 @@ extern "C" {
13821382
pub fn LLVMRustDebugMetadataVersion() -> u32;
13831383
pub fn LLVMRustVersionMajor() -> u32;
13841384
pub fn LLVMRustVersionMinor() -> u32;
1385-
pub fn LLVMRustIsRustLLVM() -> bool;
13861385

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

src/librustc_codegen_llvm/llvm_util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ unsafe fn configure_llvm(sess: &Session) {
6161
if sess.opts.debugging_opts.disable_instrumentation_preinliner {
6262
add("-disable-preinline");
6363
}
64-
if llvm::LLVMRustIsRustLLVM() {
64+
if get_major_version() >= 8 {
6565
match sess.opts.debugging_opts.merge_functions
6666
.unwrap_or(sess.target.target.options.merge_functions) {
6767
MergeFunctions::Disabled |

src/rustllvm/RustWrapper.cpp

-8
Original file line numberDiff line numberDiff line change
@@ -613,14 +613,6 @@ extern "C" uint32_t LLVMRustVersionMinor() { return LLVM_VERSION_MINOR; }
613613

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

616-
extern "C" bool LLVMRustIsRustLLVM() {
617-
#ifdef LLVM_RUSTLLVM
618-
return 1;
619-
#else
620-
return 0;
621-
#endif
622-
}
623-
624616
extern "C" void LLVMRustAddModuleFlag(LLVMModuleRef M, const char *Name,
625617
uint32_t Value) {
626618
unwrap(M)->addModuleFlag(Module::Warning, Name, Value);

0 commit comments

Comments
 (0)