Deleting LIR and such, wiring up for HIR->x64.

This commit is contained in:
Ben Vanik
2014-01-24 22:26:15 -08:00
parent 55052b0d92
commit 8ae6053d0f
45 changed files with 538 additions and 2066 deletions

View File

@@ -30,11 +30,16 @@ using namespace alloy::runtime;
PPCTranslator::PPCTranslator(PPCFrontend* frontend) :
frontend_(frontend) {
Backend* backend = frontend->runtime()->backend();
scanner_ = new PPCScanner(frontend);
builder_ = new PPCHIRBuilder(frontend);
compiler_ = new Compiler(frontend->runtime());
assembler_ = backend->CreateAssembler();
assembler_->Initialize();
// Passes are executed in the order they are added. Multiple of the same
// pass type may be used.
compiler_->AddPass(new passes::ContextPromotionPass());
compiler_->AddPass(new passes::SimplificationPass());
// TODO(benvanik): run repeatedly?
@@ -45,9 +50,11 @@ PPCTranslator::PPCTranslator(PPCFrontend* frontend) :
//compiler_->AddPass(new passes::DeadStoreEliminationPass());
compiler_->AddPass(new passes::DeadCodeEliminationPass());
Backend* backend = frontend->runtime()->backend();
assembler_ = backend->CreateAssembler();
assembler_->Initialize();
// After register allocation instructions should not be added/removed.
compiler_->AddPass(new passes::RegisterAllocationPass(backend));
// Must come last. The HIR is not really HIR after this.
compiler_->AddPass(new passes::FinalizationPass());
}
PPCTranslator::~PPCTranslator() {