GBC Expander. Removed lir.

Change-Id: If8d13e36f1e6d82c2a7f7bfec62b8fb41fd8cdaa
diff --git a/src/compiler/codegen/MethodBitcode.cc b/src/compiler/codegen/MethodBitcode.cc
index 25aae11..dae9b16 100644
--- a/src/compiler/codegen/MethodBitcode.cc
+++ b/src/compiler/codegen/MethodBitcode.cc
@@ -267,7 +267,7 @@
                           RegLocation rlArray)
 {
   greenland::IntrinsicHelper::IntrinsicId id;
-  id = greenland::IntrinsicHelper::FillArrayData;
+  id = greenland::IntrinsicHelper::HLFillArrayData;
   llvm::SmallVector<llvm::Value*, 2> args;
   args.push_back(cUnit->irb->getInt32(offset));
   args.push_back(getLLVMValue(cUnit, rlArray.origSReg));
@@ -340,7 +340,7 @@
 {
   llvm::Value* src = getLLVMValue(cUnit, rlSrc.origSReg);
   llvm::Function* func = cUnit->intrinsic_helper->GetIntrinsicFunction(
-      greenland::IntrinsicHelper::Throw);
+      greenland::IntrinsicHelper::ThrowException);
   cUnit->irb->CreateCall(func, src);
 }
 
@@ -362,7 +362,7 @@
   args.push_back(cUnit->irb->getInt32(optFlags));
   args.push_back(getLLVMValue(cUnit, rlSrc.origSReg));
   llvm::Function* func = cUnit->intrinsic_helper->GetIntrinsicFunction(
-      greenland::IntrinsicHelper::ArrayLength);
+      greenland::IntrinsicHelper::OptArrayLength);
   llvm::Value* res = cUnit->irb->CreateCall(func, args);
   defineValue(cUnit, res, rlDest.origSReg);
 }
@@ -584,7 +584,7 @@
    */
   greenland::IntrinsicHelper::IntrinsicId id;
   if (isFilledNewArray) {
-    id = greenland::IntrinsicHelper::FilledNewArray;
+    id = greenland::IntrinsicHelper::HLFilledNewArray;
   } else if (info->result.location == kLocInvalid) {
     id = greenland::IntrinsicHelper::HLInvokeVoid;
   } else {
@@ -623,7 +623,7 @@
                       RegLocation rlSrc)
 {
   greenland::IntrinsicHelper::IntrinsicId id;
-  id = greenland::IntrinsicHelper::CheckCast;
+  id = greenland::IntrinsicHelper::HLCheckCast;
   llvm::Function* intr = cUnit->intrinsic_helper->GetIntrinsicFunction(id);
   llvm::SmallVector<llvm::Value*, 2> args;
   args.push_back(cUnit->irb->getInt32(type_idx));
@@ -1759,8 +1759,10 @@
 {
   if (bb->blockType == kDead) return false;
   llvm::BasicBlock* llvmBB = getLLVMBlock(cUnit, bb->id);
-  cUnit->irb->SetInsertPoint(llvmBB);
-  setDexOffset(cUnit, bb->startOffset);
+  if (llvmBB != NULL) {
+    cUnit->irb->SetInsertPoint(llvmBB);
+    setDexOffset(cUnit, bb->startOffset);
+  }
 
   if (cUnit->printMe) {
     LOG(INFO) << "................................";
@@ -3012,10 +3014,10 @@
               case greenland::IntrinsicHelper::HLInvokeVoid:
                 cvtInvoke(cUnit, callInst, true /* isVoid */, false /* newArray */);
                 break;
-              case greenland::IntrinsicHelper::FilledNewArray:
+              case greenland::IntrinsicHelper::HLFilledNewArray:
                 cvtInvoke(cUnit, callInst, false /* isVoid */, true /* newArray */);
                 break;
-              case greenland::IntrinsicHelper::FillArrayData:
+              case greenland::IntrinsicHelper::HLFillArrayData:
                 cvtFillArrayData(cUnit, callInst);
                 break;
               case greenland::IntrinsicHelper::ConstString:
@@ -3024,7 +3026,7 @@
               case greenland::IntrinsicHelper::ConstClass:
                 cvtConstObject(cUnit, callInst, false /* isString */);
                 break;
-              case greenland::IntrinsicHelper::CheckCast:
+              case greenland::IntrinsicHelper::HLCheckCast:
                 cvtCheckCast(cUnit, callInst);
                 break;
               case greenland::IntrinsicHelper::NewInstance:
@@ -3063,7 +3065,7 @@
               case greenland::IntrinsicHelper::GetException:
                 cvtMoveException(cUnit, callInst);
                 break;
-              case greenland::IntrinsicHelper::Throw:
+              case greenland::IntrinsicHelper::ThrowException:
                 cvtThrow(cUnit, callInst);
                 break;
               case greenland::IntrinsicHelper::MonitorEnter:
@@ -3072,7 +3074,7 @@
               case greenland::IntrinsicHelper::MonitorExit:
                 cvtMonitorEnterExit(cUnit, false /* isEnter */, callInst);
                 break;
-              case greenland::IntrinsicHelper::ArrayLength:
+              case greenland::IntrinsicHelper::OptArrayLength:
                 cvtArrayLength(cUnit, callInst);
                 break;
               case greenland::IntrinsicHelper::NewArray: