1
Fork 0

Use LLVMAddAnalysisPasses instead of Rust's wrapper

LLVM exposes a C API `LLVMAddAnalysisPasses` and hence Rust's own
wrapper `LLVMRustAddAnalysisPasses` is not needed anymore.
This commit is contained in:
Victor Ding 2019-11-29 14:31:09 +11:00
parent bbb664a99c
commit b41b1d3407
4 changed files with 6 additions and 16 deletions

View file

@ -445,17 +445,6 @@ extern "C" void LLVMRustDisposeTargetMachine(LLVMTargetMachineRef TM) {
delete unwrap(TM);
}
// Unfortunately, LLVM doesn't expose a C API to add the corresponding analysis
// passes for a target to a pass manager. We export that functionality through
// this function.
extern "C" void LLVMRustAddAnalysisPasses(LLVMTargetMachineRef TM,
LLVMPassManagerRef PMR,
LLVMModuleRef M) {
PassManagerBase *PM = unwrap(PMR);
PM->add(
createTargetTransformInfoWrapperPass(unwrap(TM)->getTargetIRAnalysis()));
}
extern "C" void LLVMRustConfigurePassManagerBuilder(
LLVMPassManagerBuilderRef PMBR, LLVMRustCodeGenOptLevel OptLevel,
bool MergeFunctions, bool SLPVectorize, bool LoopVectorize, bool PrepareForThinLTO,