Skip to content

Commit eeee0e8

Browse files
committed
Remove hax
Fixes #19321
1 parent c5db290 commit eeee0e8

File tree

1 file changed

+1
-60
lines changed

1 file changed

+1
-60
lines changed

src/librustc_llvm/lib.rs

+1-60
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub use self::Linkage::*;
5858

5959
use std::ffi::CString;
6060
use std::cell::RefCell;
61-
use std::{raw, mem, ptr};
61+
use std::{raw, mem};
6262
use libc::{c_uint, c_ushort, uint64_t, c_int, size_t, c_char};
6363
use libc::{c_longlong, c_ulonglong, c_void};
6464
use debuginfo::{DIBuilderRef, DIDescriptor,
@@ -2225,65 +2225,6 @@ pub unsafe fn debug_loc_to_string(c: ContextRef, tr: DebugLocRef) -> String {
22252225
.expect("got a non-UTF8 DebugLoc from LLVM")
22262226
}
22272227

2228-
// FIXME #15460 - create a public function that actually calls our
2229-
// static LLVM symbols. Otherwise the linker will just throw llvm
2230-
// away. We're just calling lots of stuff until we transitively get
2231-
// all of LLVM. This is worse than anything.
2232-
pub unsafe fn static_link_hack_this_sucks() {
2233-
LLVMInitializePasses();
2234-
2235-
LLVMInitializeX86TargetInfo();
2236-
LLVMInitializeX86Target();
2237-
LLVMInitializeX86TargetMC();
2238-
LLVMInitializeX86AsmPrinter();
2239-
LLVMInitializeX86AsmParser();
2240-
2241-
LLVMInitializeARMTargetInfo();
2242-
LLVMInitializeARMTarget();
2243-
LLVMInitializeARMTargetMC();
2244-
LLVMInitializeARMAsmPrinter();
2245-
LLVMInitializeARMAsmParser();
2246-
2247-
LLVMInitializeAArch64TargetInfo();
2248-
LLVMInitializeAArch64Target();
2249-
LLVMInitializeAArch64TargetMC();
2250-
LLVMInitializeAArch64AsmPrinter();
2251-
LLVMInitializeAArch64AsmParser();
2252-
2253-
LLVMInitializeMipsTargetInfo();
2254-
LLVMInitializeMipsTarget();
2255-
LLVMInitializeMipsTargetMC();
2256-
LLVMInitializeMipsAsmPrinter();
2257-
LLVMInitializeMipsAsmParser();
2258-
2259-
LLVMInitializePowerPCTargetInfo();
2260-
LLVMInitializePowerPCTarget();
2261-
LLVMInitializePowerPCTargetMC();
2262-
LLVMInitializePowerPCAsmPrinter();
2263-
LLVMInitializePowerPCAsmParser();
2264-
2265-
LLVMRustSetLLVMOptions(0 as c_int, ptr::null());
2266-
2267-
LLVMPassManagerBuilderPopulateModulePassManager(ptr::null_mut(), ptr::null_mut());
2268-
LLVMPassManagerBuilderPopulateLTOPassManager(ptr::null_mut(), ptr::null_mut(), False, False);
2269-
LLVMPassManagerBuilderPopulateFunctionPassManager(ptr::null_mut(), ptr::null_mut());
2270-
LLVMPassManagerBuilderSetOptLevel(ptr::null_mut(), 0 as c_uint);
2271-
LLVMPassManagerBuilderUseInlinerWithThreshold(ptr::null_mut(), 0 as c_uint);
2272-
LLVMWriteBitcodeToFile(ptr::null_mut(), ptr::null());
2273-
LLVMPassManagerBuilderCreate();
2274-
LLVMPassManagerBuilderDispose(ptr::null_mut());
2275-
2276-
LLVMRustLinkInExternalBitcode(ptr::null_mut(), ptr::null(), 0 as size_t);
2277-
2278-
LLVMLinkInMCJIT();
2279-
LLVMLinkInInterpreter();
2280-
2281-
extern {
2282-
fn LLVMLinkInMCJIT();
2283-
fn LLVMLinkInInterpreter();
2284-
}
2285-
}
2286-
22872228
// The module containing the native LLVM dependencies, generated by the build system
22882229
// Note that this must come after the rustllvm extern declaration so that
22892230
// parts of LLVM that rustllvm depends on aren't thrown away by the linker.

0 commit comments

Comments
 (0)