From e6a7adc91696930dae60c3d0eac46473a74d9941 Mon Sep 17 00:00:00 2001 From: Shih-wei Liao Date: Wed, 9 May 2012 02:50:08 -0700 Subject: Fix LLVM build for gcc 4.6. -Werror=unused-but-set-variable. Also, remove dead code (CreateAlloca) and optimize the code. Change-Id: I0474e67f5e4f802cd785db11257d2049f1bffd16 --- src/compiler_llvm/method_compiler.cc | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/compiler_llvm/method_compiler.cc') diff --git a/src/compiler_llvm/method_compiler.cc b/src/compiler_llvm/method_compiler.cc index d61c913524..cbad3f9668 100644 --- a/src/compiler_llvm/method_compiler.cc +++ b/src/compiler_llvm/method_compiler.cc @@ -2845,13 +2845,6 @@ void MethodCompiler::EmitInsn_Invoke(uint32_t dex_pc, llvm::BasicBlock* block_stub = CreateBasicBlockWithDexPC(dex_pc, "stub"); llvm::BasicBlock* block_continue = CreateBasicBlockWithDexPC(dex_pc, "cont"); - llvm::Type* accurate_ret_type = irb_.getJType(ret_shorty, kAccurate); - llvm::Value* retval_addr = NULL; - if (ret_shorty != 'V') { - retval_addr = irb_.CreateAlloca(accurate_ret_type); - } - - llvm::Value* code_addr_int = irb_.CreatePtrToInt(code_addr, irb_.getPtrEquivIntTy()); llvm::Value* max_stub_int = irb_.getPtrEquivInt(special_stub::kMaxSpecialStub); llvm::Value* is_stub = irb_.CreateICmpULT(code_addr_int, max_stub_int); @@ -2902,6 +2895,7 @@ void MethodCompiler::EmitInsn_Invoke(uint32_t dex_pc, // TODO: Remove this after we solve the proxy trampoline calling convention problem. irb_.CreateCall(irb_.GetRuntime(ProxyInvokeHandler), args); if (ret_shorty != 'V') { + llvm::Type* accurate_ret_type = irb_.getJType(ret_shorty, kAccurate); llvm::Value* result_addr = irb_.CreateBitCast(temp_space_addr, accurate_ret_type->getPointerTo()); llvm::Value* retval = irb_.CreateLoad(result_addr, kTBAAStackTemp); -- cgit v1.2.3-59-g8ed1b