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
diff --git a/compiler/dex/compiler_ir.h b/compiler/dex/compiler_ir.h
index 70159ca..35d777e 100644
--- a/compiler/dex/compiler_ir.h
+++ b/compiler/dex/compiler_ir.h
@@ -85,8 +85,8 @@
ArenaAllocator arena;
ArenaStack arena_stack; // Arenas for ScopedArenaAllocator.
- UniquePtr<MIRGraph> mir_graph; // MIR container.
- UniquePtr<Backend> cg; // Target-specific codegen.
+ std::unique_ptr<MIRGraph> mir_graph; // MIR container.
+ std::unique_ptr<Backend> cg; // Target-specific codegen.
TimingLogger timings;
};
diff --git a/compiler/dex/frontend.h b/compiler/dex/frontend.h
index f714ecd..c3b8d12 100644
--- a/compiler/dex/frontend.h
+++ b/compiler/dex/frontend.h
@@ -101,10 +101,10 @@
}
private:
- UniquePtr< ::llvm::LLVMContext> llvm_context_;
+ std::unique_ptr< ::llvm::LLVMContext> llvm_context_;
::llvm::Module* llvm_module_; // Managed by context_.
- UniquePtr<art::llvm::IntrinsicHelper> intrinsic_helper_;
- UniquePtr<art::llvm::IRBuilder> ir_builder_;
+ std::unique_ptr<art::llvm::IntrinsicHelper> intrinsic_helper_;
+ std::unique_ptr<art::llvm::IRBuilder> ir_builder_;
};
class CompiledMethod;
diff --git a/compiler/dex/local_value_numbering.h b/compiler/dex/local_value_numbering.h
index 7049f8c..0c2b6a7 100644
--- a/compiler/dex/local_value_numbering.h
+++ b/compiler/dex/local_value_numbering.h
@@ -17,8 +17,9 @@
#ifndef ART_COMPILER_DEX_LOCAL_VALUE_NUMBERING_H_
#define ART_COMPILER_DEX_LOCAL_VALUE_NUMBERING_H_
+#include <memory>
+
#include "compiler_internals.h"
-#include "UniquePtrCompat.h"
#include "utils/scoped_arena_allocator.h"
#include "utils/scoped_arena_containers.h"
@@ -89,7 +90,7 @@
public:
static LocalValueNumbering* Create(CompilationUnit* cu) {
- UniquePtr<ScopedArenaAllocator> allocator(ScopedArenaAllocator::Create(&cu->arena_stack));
+ std::unique_ptr<ScopedArenaAllocator> allocator(ScopedArenaAllocator::Create(&cu->arena_stack));
void* addr = allocator->Alloc(sizeof(LocalValueNumbering), kArenaAllocMisc);
return new(addr) LocalValueNumbering(cu, allocator.release());
}
@@ -195,7 +196,7 @@
void HandlePutObject(MIR* mir);
CompilationUnit* const cu_;
- UniquePtr<ScopedArenaAllocator> allocator_;
+ std::unique_ptr<ScopedArenaAllocator> allocator_;
SregValueMap sreg_value_map_;
SregValueMap sreg_wide_value_map_;
ValueMap value_map_;
diff --git a/compiler/dex/local_value_numbering_test.cc b/compiler/dex/local_value_numbering_test.cc
index ebac871..2b1c420 100644
--- a/compiler/dex/local_value_numbering_test.cc
+++ b/compiler/dex/local_value_numbering_test.cc
@@ -181,7 +181,7 @@
MIR* mirs_;
std::vector<SSARepresentation> ssa_reps_;
std::vector<uint16_t> value_names_;
- UniquePtr<LocalValueNumbering> lvn_;
+ std::unique_ptr<LocalValueNumbering> lvn_;
};
TEST_F(LocalValueNumberingTest, TestIGetIGetInvokeIGet) {
diff --git a/compiler/dex/mir_analysis.cc b/compiler/dex/mir_analysis.cc
index 1c9e2e2..508f1c7 100644
--- a/compiler/dex/mir_analysis.cc
+++ b/compiler/dex/mir_analysis.cc
@@ -15,6 +15,8 @@
*/
#include <algorithm>
+#include <memory>
+
#include "compiler_internals.h"
#include "dataflow_iterator-inl.h"
#include "dex_instruction.h"
@@ -23,7 +25,6 @@
#include "dex/quick/dex_file_method_inliner.h"
#include "dex/quick/dex_file_to_method_inliner_map.h"
#include "driver/compiler_options.h"
-#include "UniquePtrCompat.h"
#include "utils/scoped_arena_containers.h"
namespace art {
diff --git a/compiler/dex/mir_graph.h b/compiler/dex/mir_graph.h
index 85a2d04..778a92d 100644
--- a/compiler/dex/mir_graph.h
+++ b/compiler/dex/mir_graph.h
@@ -979,7 +979,7 @@
int* i_dom_list_;
ArenaBitVector** def_block_matrix_; // num_dalvik_register x num_blocks.
ArenaBitVector* temp_dalvik_register_v_;
- UniquePtr<ScopedArenaAllocator> temp_scoped_alloc_;
+ std::unique_ptr<ScopedArenaAllocator> temp_scoped_alloc_;
uint16_t* temp_insn_data_;
uint32_t temp_bit_vector_size_;
ArenaBitVector* temp_bit_vector_;
diff --git a/compiler/dex/mir_optimization.cc b/compiler/dex/mir_optimization.cc
index 8e8a593..749a235 100644
--- a/compiler/dex/mir_optimization.cc
+++ b/compiler/dex/mir_optimization.cc
@@ -311,7 +311,7 @@
return true;
}
bool use_lvn = bb->use_lvn;
- UniquePtr<LocalValueNumbering> local_valnum;
+ std::unique_ptr<LocalValueNumbering> local_valnum;
if (use_lvn) {
local_valnum.reset(LocalValueNumbering::Create(cu_));
}
diff --git a/compiler/dex/quick/codegen_util.cc b/compiler/dex/quick/codegen_util.cc
index 6f81238..d58015a 100644
--- a/compiler/dex/quick/codegen_util.cc
+++ b/compiler/dex/quick/codegen_util.cc
@@ -1026,7 +1026,7 @@
vmap_encoder.PushBackUnsigned(0u); // Size is 0.
}
- UniquePtr<std::vector<uint8_t> > cfi_info(ReturnCallFrameInformation());
+ std::unique_ptr<std::vector<uint8_t>> cfi_info(ReturnCallFrameInformation());
CompiledMethod* result =
new CompiledMethod(cu_->compiler_driver, cu_->instruction_set, code_buffer_, frame_size_,
core_spill_mask_, fp_spill_mask_, encoded_mapping_table_,
diff --git a/compiler/dex/ssa_transformation.cc b/compiler/dex/ssa_transformation.cc
index 5f89c21..5aa093a 100644
--- a/compiler/dex/ssa_transformation.cc
+++ b/compiler/dex/ssa_transformation.cc
@@ -182,7 +182,7 @@
dom_post_order_traversal_->Reset();
}
ClearAllVisitedFlags();
- std::vector<std::pair<BasicBlock*, ArenaBitVector::Iterator*> > work_stack;
+ std::vector<std::pair<BasicBlock*, ArenaBitVector::Iterator*>> work_stack;
bb->visited = true;
work_stack.push_back(std::make_pair(bb, bb->i_dominated->GetIterator()));
while (!work_stack.empty()) {
diff --git a/compiler/dex/verified_method.cc b/compiler/dex/verified_method.cc
index e19f3cf..01c8f80 100644
--- a/compiler/dex/verified_method.cc
+++ b/compiler/dex/verified_method.cc
@@ -17,6 +17,7 @@
#include "verified_method.h"
#include <algorithm>
+#include <memory>
#include <vector>
#include "base/logging.h"
@@ -34,7 +35,6 @@
#include "mirror/dex_cache-inl.h"
#include "mirror/object.h"
#include "mirror/object-inl.h"
-#include "UniquePtrCompat.h"
#include "verifier/dex_gc_map.h"
#include "verifier/method_verifier.h"
#include "verifier/method_verifier-inl.h"
@@ -45,7 +45,7 @@
const VerifiedMethod* VerifiedMethod::Create(verifier::MethodVerifier* method_verifier,
bool compile) {
- UniquePtr<VerifiedMethod> verified_method(new VerifiedMethod);
+ std::unique_ptr<VerifiedMethod> verified_method(new VerifiedMethod);
if (compile) {
/* Generate a register map. */
if (!verified_method->GenerateGcMap(method_verifier)) {