summaryrefslogtreecommitdiffstats
path: root/compiler/llvm
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2014-05-19 16:49:03 -0700
committerIan Rogers <irogers@google.com>2014-05-19 22:27:39 -0700
commit700a402244a1a423da4f3ba8032459f4b65fa18f (patch)
tree4c22fcda04d271bd55a37aff30650214af17a90c /compiler/llvm
parent047c11adcbcbc0bcf210defdfcbada763961ffee (diff)
downloadart-700a402244a1a423da4f3ba8032459f4b65fa18f.tar.gz
art-700a402244a1a423da4f3ba8032459f4b65fa18f.tar.bz2
art-700a402244a1a423da4f3ba8032459f4b65fa18f.zip
Now we have a proper C++ library, use std::unique_ptr.
Also remove the Android.libcxx.mk and other bits of stlport compatibility mechanics. Change-Id: Icdf7188ba3c79cdf5617672c1cfd0a68ae596a61
Diffstat (limited to 'compiler/llvm')
-rw-r--r--compiler/llvm/compiler_llvm.cc6
-rw-r--r--compiler/llvm/compiler_llvm.h11
-rw-r--r--compiler/llvm/gbc_expander.cc4
-rw-r--r--compiler/llvm/llvm_compilation_unit.cc4
-rw-r--r--compiler/llvm/llvm_compilation_unit.h18
5 files changed, 21 insertions, 22 deletions
diff --git a/compiler/llvm/compiler_llvm.cc b/compiler/llvm/compiler_llvm.cc
index df895ee07d..5990e8caea 100644
--- a/compiler/llvm/compiler_llvm.cc
+++ b/compiler/llvm/compiler_llvm.cc
@@ -136,7 +136,7 @@ LlvmCompilationUnit* CompilerLLVM::AllocateCompilationUnit() {
CompiledMethod* CompilerLLVM::
CompileDexMethod(DexCompilationUnit* dex_compilation_unit, InvokeType invoke_type) {
- UniquePtr<LlvmCompilationUnit> cunit(AllocateCompilationUnit());
+ std::unique_ptr<LlvmCompilationUnit> cunit(AllocateCompilationUnit());
cunit->SetDexCompilationUnit(dex_compilation_unit);
cunit->SetCompilerDriver(compiler_driver_);
@@ -163,9 +163,9 @@ CompileDexMethod(DexCompilationUnit* dex_compilation_unit, InvokeType invoke_typ
CompiledMethod* CompilerLLVM::
CompileNativeMethod(DexCompilationUnit* dex_compilation_unit) {
- UniquePtr<LlvmCompilationUnit> cunit(AllocateCompilationUnit());
+ std::unique_ptr<LlvmCompilationUnit> cunit(AllocateCompilationUnit());
- UniquePtr<JniCompiler> jni_compiler(
+ std::unique_ptr<JniCompiler> jni_compiler(
new JniCompiler(cunit.get(), compiler_driver_, dex_compilation_unit));
return jni_compiler->Compile();
diff --git a/compiler/llvm/compiler_llvm.h b/compiler/llvm/compiler_llvm.h
index c2211fb92c..cc74deb7be 100644
--- a/compiler/llvm/compiler_llvm.h
+++ b/compiler/llvm/compiler_llvm.h
@@ -17,18 +17,17 @@
#ifndef ART_COMPILER_LLVM_COMPILER_LLVM_H_
#define ART_COMPILER_LLVM_COMPILER_LLVM_H_
+#include <memory>
+#include <string>
+#include <utility>
+#include <vector>
+
#include "base/macros.h"
#include "dex_file.h"
#include "driver/compiler_driver.h"
#include "instruction_set.h"
#include "mirror/object.h"
-#include <UniquePtr.h>
-
-#include <string>
-#include <utility>
-#include <vector>
-
namespace art {
class CompiledMethod;
class CompilerDriver;
diff --git a/compiler/llvm/gbc_expander.cc b/compiler/llvm/gbc_expander.cc
index cf28db3bfc..25c9b20514 100644
--- a/compiler/llvm/gbc_expander.cc
+++ b/compiler/llvm/gbc_expander.cc
@@ -141,7 +141,7 @@ class GBCExpanderPass : public llvm::FunctionPass {
std::vector<llvm::BasicBlock*> basic_block_landing_pads_;
llvm::BasicBlock* current_bb_;
- std::map<llvm::BasicBlock*, std::vector<std::pair<llvm::BasicBlock*, llvm::BasicBlock*> > >
+ std::map<llvm::BasicBlock*, std::vector<std::pair<llvm::BasicBlock*, llvm::BasicBlock*>>>
landing_pad_phi_mapping_;
llvm::BasicBlock* basic_block_unwind_;
@@ -545,7 +545,7 @@ void GBCExpanderPass::RewriteFunction() {
}
llvm::TerminatorInst* term_inst = lbb->getTerminator();
- std::vector<std::pair<llvm::BasicBlock*, llvm::BasicBlock*> >& rewrite_pair
+ std::vector<std::pair<llvm::BasicBlock*, llvm::BasicBlock*>>& rewrite_pair
= landing_pad_phi_mapping_[lbb];
irb_.SetInsertPoint(lbb->begin());
diff --git a/compiler/llvm/llvm_compilation_unit.cc b/compiler/llvm/llvm_compilation_unit.cc
index 78bdb4dbfb..741c2d7748 100644
--- a/compiler/llvm/llvm_compilation_unit.cc
+++ b/compiler/llvm/llvm_compilation_unit.cc
@@ -152,7 +152,7 @@ void LlvmCompilationUnit::DumpBitcodeToFile() {
std::string bitcode;
DumpBitcodeToString(bitcode);
std::string filename(StringPrintf("%s/Art%zu.bc", DumpDirectory().c_str(), cunit_id_));
- UniquePtr<File> output(OS::CreateEmptyFile(filename.c_str()));
+ std::unique_ptr<File> output(OS::CreateEmptyFile(filename.c_str()));
output->WriteFully(bitcode.data(), bitcode.size());
LOG(INFO) << ".bc file written successfully: " << filename;
}
@@ -179,7 +179,7 @@ bool LlvmCompilationUnit::Materialize() {
if (kDumpELF) {
// Dump the ELF image for debugging
std::string filename(StringPrintf("%s/Art%zu.o", DumpDirectory().c_str(), cunit_id_));
- UniquePtr<File> output(OS::CreateEmptyFile(filename.c_str()));
+ std::unique_ptr<File> output(OS::CreateEmptyFile(filename.c_str()));
output->WriteFully(elf_object_.data(), elf_object_.size());
LOG(INFO) << ".o file written successfully: " << filename;
}
diff --git a/compiler/llvm/llvm_compilation_unit.h b/compiler/llvm/llvm_compilation_unit.h
index 58aa6fd545..f11fb6ed23 100644
--- a/compiler/llvm/llvm_compilation_unit.h
+++ b/compiler/llvm/llvm_compilation_unit.h
@@ -17,6 +17,10 @@
#ifndef ART_COMPILER_LLVM_LLVM_COMPILATION_UNIT_H_
#define ART_COMPILER_LLVM_LLVM_COMPILATION_UNIT_H_
+#include <memory>
+#include <string>
+#include <vector>
+
#include "base/logging.h"
#include "base/mutex.h"
#include "dex/compiler_internals.h"
@@ -28,10 +32,6 @@
#include "runtime_support_llvm_func.h"
#include "safe_map.h"
-#include <UniquePtr.h>
-#include <string>
-#include <vector>
-
namespace art {
class CompiledMethod;
}
@@ -106,12 +106,12 @@ class LlvmCompilationUnit {
const CompilerLLVM* compiler_llvm_;
const size_t cunit_id_;
- UniquePtr< ::llvm::LLVMContext> context_;
- UniquePtr<IRBuilder> irb_;
- UniquePtr<RuntimeSupportBuilder> runtime_support_;
+ std::unique_ptr< ::llvm::LLVMContext> context_;
+ std::unique_ptr<IRBuilder> irb_;
+ std::unique_ptr<RuntimeSupportBuilder> runtime_support_;
::llvm::Module* module_; // Managed by context_
- UniquePtr<IntrinsicHelper> intrinsic_helper_;
- UniquePtr<LLVMInfo> llvm_info_;
+ std::unique_ptr<IntrinsicHelper> intrinsic_helper_;
+ std::unique_ptr<LLVMInfo> llvm_info_;
CompilerDriver* driver_;
DexCompilationUnit* dex_compilation_unit_;