summaryrefslogtreecommitdiff
path: root/src/compiler_llvm/method_compiler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler_llvm/method_compiler.cc')
-rw-r--r--src/compiler_llvm/method_compiler.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/compiler_llvm/method_compiler.cc b/src/compiler_llvm/method_compiler.cc
index 90731d686a..2d69290e8b 100644
--- a/src/compiler_llvm/method_compiler.cc
+++ b/src/compiler_llvm/method_compiler.cc
@@ -139,6 +139,11 @@ llvm::FunctionType* MethodCompiler::GetFunctionType(uint32_t method_idx,
void MethodCompiler::EmitPrologue() {
// Create basic blocks for prologue
+#if !defined(NDEBUG)
+ // Add a BasicBlock named as PrettyMethod for debugging.
+ llvm::BasicBlock* entry =
+ llvm::BasicBlock::Create(*context_, PrettyMethod(method_idx_, *dex_file_), func_);
+#endif
basic_block_reg_alloca_ =
llvm::BasicBlock::Create(*context_, "prologue.alloca", func_);
@@ -151,6 +156,11 @@ void MethodCompiler::EmitPrologue() {
basic_block_reg_arg_init_ =
llvm::BasicBlock::Create(*context_, "prologue.arginit", func_);
+#if !defined(NDEBUG)
+ irb_.SetInsertPoint(entry);
+ irb_.CreateBr(basic_block_reg_alloca_);
+#endif
+
// Create register array
for (uint16_t r = 0; r < code_item_->registers_size_; ++r) {
regs_.push_back(DalvikReg::CreateLocalVarReg(*this, r));
@@ -3660,9 +3670,9 @@ CreateBasicBlockWithDexPC(uint32_t dex_pc, char const* postfix) {
std::string name;
if (postfix) {
- StringAppendF(&name, "B%u.%s", dex_pc, postfix);
+ StringAppendF(&name, "B%04x.%s", dex_pc, postfix);
} else {
- StringAppendF(&name, "B%u", dex_pc);
+ StringAppendF(&name, "B%04x", dex_pc);
}
return llvm::BasicBlock::Create(*context_, name, func_);