LIR skeleton, renaming some types to prevent conflict.

This commit is contained in:
Ben Vanik
2013-12-29 14:28:46 -08:00
parent 7d83ba0021
commit 3d01efffac
66 changed files with 817 additions and 762 deletions

View File

@@ -15,7 +15,7 @@
namespace alloy {
namespace hir {
class FunctionBuilder;
class HIRBuilder;
}
namespace runtime {
class DebugInfo;
@@ -41,7 +41,7 @@ public:
virtual void Reset();
virtual int Assemble(
runtime::FunctionInfo* symbol_info, hir::FunctionBuilder* builder,
runtime::FunctionInfo* symbol_info, hir::HIRBuilder* builder,
runtime::DebugInfo* debug_info, runtime::Function** out_function) = 0;
protected:

View File

@@ -13,7 +13,7 @@
#include <alloy/backend/tracing.h>
#include <alloy/backend/ivm/ivm_intcode.h>
#include <alloy/backend/ivm/ivm_function.h>
#include <alloy/hir/function_builder.h>
#include <alloy/hir/hir_builder.h>
#include <alloy/hir/label.h>
#include <alloy/runtime/runtime.h>
@@ -54,7 +54,7 @@ void IVMAssembler::Reset() {
}
int IVMAssembler::Assemble(
FunctionInfo* symbol_info, FunctionBuilder* builder,
FunctionInfo* symbol_info, HIRBuilder* builder,
DebugInfo* debug_info, Function** out_function) {
IVMFunction* fn = new IVMFunction(symbol_info);
fn->set_debug_info(debug_info);

View File

@@ -30,7 +30,7 @@ public:
virtual void Reset();
virtual int Assemble(
runtime::FunctionInfo* symbol_info, hir::FunctionBuilder* builder,
runtime::FunctionInfo* symbol_info, hir::HIRBuilder* builder,
runtime::DebugInfo* debug_info, runtime::Function** out_function);
private:

View File

@@ -31,14 +31,15 @@ namespace backend {
namespace ivm {
//#define DPRINT printf
//#define DFLUSH() fflush(stdout)
#define DPRINT
#define DFLUSH()
//#define IPRINT printf
//#define IFLUSH() fflush(stdout)
#define IPRINT
#define IFLUSH()
#define DPRINT
#define DFLUSH()
//#define IPRINT if (ics.thread_state->thread_id() == 1) printf
//#define IFLUSH() fflush(stdout)
//#define DPRINT if (ics.thread_state->thread_id() == 1) printf
//#define DFLUSH() fflush(stdout)
uint32_t IntCode_INT_LOAD_CONSTANT(IntCodeState& ics, const IntCode* i) {

View File

View File

View File

View File

View File

View File

View File

@@ -0,0 +1,12 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'lir_builder.cc',
'lir_builder.h',
'lir_instr.h',
'lircodes.cc',
'lircodes.h',
'lircodes.inl',
'tracing.h',
],
}

View File

View File

@@ -0,0 +1,7 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'redundant_mov_pass.cc',
'redundant_mov_pass.h',
],
}

View File

@@ -0,0 +1,15 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'optimizer.cc',
'optimizer.h',
'optimizer_pass.cc',
'optimizer_pass.h',
'optimizer_passes.h',
'tracing.h',
],
'includes': [
'passes/sources.gypi',
],
}

View File

@@ -1,5 +1,21 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'tracing.h',
'x64_assembler.cc',
'x64_assembler.h',
'x64_backend.cc',
'x64_backend.h',
'x64_codegen.cc',
'x64_codegen.h',
'x64_emitter.cc',
'x64_emitter.h',
'x64_function.cc',
'x64_function.h',
],
'includes': [
'lir/sources.gypi',
'optimizer/sources.gypi',
],
}

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File

View File