mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 03:24:09 +00:00
LTO: Simplify code generator initialization
Simplify `LTOCodeGenerator` initialization by initializing simple fields at their definition. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235939 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -65,25 +65,12 @@ const char* LTOCodeGenerator::getVersionString() {
|
||||
|
||||
LTOCodeGenerator::LTOCodeGenerator()
|
||||
: Context(getGlobalContext()), IRLinker(new Module("ld-temp.o", Context)) {
|
||||
initialize();
|
||||
initializeLTOPasses();
|
||||
}
|
||||
|
||||
LTOCodeGenerator::LTOCodeGenerator(std::unique_ptr<LLVMContext> Context)
|
||||
: OwnedContext(std::move(Context)), Context(*OwnedContext),
|
||||
IRLinker(new Module("ld-temp.o", *OwnedContext)), OptLevel(2) {
|
||||
initialize();
|
||||
}
|
||||
|
||||
void LTOCodeGenerator::initialize() {
|
||||
TargetMach = nullptr;
|
||||
EmitDwarfDebugInfo = false;
|
||||
ScopeRestrictionsDone = false;
|
||||
CodeModel = LTO_CODEGEN_PIC_MODEL_DEFAULT;
|
||||
DiagHandler = nullptr;
|
||||
DiagContext = nullptr;
|
||||
OwnedModule = nullptr;
|
||||
ShouldInternalize = true;
|
||||
|
||||
IRLinker(new Module("ld-temp.o", *OwnedContext)) {
|
||||
initializeLTOPasses();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user