GBC Expander. Removed lir.

Change-Id: If8d13e36f1e6d82c2a7f7bfec62b8fb41fd8cdaa
diff --git a/src/compiler_llvm/compilation_unit.cc b/src/compiler_llvm/compilation_unit.cc
index f84ebf4..87fd724 100644
--- a/src/compiler_llvm/compilation_unit.cc
+++ b/src/compiler_llvm/compilation_unit.cc
@@ -136,6 +136,12 @@
 namespace art {
 namespace compiler_llvm {
 
+#ifdef ART_USE_DEXLANG_FRONTEND
+llvm::FunctionPass*
+CreateGBCExpanderPass(const greenland::IntrinsicHelper& intrinsic_helper,
+                      IRBuilder& irb);
+#endif
+
 llvm::Module* makeLLVMModuleContents(llvm::Module* module);
 
 
@@ -148,6 +154,10 @@
   module_ = new llvm::Module("art", *context_);
   makeLLVMModuleContents(module_);
 
+#ifdef ART_USE_DEXLANG_FRONTEND
+  dex_lang_ctx_ = new greenland::DexLang::Context(*module_);
+#endif
+
   // Create IRBuilder
   irb_.reset(new IRBuilder(*context_, *module_));
 
@@ -174,6 +184,9 @@
 
 
 CompilationUnit::~CompilationUnit() {
+#ifdef ART_USE_DEXLANG_FRONTEND
+  delete dex_lang_ctx_;
+#endif
 }
 
 
@@ -291,10 +304,16 @@
   if (bitcode_filename_.empty()) {
     // If we don't need write the bitcode to file, add the AddSuspendCheckToLoopLatchPass to the
     // regular FunctionPass.
+#ifdef ART_USE_DEXLANG_FRONTEND
+    fpm.add(CreateGBCExpanderPass(dex_lang_ctx_->GetIntrinsicHelper(), *irb_.get()));
+#endif
     fpm.add(new ::AddSuspendCheckToLoopLatchPass(irb_.get()));
   } else {
     // Run AddSuspendCheckToLoopLatchPass before we write the bitcode to file.
     llvm::FunctionPassManager fpm2(module_);
+#ifdef ART_USE_DEXLANG_FRONTEND
+    fpm2.add(CreateGBCExpanderPass(dex_lang_ctx_->GetIntrinsicHelper(), *irb_.get()));
+#endif
     fpm2.add(new ::AddSuspendCheckToLoopLatchPass(irb_.get()));
     fpm2.doInitialization();
     for (llvm::Module::iterator F = module_->begin(), E = module_->end();