summaryrefslogtreecommitdiffstats
path: root/compiler/dex
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/dex')
-rw-r--r--compiler/dex/arena_allocator.h2
-rw-r--r--compiler/dex/arena_bit_vector.h8
-rw-r--r--compiler/dex/backend.h4
-rw-r--r--compiler/dex/dex_to_dex_compiler.cc4
-rw-r--r--compiler/dex/frontend.cc5
-rw-r--r--compiler/dex/growable_array.h6
-rw-r--r--compiler/dex/local_value_numbering.h2
-rw-r--r--compiler/dex/mir_graph.cc7
-rw-r--r--compiler/dex/quick/arm/utility_arm.cc27
-rw-r--r--compiler/dex/quick/mips/utility_mips.cc8
-rw-r--r--compiler/dex/quick/mir_to_lir.h2
11 files changed, 39 insertions, 36 deletions
diff --git a/compiler/dex/arena_allocator.h b/compiler/dex/arena_allocator.h
index cd2141a3c3..3bd733e753 100644
--- a/compiler/dex/arena_allocator.h
+++ b/compiler/dex/arena_allocator.h
@@ -83,7 +83,7 @@ struct MemStats {
void Dump(std::ostream& os) const {
arena_.DumpMemStats(os);
}
- explicit MemStats(const ArenaAllocator &arena) : arena_(arena) {};
+ explicit MemStats(const ArenaAllocator &arena) : arena_(arena) {}
private:
const ArenaAllocator &arena_;
}; // MemStats
diff --git a/compiler/dex/arena_bit_vector.h b/compiler/dex/arena_bit_vector.h
index 2a05b77092..4ec8c886ee 100644
--- a/compiler/dex/arena_bit_vector.h
+++ b/compiler/dex/arena_bit_vector.h
@@ -36,7 +36,7 @@ class ArenaBitVector {
: p_bits_(bit_vector),
bit_storage_(bit_vector->GetRawStorage()),
bit_index_(0),
- bit_size_(p_bits_->storage_size_ * sizeof(uint32_t) * 8) {};
+ bit_size_(p_bits_->storage_size_ * sizeof(uint32_t) * 8) {}
// Return the position of the next set bit. -1 means end-of-element reached.
int Next() {
@@ -70,7 +70,7 @@ class ArenaBitVector {
return arena->NewMem(sizeof(ArenaBitVector::Iterator), true,
ArenaAllocator::kAllocGrowableBitMap);
};
- static void operator delete(void* p) {}; // Nop.
+ static void operator delete(void* p) {} // Nop.
private:
ArenaBitVector* const p_bits_;
@@ -81,12 +81,12 @@ class ArenaBitVector {
ArenaBitVector(ArenaAllocator* arena, unsigned int start_bits, bool expandable,
OatBitMapKind kind = kBitMapMisc);
- ~ArenaBitVector() {};
+ ~ArenaBitVector() {}
static void* operator new(size_t size, ArenaAllocator* arena) {
return arena->NewMem(sizeof(ArenaBitVector), true, ArenaAllocator::kAllocGrowableBitMap);
}
- static void operator delete(void* p) {}; // Nop.
+ static void operator delete(void* p) {} // Nop.
void SetBit(unsigned int num);
void ClearBit(unsigned int num);
diff --git a/compiler/dex/backend.h b/compiler/dex/backend.h
index acfec42352..01959b77f5 100644
--- a/compiler/dex/backend.h
+++ b/compiler/dex/backend.h
@@ -24,12 +24,12 @@ namespace art {
class Backend {
public:
- virtual ~Backend() {};
+ virtual ~Backend() {}
virtual void Materialize() = 0;
virtual CompiledMethod* GetCompiledMethod() = 0;
protected:
- explicit Backend(ArenaAllocator* arena) : arena_(arena) {};
+ explicit Backend(ArenaAllocator* arena) : arena_(arena) {}
ArenaAllocator* const arena_;
}; // Class Backend
diff --git a/compiler/dex/dex_to_dex_compiler.cc b/compiler/dex/dex_to_dex_compiler.cc
index 4419fed9c5..28c325726e 100644
--- a/compiler/dex/dex_to_dex_compiler.cc
+++ b/compiler/dex/dex_to_dex_compiler.cc
@@ -38,9 +38,9 @@ class DexCompiler {
DexCompiler(art::CompilerDriver& compiler,
const DexCompilationUnit& unit)
: driver_(compiler),
- unit_(unit) {};
+ unit_(unit) {}
- ~DexCompiler() {};
+ ~DexCompiler() {}
void Compile();
diff --git a/compiler/dex/frontend.cc b/compiler/dex/frontend.cc
index ae160d607d..113a80a96c 100644
--- a/compiler/dex/frontend.cc
+++ b/compiler/dex/frontend.cc
@@ -218,9 +218,8 @@ static CompiledMethod* CompileMethod(CompilerDriver& compiler,
if (compiler_backend == kPortable) {
cu->cg.reset(PortableCodeGenerator(cu.get(), cu->mir_graph.get(), &cu->arena,
llvm_compilation_unit));
- } else
+ } else {
#endif
- { // NOLINT(whitespace/braces)
switch (compiler.GetInstructionSet()) {
case kThumb2:
cu->cg.reset(ArmCodeGenerator(cu.get(), cu->mir_graph.get(), &cu->arena));
@@ -234,7 +233,9 @@ static CompiledMethod* CompileMethod(CompilerDriver& compiler,
default:
LOG(FATAL) << "Unexpected instruction set: " << compiler.GetInstructionSet();
}
+#if defined(ART_USE_PORTABLE_COMPILER)
}
+#endif
cu->cg->Materialize();
diff --git a/compiler/dex/growable_array.h b/compiler/dex/growable_array.h
index 3bfbcd4edf..08a6478e97 100644
--- a/compiler/dex/growable_array.h
+++ b/compiler/dex/growable_array.h
@@ -50,7 +50,7 @@ class GrowableArray {
public:
explicit Iterator(GrowableArray* g_list)
: idx_(0),
- g_list_(g_list) {};
+ g_list_(g_list) {}
// NOTE: returns 0/NULL when no next.
// TODO: redo to make usage consistent with other iterators.
@@ -69,7 +69,7 @@ class GrowableArray {
static void* operator new(size_t size, ArenaAllocator* arena) {
return arena->NewMem(sizeof(GrowableArray::Iterator), true, ArenaAllocator::kAllocGrowableArray);
};
- static void operator delete(void* p) {}; // Nop.
+ static void operator delete(void* p) {} // Nop.
private:
size_t idx_;
@@ -155,7 +155,7 @@ class GrowableArray {
static void* operator new(size_t size, ArenaAllocator* arena) {
return arena->NewMem(sizeof(GrowableArray<T>), true, ArenaAllocator::kAllocGrowableArray);
};
- static void operator delete(void* p) {}; // Nop.
+ static void operator delete(void* p) {} // Nop.
private:
ArenaAllocator* const arena_;
diff --git a/compiler/dex/local_value_numbering.h b/compiler/dex/local_value_numbering.h
index d29600a479..e3fd7ad2da 100644
--- a/compiler/dex/local_value_numbering.h
+++ b/compiler/dex/local_value_numbering.h
@@ -33,7 +33,7 @@ typedef SafeMap<uint32_t, uint16_t> MemoryVersionMap;
class LocalValueNumbering {
public:
- explicit LocalValueNumbering(CompilationUnit* cu) : cu_(cu) {};
+ explicit LocalValueNumbering(CompilationUnit* cu) : cu_(cu) {}
static uint64_t BuildKey(uint16_t op, uint16_t operand1, uint16_t operand2, uint16_t modifier) {
return (static_cast<uint64_t>(op) << 48 | static_cast<uint64_t>(operand1) << 32 |
diff --git a/compiler/dex/mir_graph.cc b/compiler/dex/mir_graph.cc
index 634c576874..a768a19744 100644
--- a/compiler/dex/mir_graph.cc
+++ b/compiler/dex/mir_graph.cc
@@ -1009,9 +1009,10 @@ char* MIRGraph::GetDalvikDisassembly(const MIR* mir) {
/* Turn method name into a legal Linux file name */
void MIRGraph::ReplaceSpecialChars(std::string& str) {
- static const struct { const char before; const char after; } match[] =
- {{'/', '-'}, {';', '#'}, {' ', '#'}, {'$', '+'},
- {'(', '@'}, {')', '@'}, {'<', '='}, {'>', '='}};
+ static const struct { const char before; const char after; } match[] = {
+ {'/', '-'}, {';', '#'}, {' ', '#'}, {'$', '+'},
+ {'(', '@'}, {')', '@'}, {'<', '='}, {'>', '='}
+ };
for (unsigned int i = 0; i < sizeof(match)/sizeof(match[0]); i++) {
std::replace(str.begin(), str.end(), match[i].before, match[i].after);
}
diff --git a/compiler/dex/quick/arm/utility_arm.cc b/compiler/dex/quick/arm/utility_arm.cc
index f2317f326d..f41f110822 100644
--- a/compiler/dex/quick/arm/utility_arm.cc
+++ b/compiler/dex/quick/arm/utility_arm.cc
@@ -329,16 +329,17 @@ LIR* ArmMir2Lir::OpRegRegShift(OpKind op, int r_dest_src1, int r_src2,
break;
}
DCHECK_GE(static_cast<int>(opcode), 0);
- if (EncodingMap[opcode].flags & IS_BINARY_OP)
+ if (EncodingMap[opcode].flags & IS_BINARY_OP) {
return NewLIR2(opcode, r_dest_src1, r_src2);
- else if (EncodingMap[opcode].flags & IS_TERTIARY_OP) {
- if (EncodingMap[opcode].field_loc[2].kind == kFmtShift)
+ } else if (EncodingMap[opcode].flags & IS_TERTIARY_OP) {
+ if (EncodingMap[opcode].field_loc[2].kind == kFmtShift) {
return NewLIR3(opcode, r_dest_src1, r_src2, shift);
- else
+ } else {
return NewLIR3(opcode, r_dest_src1, r_dest_src1, r_src2);
- } else if (EncodingMap[opcode].flags & IS_QUAD_OP)
+ }
+ } else if (EncodingMap[opcode].flags & IS_QUAD_OP) {
return NewLIR4(opcode, r_dest_src1, r_dest_src1, r_src2, shift);
- else {
+ } else {
LOG(FATAL) << "Unexpected encoding operand count";
return NULL;
}
@@ -406,9 +407,9 @@ LIR* ArmMir2Lir::OpRegRegRegShift(OpKind op, int r_dest, int r_src1,
break;
}
DCHECK_GE(static_cast<int>(opcode), 0);
- if (EncodingMap[opcode].flags & IS_QUAD_OP)
+ if (EncodingMap[opcode].flags & IS_QUAD_OP) {
return NewLIR4(opcode, r_dest, r_src1, r_src2, shift);
- else {
+ } else {
DCHECK(EncodingMap[opcode].flags & IS_TERTIARY_OP);
return NewLIR3(opcode, r_dest, r_src1, r_src2);
}
@@ -565,11 +566,11 @@ LIR* ArmMir2Lir::OpRegImm(OpKind op, int r_dest_src1, int value) {
}
break;
case kOpCmp:
- if (ARM_LOWREG(r_dest_src1) && short_form)
+ if (ARM_LOWREG(r_dest_src1) && short_form) {
opcode = (short_form) ? kThumbCmpRI8 : kThumbCmpRR;
- else if (ARM_LOWREG(r_dest_src1))
+ } else if (ARM_LOWREG(r_dest_src1)) {
opcode = kThumbCmpRR;
- else {
+ } else {
short_form = false;
opcode = kThumbCmpHL;
}
@@ -579,9 +580,9 @@ LIR* ArmMir2Lir::OpRegImm(OpKind op, int r_dest_src1, int value) {
short_form = false;
break;
}
- if (short_form)
+ if (short_form) {
return NewLIR2(opcode, r_dest_src1, abs_value);
- else {
+ } else {
return OpRegRegImm(op, r_dest_src1, r_dest_src1, value);
}
}
diff --git a/compiler/dex/quick/mips/utility_mips.cc b/compiler/dex/quick/mips/utility_mips.cc
index b7546b7666..79f6f16457 100644
--- a/compiler/dex/quick/mips/utility_mips.cc
+++ b/compiler/dex/quick/mips/utility_mips.cc
@@ -145,9 +145,9 @@ LIR* MipsMir2Lir::OpRegImm(OpKind op, int r_dest_src1,
LOG(FATAL) << "Bad case in OpRegImm";
break;
}
- if (short_form)
+ if (short_form) {
res = NewLIR2(opcode, r_dest_src1, abs_value);
- else {
+ } else {
int r_scratch = AllocTemp();
res = LoadConstant(r_scratch, value);
if (op == kOpCmp)
@@ -267,9 +267,9 @@ LIR* MipsMir2Lir::OpRegRegImm(OpKind op, int r_dest, int r_src1, int value) {
break;
}
- if (short_form)
+ if (short_form) {
res = NewLIR3(opcode, r_dest, r_src1, value);
- else {
+ } else {
if (r_dest != r_src1) {
res = LoadConstant(r_dest, value);
NewLIR3(opcode, r_dest, r_src1, r_dest);
diff --git a/compiler/dex/quick/mir_to_lir.h b/compiler/dex/quick/mir_to_lir.h
index 7765eaaeef..0962167780 100644
--- a/compiler/dex/quick/mir_to_lir.h
+++ b/compiler/dex/quick/mir_to_lir.h
@@ -225,7 +225,7 @@ class Mir2Lir : public Backend {
bool first_in_pair;
};
- virtual ~Mir2Lir() {};
+ virtual ~Mir2Lir() {}
int32_t s4FromSwitchData(const void* switch_data) {
return *reinterpret_cast<const int32_t*>(switch_data);