Rollup merge of #108599 - nikic:drop-init, r=cuviper
Remove legacy PM leftovers This drops two leftovers of legacy PM usage: * We don't need to initialize passes anymore. * The pass listing was still using legacy PM passes. Replace it with the corresponding new PM listing.
This commit is contained in:
commit
1fab0fc4a2
@ -1814,8 +1814,6 @@ extern "C" {
|
|||||||
/// Creates a legacy pass manager -- only used for final codegen.
|
/// Creates a legacy pass manager -- only used for final codegen.
|
||||||
pub fn LLVMCreatePassManager<'a>() -> &'a mut PassManager<'a>;
|
pub fn LLVMCreatePassManager<'a>() -> &'a mut PassManager<'a>;
|
||||||
|
|
||||||
pub fn LLVMInitializePasses();
|
|
||||||
|
|
||||||
pub fn LLVMTimeTraceProfilerInitialize();
|
pub fn LLVMTimeTraceProfilerInitialize();
|
||||||
|
|
||||||
pub fn LLVMTimeTraceProfilerFinishThread();
|
pub fn LLVMTimeTraceProfilerFinishThread();
|
||||||
|
@ -120,8 +120,6 @@ unsafe fn configure_llvm(sess: &Session) {
|
|||||||
llvm::LLVMTimeTraceProfilerInitialize();
|
llvm::LLVMTimeTraceProfilerInitialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
llvm::LLVMInitializePasses();
|
|
||||||
|
|
||||||
rustc_llvm::initialize_available_targets();
|
rustc_llvm::initialize_available_targets();
|
||||||
|
|
||||||
llvm::LLVMRustSetLLVMOptions(llvm_args.len() as c_int, llvm_args.as_ptr());
|
llvm::LLVMRustSetLLVMOptions(llvm_args.len() as c_int, llvm_args.as_ptr());
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
#include "llvm/Analysis/TargetLibraryInfo.h"
|
#include "llvm/Analysis/TargetLibraryInfo.h"
|
||||||
#include "llvm/Analysis/TargetTransformInfo.h"
|
#include "llvm/Analysis/TargetTransformInfo.h"
|
||||||
#include "llvm/CodeGen/TargetSubtargetInfo.h"
|
#include "llvm/CodeGen/TargetSubtargetInfo.h"
|
||||||
#include "llvm/InitializePasses.h"
|
|
||||||
#include "llvm/IR/AutoUpgrade.h"
|
#include "llvm/IR/AutoUpgrade.h"
|
||||||
#include "llvm/IR/AssemblyAnnotationWriter.h"
|
#include "llvm/IR/AssemblyAnnotationWriter.h"
|
||||||
#include "llvm/IR/IntrinsicInst.h"
|
#include "llvm/IR/IntrinsicInst.h"
|
||||||
@ -58,22 +57,6 @@ typedef struct LLVMOpaqueTargetMachine *LLVMTargetMachineRef;
|
|||||||
DEFINE_STDCXX_CONVERSION_FUNCTIONS(Pass, LLVMPassRef)
|
DEFINE_STDCXX_CONVERSION_FUNCTIONS(Pass, LLVMPassRef)
|
||||||
DEFINE_STDCXX_CONVERSION_FUNCTIONS(TargetMachine, LLVMTargetMachineRef)
|
DEFINE_STDCXX_CONVERSION_FUNCTIONS(TargetMachine, LLVMTargetMachineRef)
|
||||||
|
|
||||||
extern "C" void LLVMInitializePasses() {
|
|
||||||
PassRegistry &Registry = *PassRegistry::getPassRegistry();
|
|
||||||
initializeCore(Registry);
|
|
||||||
initializeCodeGen(Registry);
|
|
||||||
initializeScalarOpts(Registry);
|
|
||||||
initializeVectorization(Registry);
|
|
||||||
initializeIPO(Registry);
|
|
||||||
initializeAnalysis(Registry);
|
|
||||||
initializeTransformUtils(Registry);
|
|
||||||
initializeInstCombine(Registry);
|
|
||||||
#if LLVM_VERSION_LT(16, 0)
|
|
||||||
initializeInstrumentation(Registry);
|
|
||||||
#endif
|
|
||||||
initializeTarget(Registry);
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C" void LLVMTimeTraceProfilerInitialize() {
|
extern "C" void LLVMTimeTraceProfilerInitialize() {
|
||||||
timeTraceProfilerInitialize(
|
timeTraceProfilerInitialize(
|
||||||
/* TimeTraceGranularity */ 0,
|
/* TimeTraceGranularity */ 0,
|
||||||
@ -1004,23 +987,8 @@ LLVMRustPrintModule(LLVMModuleRef M, const char *Path, DemangleFn Demangle) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void LLVMRustPrintPasses() {
|
extern "C" void LLVMRustPrintPasses() {
|
||||||
LLVMInitializePasses();
|
PassBuilder PB;
|
||||||
struct MyListener : PassRegistrationListener {
|
PB.printPassNames(outs());
|
||||||
void passEnumerate(const PassInfo *Info) {
|
|
||||||
StringRef PassArg = Info->getPassArgument();
|
|
||||||
StringRef PassName = Info->getPassName();
|
|
||||||
if (!PassArg.empty()) {
|
|
||||||
// These unsigned->signed casts could theoretically overflow, but
|
|
||||||
// realistically never will (and even if, the result is implementation
|
|
||||||
// defined rather plain UB).
|
|
||||||
printf("%15.*s - %.*s\n", (int)PassArg.size(), PassArg.data(),
|
|
||||||
(int)PassName.size(), PassName.data());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} Listener;
|
|
||||||
|
|
||||||
PassRegistry *PR = PassRegistry::getPassRegistry();
|
|
||||||
PR->enumerateWith(&Listener);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void LLVMRustRunRestrictionPass(LLVMModuleRef M, char **Symbols,
|
extern "C" void LLVMRustRunRestrictionPass(LLVMModuleRef M, char **Symbols,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user