Revert "Auto merge of #113923 - DianQK:restore-no-builtins-lto, r=pnkfelix"
This reverts commit8c2b577217
, reversing changes made to9cf18e98f8
.
This commit is contained in:
parent
6d29eac04b
commit
aa874c5513
16 changed files with 89 additions and 133 deletions
|
@ -531,9 +531,12 @@ extern "C" void LLVMRustDisposeTargetMachine(LLVMTargetMachineRef TM) {
|
|||
|
||||
// Unfortunately, the LLVM C API doesn't provide a way to create the
|
||||
// TargetLibraryInfo pass, so we use this method to do so.
|
||||
extern "C" void LLVMRustAddLibraryInfo(LLVMPassManagerRef PMR, LLVMModuleRef M) {
|
||||
extern "C" void LLVMRustAddLibraryInfo(LLVMPassManagerRef PMR, LLVMModuleRef M,
|
||||
bool DisableSimplifyLibCalls) {
|
||||
Triple TargetTriple(unwrap(M)->getTargetTriple());
|
||||
TargetLibraryInfoImpl TLII(TargetTriple);
|
||||
if (DisableSimplifyLibCalls)
|
||||
TLII.disableAllFunctions();
|
||||
unwrap(PMR)->add(new TargetLibraryInfoWrapperPass(TLII));
|
||||
}
|
||||
|
||||
|
@ -700,7 +703,7 @@ LLVMRustOptimize(
|
|||
bool IsLinkerPluginLTO,
|
||||
bool NoPrepopulatePasses, bool VerifyIR, bool UseThinLTOBuffers,
|
||||
bool MergeFunctions, bool UnrollLoops, bool SLPVectorize, bool LoopVectorize,
|
||||
bool EmitLifetimeMarkers,
|
||||
bool DisableSimplifyLibCalls, bool EmitLifetimeMarkers,
|
||||
LLVMRustSanitizerOptions *SanitizerOptions,
|
||||
const char *PGOGenPath, const char *PGOUsePath,
|
||||
bool InstrumentCoverage, const char *InstrProfileOutput,
|
||||
|
@ -800,6 +803,8 @@ LLVMRustOptimize(
|
|||
|
||||
Triple TargetTriple(TheModule->getTargetTriple());
|
||||
std::unique_ptr<TargetLibraryInfoImpl> TLII(new TargetLibraryInfoImpl(TargetTriple));
|
||||
if (DisableSimplifyLibCalls)
|
||||
TLII->disableAllFunctions();
|
||||
FAM.registerPass([&] { return TargetLibraryAnalysis(*TLII); });
|
||||
|
||||
PB.registerModuleAnalyses(MAM);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue