From 21d28f510eb590f52810c83f1f3f37fe5f4adf46 Mon Sep 17 00:00:00 2001 From: Shih-wei Liao Date: Tue, 12 Jun 2012 05:55:00 -0700 Subject: GBC Expander. Removed lir. Change-Id: If8d13e36f1e6d82c2a7f7bfec62b8fb41fd8cdaa --- src/compiler_llvm/compiler_llvm.cc | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/compiler_llvm/compiler_llvm.cc') diff --git a/src/compiler_llvm/compiler_llvm.cc b/src/compiler_llvm/compiler_llvm.cc index b30486c6cc..dc796434df 100644 --- a/src/compiler_llvm/compiler_llvm.cc +++ b/src/compiler_llvm/compiler_llvm.cc @@ -23,11 +23,14 @@ #include "compiler.h" #include "ir_builder.h" #include "jni_compiler.h" -#include "method_compiler.h" +#ifndef ART_USE_DEXLANG_FRONTEND +# include "method_compiler.h" +#endif #include "oat_compilation_unit.h" #include "oat_file.h" #include "stl_util.h" #include "stub_compiler.h" +#include "utils_llvm.h" #include #include @@ -121,10 +124,25 @@ CompiledMethod* CompilerLLVM:: CompileDexMethod(OatCompilationUnit* oat_compilation_unit) { UniquePtr cunit(AllocateCompilationUnit()); +#ifdef ART_USE_DEXLANG_FRONTEND + // Run DexLang for Dex to Greenland Bitcode + UniquePtr dex_lang( + new greenland::DexLang(*cunit->GetDexLangContext(), *compiler_, + *oat_compilation_unit)); + + llvm::Function* func = dex_lang->Build(); + CHECK(func != NULL); + + cunit->Materialize(); + + return new CompiledMethod(cunit->GetInstructionSet(), + cunit->GetCompiledCode()); +#else UniquePtr method_compiler( new MethodCompiler(cunit.get(), compiler_, oat_compilation_unit)); return method_compiler->Compile(); +#endif } -- cgit v1.2.3-59-g8ed1b