mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-26 09:18:56 +00:00
Create macro INITIALIZE_TM_PASS.
Pass initialization requires to initialize TargetMachine for back-end specific passes. This commit creates a new macro INITIALIZE_TM_PASS to simplify this kind of initialization. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210641 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -151,19 +151,8 @@ typedef DenseMap<Instruction *, Type *> InstrToOrigTy;
|
||||
}
|
||||
|
||||
char CodeGenPrepare::ID = 0;
|
||||
static void *initializeCodeGenPreparePassOnce(PassRegistry &Registry) {
|
||||
initializeTargetLibraryInfoPass(Registry);
|
||||
PassInfo *PI = new PassInfo(
|
||||
"Optimize for code generation", "codegenprepare", &CodeGenPrepare::ID,
|
||||
PassInfo::NormalCtor_t(callDefaultCtor<CodeGenPrepare>), false, false,
|
||||
PassInfo::TargetMachineCtor_t(callTargetMachineCtor<CodeGenPrepare>));
|
||||
Registry.registerPass(*PI, true);
|
||||
return PI;
|
||||
}
|
||||
|
||||
void llvm::initializeCodeGenPreparePass(PassRegistry &Registry) {
|
||||
CALL_ONCE_INITIALIZATION(initializeCodeGenPreparePassOnce)
|
||||
}
|
||||
INITIALIZE_TM_PASS(CodeGenPrepare, "codegenprepare",
|
||||
"Optimize for code generation", false, false)
|
||||
|
||||
FunctionPass *llvm::createCodeGenPreparePass(const TargetMachine *TM) {
|
||||
return new CodeGenPrepare(TM);
|
||||
|
Reference in New Issue
Block a user