summaryrefslogtreecommitdiff
path: root/src/compiler_llvm/gbc_expander.cc
diff options
context:
space:
mode:
author TDYa127 <tdy@google.com> 2012-09-11 15:14:42 -0700
committer Shih-wei Liao <sliao@google.com> 2012-09-15 04:51:25 -0700
commit55e5e6c5702e3f1f68bd83ae741af769740d9a74 (patch)
tree5f08ced0306436fdfdae2977d643aa5f1f3e09f6 /src/compiler_llvm/gbc_expander.cc
parent920be7cac2aa06f9d5c8b2db87db116b1cad3159 (diff)
Fix quick fly2iceland after rebase.
Change-Id: I844f005782b3ecdcb52dc2484d44f4ae34e1c670
Diffstat (limited to 'src/compiler_llvm/gbc_expander.cc')
-rw-r--r--src/compiler_llvm/gbc_expander.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/compiler_llvm/gbc_expander.cc b/src/compiler_llvm/gbc_expander.cc
index 710d54070b..89dcf1dd03 100644
--- a/src/compiler_llvm/gbc_expander.cc
+++ b/src/compiler_llvm/gbc_expander.cc
@@ -73,7 +73,7 @@ class GBCExpanderPass : public llvm::FunctionPass {
std::vector<llvm::BasicBlock*> basic_blocks_;
std::vector<llvm::BasicBlock*> basic_block_landing_pads_;
- llvm::BasicBlock* old_basic_block_;
+ llvm::BasicBlock* current_bb_;
std::map<llvm::BasicBlock*, std::vector<std::pair<llvm::BasicBlock*, llvm::BasicBlock*> > >
landing_pad_phi_mapping_;
llvm::BasicBlock* basic_block_unwind_;
@@ -454,7 +454,7 @@ void GBCExpanderPass::RewriteFunction() {
// Set insert point to current basic block.
irb_.SetInsertPoint(bb_iter);
- old_basic_block_ = bb_iter->getUniquePredecessor();
+ current_bb_ = bb_iter;
// Rewrite the basic block
RewriteBasicBlock(bb_iter);
@@ -2675,7 +2675,7 @@ llvm::BasicBlock* GBCExpanderPass::GetUnwindBasicBlock() {
void GBCExpanderPass::EmitBranchExceptionLandingPad(uint32_t dex_pc) {
if (llvm::BasicBlock* lpad = GetLandingPadBasicBlock(dex_pc)) {
- landing_pad_phi_mapping_[lpad].push_back(std::make_pair(old_basic_block_,
+ landing_pad_phi_mapping_[lpad].push_back(std::make_pair(current_bb_->getUniquePredecessor(),
irb_.GetInsertBlock()));
irb_.CreateBr(lpad);
} else {
@@ -2689,7 +2689,7 @@ void GBCExpanderPass::EmitGuard_ExceptionLandingPad(uint32_t dex_pc) {
llvm::BasicBlock* block_cont = CreateBasicBlockWithDexPC(dex_pc, "cont");
if (llvm::BasicBlock* lpad = GetLandingPadBasicBlock(dex_pc)) {
- landing_pad_phi_mapping_[lpad].push_back(std::make_pair(old_basic_block_,
+ landing_pad_phi_mapping_[lpad].push_back(std::make_pair(current_bb_->getUniquePredecessor(),
irb_.GetInsertBlock()));
irb_.CreateCondBr(exception_pending, lpad, block_cont, kUnlikely);
} else {
@@ -3612,6 +3612,7 @@ GBCExpanderPass::ExpandIntrinsic(IntrinsicHelper::IntrinsicId intr_id,
//==- Exception --------------------------------------------------------==//
case IntrinsicHelper::CatchTargets: {
+ UpdatePhiInstruction(current_bb_, irb_.GetInsertBlock());
llvm::SwitchInst* si = llvm::dyn_cast<llvm::SwitchInst>(call_inst.getNextNode());
CHECK(si != NULL);
irb_.CreateBr(si->getDefaultDest());