diff options
| author | 2012-04-13 12:36:57 -0700 | |
|---|---|---|
| committer | 2012-04-15 03:09:41 -0700 | |
| commit | d668a06b5dcc3b0f7f788da4d756cd4ee6f1d0fa (patch) | |
| tree | 7795e95e138821e57b738cd452850a5d52bb4899 /src/compiler_llvm/compilation_unit.cc | |
| parent | 0dae08ead9112adb81ad507b81187f00f77bc168 (diff) | |
Implement runtime support inlining.
Change-Id: I8608b246a4dfde9959b5b86872f65dfa61646c84
Diffstat (limited to 'src/compiler_llvm/compilation_unit.cc')
| -rw-r--r-- | src/compiler_llvm/compilation_unit.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/compiler_llvm/compilation_unit.cc b/src/compiler_llvm/compilation_unit.cc index b3a9c714cf..fde023c914 100644 --- a/src/compiler_llvm/compilation_unit.cc +++ b/src/compiler_llvm/compilation_unit.cc @@ -20,6 +20,9 @@ #include "ir_builder.h" #include "logging.h" +#include "runtime_support_builder_arm.h" +#include "runtime_support_builder_x86.h" + #include <llvm/ADT/OwningPtr.h> #include <llvm/ADT/StringSet.h> #include <llvm/ADT/Triple.h> @@ -70,6 +73,24 @@ CompilationUnit::CompilationUnit(InstructionSet insn_set, size_t elf_idx) // Create IRBuilder irb_.reset(new IRBuilder(*context_, *module_)); + + // We always need a switch case, so just use a normal function. + switch(insn_set_) { + default: + runtime_support_.reset(new RuntimeSupportBuilder(*context_, *module_, *irb_)); + break; + case kArm: + case kThumb2: + runtime_support_.reset(new RuntimeSupportBuilderARM(*context_, *module_, *irb_)); + break; + case kX86: + runtime_support_.reset(new RuntimeSupportBuilderX86(*context_, *module_, *irb_)); + break; + } + + runtime_support_->OptimizeRuntimeSupport(); + + irb_->SetRuntimeSupport(runtime_support_.get()); } |