diff options
| author | 2012-07-11 20:50:22 -0700 | |
|---|---|---|
| committer | 2012-09-15 04:15:18 -0700 | |
| commit | 1f196f1c338487d53d16fb132c619d6f5941a065 (patch) | |
| tree | 00eb81d7049fb051a1ebc4d6b8c66c37fe19eb50 /src/compiler_llvm/ir_builder.cc | |
| parent | d54a23d0bfe93e4b0d14d857ac9cc0d317a1c4bb (diff) | |
Use MDBuilder to build metadata.
Change-Id: I7e6872bf46c5e064a8cc936edfd18566610d80d5
Diffstat (limited to 'src/compiler_llvm/ir_builder.cc')
| -rw-r--r-- | src/compiler_llvm/ir_builder.cc | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/src/compiler_llvm/ir_builder.cc b/src/compiler_llvm/ir_builder.cc index d93b5885d0..8ee4f3ede8 100644 --- a/src/compiler_llvm/ir_builder.cc +++ b/src/compiler_llvm/ir_builder.cc @@ -19,8 +19,6 @@ #include <llvm/Module.h> -#include <algorithm> - namespace art { namespace compiler_llvm { @@ -30,7 +28,7 @@ namespace compiler_llvm { //---------------------------------------------------------------------------- IRBuilder::IRBuilder(llvm::LLVMContext& context, llvm::Module& module) -: LLVMIRBuilder(context), module_(&module), tbaa_(context) { +: LLVMIRBuilder(context), module_(&module), mdb_(context) { // Get java object type from module llvm::Type* jobject_struct_type = module.getTypeByName("JavaObject"); @@ -46,22 +44,6 @@ IRBuilder::IRBuilder(llvm::LLVMContext& context, llvm::Module& module) CHECK(art_frame_type_ != NULL); runtime_support_ = NULL; - - - // Pre-generate the MDNode for static branch prediction - llvm::Type* int32ty = llvm::Type::getInt32Ty(context); - llvm::MDString* branch_weights = llvm::MDString::get(context, "branch_weights"); - llvm::Constant* likely = llvm::ConstantInt::get(int32ty, 64); - llvm::Constant* unlikely = llvm::ConstantInt::get(int32ty, 4); - llvm::Value *opts[] = { - branch_weights, - likely, - unlikely - }; - - expect_cond_[kLikely] = llvm::MDNode::get(context, opts); - std::swap(opts[1], opts[2]); - expect_cond_[kUnlikely] = llvm::MDNode::get(context, opts); } |