diff options
author | Brian Carlstrom <bdc@google.com> | 2013-07-17 23:40:20 -0700 |
---|---|---|
committer | Brian Carlstrom <bdc@google.com> | 2013-07-18 00:12:43 -0700 |
commit | 0cd7ec2dcd8d7ba30bf3ca420b40dac52849876c (patch) | |
tree | 525a0f99f9381156367c988133b5d51d5dfef6f7 /compiler | |
parent | f69863b3039fc621ff4250e262d2a024d5e79ec8 (diff) | |
download | android_art-0cd7ec2dcd8d7ba30bf3ca420b40dac52849876c.tar.gz android_art-0cd7ec2dcd8d7ba30bf3ca420b40dac52849876c.tar.bz2 android_art-0cd7ec2dcd8d7ba30bf3ca420b40dac52849876c.zip |
Fix cpplint whitespace/blank_line issues
Change-Id: Ice937e95e23dd622c17054551d4ae4cebd0ef8a2
Diffstat (limited to 'compiler')
29 files changed, 100 insertions, 96 deletions
diff --git a/compiler/dex/arena_allocator.h b/compiler/dex/arena_allocator.h index 0ad859ea9a..cd2141a3c3 100644 --- a/compiler/dex/arena_allocator.h +++ b/compiler/dex/arena_allocator.h @@ -28,7 +28,6 @@ namespace art { class ArenaAllocator { public: - // Type of allocation for memory tuning. enum ArenaAllocKind { kAllocMisc, @@ -57,7 +56,6 @@ class ArenaAllocator { void DumpMemStats(std::ostream& os) const; private: - // Variable-length allocation block. struct ArenaMemBlock { size_t block_size; @@ -77,7 +75,6 @@ class ArenaAllocator { uint32_t alloc_stats_[kNumAllocKinds]; // Bytes used by various allocation kinds. uint32_t lost_bytes_; // Lost memory at end of too-small region uint32_t num_allocations_; - }; // ArenaAllocator diff --git a/compiler/dex/arena_bit_vector.h b/compiler/dex/arena_bit_vector.h index 7e5c436f4c..de30859bfd 100644 --- a/compiler/dex/arena_bit_vector.h +++ b/compiler/dex/arena_bit_vector.h @@ -30,7 +30,6 @@ namespace art { */ class ArenaBitVector { public: - class Iterator { public: explicit Iterator(ArenaBitVector* bit_vector) diff --git a/compiler/dex/backend.h b/compiler/dex/backend.h index 7fa8e9992a..acfec42352 100644 --- a/compiler/dex/backend.h +++ b/compiler/dex/backend.h @@ -23,7 +23,6 @@ namespace art { class Backend { - public: virtual ~Backend() {}; virtual void Materialize() = 0; @@ -32,7 +31,6 @@ class Backend { protected: explicit Backend(ArenaAllocator* arena) : arena_(arena) {}; ArenaAllocator* const arena_; - }; // Class Backend } // namespace art diff --git a/compiler/dex/dataflow_iterator.h b/compiler/dex/dataflow_iterator.h index 19468698f9..e427862956 100644 --- a/compiler/dex/dataflow_iterator.h +++ b/compiler/dex/dataflow_iterator.h @@ -41,7 +41,6 @@ namespace art { */ class DataflowIterator { public: - virtual ~DataflowIterator() {} // Return the next BasicBlock* to visit. @@ -81,7 +80,6 @@ namespace art { GrowableArray<int>* block_id_list_; int idx_; bool changed_; - }; // DataflowIterator class ReachableNodesIterator : public DataflowIterator { @@ -106,7 +104,6 @@ namespace art { class PostOrderDfsIterator : public DataflowIterator { public: - PostOrderDfsIterator(MIRGraph* mir_graph, bool is_iterative) : DataflowIterator(mir_graph, is_iterative, 0, mir_graph->GetNumReachableBlocks(), false) { diff --git a/compiler/dex/growable_array.h b/compiler/dex/growable_array.h index 6d26bc216d..3bfbcd4edf 100644 --- a/compiler/dex/growable_array.h +++ b/compiler/dex/growable_array.h @@ -46,7 +46,6 @@ enum OatListKind { template<typename T> class GrowableArray { public: - class Iterator { public: explicit Iterator(GrowableArray* g_list) diff --git a/compiler/dex/local_value_numbering.cc b/compiler/dex/local_value_numbering.cc index b783f3ed52..35d29235f2 100644 --- a/compiler/dex/local_value_numbering.cc +++ b/compiler/dex/local_value_numbering.cc @@ -509,7 +509,6 @@ uint16_t LocalValueNumbering::GetValueNumber(MIR* mir) { AdvanceMemoryVersion(NO_VALUE, field_ref); } break; - } return res; } diff --git a/compiler/dex/local_value_numbering.h b/compiler/dex/local_value_numbering.h index 09ed7aec8d..d29600a479 100644 --- a/compiler/dex/local_value_numbering.h +++ b/compiler/dex/local_value_numbering.h @@ -135,7 +135,6 @@ class LocalValueNumbering { ValueMap value_map_; MemoryVersionMap memory_version_map_; std::set<uint16_t> null_checked_; - }; } // namespace art diff --git a/compiler/dex/mir_graph.cc b/compiler/dex/mir_graph.cc index a9af477d2a..0b3fa46faa 100644 --- a/compiler/dex/mir_graph.cc +++ b/compiler/dex/mir_graph.cc @@ -804,7 +804,6 @@ void MIRGraph::DumpCFG(const char* dir_prefix, bool all_blocks) { if (bb->successor_block_list.block_list_type == kPackedSwitch || bb->successor_block_list.block_list_type == kSparseSwitch) { - GrowableArray<SuccessorBlockInfo*>::Iterator iter(bb->successor_block_list.blocks); succ_id = 0; diff --git a/compiler/dex/mir_graph.h b/compiler/dex/mir_graph.h index f86e13016d..f6011e06e6 100644 --- a/compiler/dex/mir_graph.h +++ b/compiler/dex/mir_graph.h @@ -553,7 +553,6 @@ class MIRGraph { static const char* extended_mir_op_names_[kMirOpLast - kMirOpFirst]; private: - int FindCommonParent(int block1, int block2); void ComputeSuccLineIn(ArenaBitVector* dest, const ArenaBitVector* src1, const ArenaBitVector* src2); diff --git a/compiler/dex/portable/mir_to_gbc.cc b/compiler/dex/portable/mir_to_gbc.cc index 4317d1e354..cfd3dafbee 100644 --- a/compiler/dex/portable/mir_to_gbc.cc +++ b/compiler/dex/portable/mir_to_gbc.cc @@ -74,7 +74,6 @@ void MirConverter::DefineValueOnly(::llvm::Value* val, int s_reg) { ::llvm::Instruction* inst = ::llvm::dyn_cast< ::llvm::Instruction>(placeholder); DCHECK(inst != NULL); inst->eraseFromParent(); - } void MirConverter::DefineValue(::llvm::Value* val, int s_reg) { @@ -1580,8 +1579,7 @@ void MirConverter::HandlePhiNodes(BasicBlock* bb, ::llvm::BasicBlock* llvm_bb) { /* Extended MIR instructions like PHI */ void MirConverter::ConvertExtendedMIR(BasicBlock* bb, MIR* mir, - ::llvm::BasicBlock* llvm_bb) { - + ::llvm::BasicBlock* llvm_bb) { switch (static_cast<ExtendedMIROpcode>(mir->dalvikInsn.opcode)) { case kMirOpPhi: { // The llvm Phi node already emitted - just DefineValue() here. @@ -1706,7 +1704,6 @@ bool MirConverter::BlockBitcodeConversion(BasicBlock* bb) { HandlePhiNodes(bb, llvm_bb); for (MIR* mir = bb->first_mir_insn; mir != NULL; mir = mir->next) { - SetDexOffset(mir->offset); int opcode = mir->dalvikInsn.opcode; @@ -1795,7 +1792,6 @@ char RemapShorty(char shorty_type) { } ::llvm::FunctionType* MirConverter::GetFunctionType() { - // Get return type ::llvm::Type* ret_type = irb_->getJType(RemapShorty(cu_->shorty[0])); diff --git a/compiler/dex/portable/mir_to_gbc.h b/compiler/dex/portable/mir_to_gbc.h index 278631466f..2b681f6097 100644 --- a/compiler/dex/portable/mir_to_gbc.h +++ b/compiler/dex/portable/mir_to_gbc.h @@ -41,7 +41,6 @@ Backend* PortableCodeGenerator(CompilationUnit* const cu, MIRGraph* const mir_gr llvm::LlvmCompilationUnit* const llvm_compilation_unit); class MirConverter : public Backend { - public: // TODO: flesh out and integrate into new world order. MirConverter(CompilationUnit* cu, MIRGraph* mir_graph, ArenaAllocator* arena, diff --git a/compiler/dex/quick/arm/assemble_arm.cc b/compiler/dex/quick/arm/assemble_arm.cc index f4aa1f3212..0649c9f319 100644 --- a/compiler/dex/quick/arm/assemble_arm.cc +++ b/compiler/dex/quick/arm/assemble_arm.cc @@ -1007,7 +1007,6 @@ AssemblerStatus ArmMir2Lir::AssembleInstructions(uintptr_t start_addr) { AssemblerStatus res = kSuccess; // Assume success for (lir = first_lir_insn_; lir != NULL; lir = NEXT_LIR(lir)) { - if (lir->opcode < 0) { /* 1 means padding is needed */ if ((lir->opcode == kPseudoPseudoAlign4) && (lir->operands[0] == 1)) { diff --git a/compiler/dex/quick/codegen_util.cc b/compiler/dex/quick/codegen_util.cc index e169dc8f54..8698b1f9ed 100644 --- a/compiler/dex/quick/codegen_util.cc +++ b/compiler/dex/quick/codegen_util.cc @@ -969,7 +969,6 @@ void Mir2Lir::Materialize() { /* Method is not empty */ if (first_lir_insn_) { - // mark the targets of switch statement case labels ProcessSwitchTables(); @@ -979,9 +978,7 @@ void Mir2Lir::Materialize() { if (cu_->verbose) { CodegenDump(); } - } - } CompiledMethod* Mir2Lir::GetCompiledMethod() { diff --git a/compiler/dex/quick/gen_invoke.cc b/compiler/dex/quick/gen_invoke.cc index 14e395cdac..fd8f86b5fc 100644 --- a/compiler/dex/quick/gen_invoke.cc +++ b/compiler/dex/quick/gen_invoke.cc @@ -736,7 +736,6 @@ int Mir2Lir::GenDalvikArgsRange(CallInfo* info, int call_state, const MethodReference& target_method, uint32_t vtable_idx, uintptr_t direct_code, uintptr_t direct_method, InvokeType type, bool skip_this) { - // If we can treat it as non-range (Jumbo ops will use range form) if (info->num_arg_words <= 5) return GenDalvikArgsNoRange(info, call_state, pcrLabel, diff --git a/compiler/dex/quick/local_optimizations.cc b/compiler/dex/quick/local_optimizations.cc index eb27bf8b5d..2e9c845d05 100644 --- a/compiler/dex/quick/local_optimizations.cc +++ b/compiler/dex/quick/local_optimizations.cc @@ -73,11 +73,14 @@ void Mir2Lir::ConvertMemOpIntoMove(LIR* orig_lir, int dest, int src) { void Mir2Lir::ApplyLoadStoreElimination(LIR* head_lir, LIR* tail_lir) { LIR* this_lir; - if (head_lir == tail_lir) return; + if (head_lir == tail_lir) { + return; + } for (this_lir = PREV_LIR(tail_lir); this_lir != head_lir; this_lir = PREV_LIR(this_lir)) { - - if (is_pseudo_opcode(this_lir->opcode)) continue; + if (is_pseudo_opcode(this_lir->opcode)) { + continue; + } int sink_distance = 0; @@ -110,7 +113,9 @@ void Mir2Lir::ApplyLoadStoreElimination(LIR* head_lir, LIR* tail_lir) { * Currently only eliminate redundant ld/st for constant and Dalvik * register accesses. */ - if (!(this_mem_mask & (ENCODE_LITERAL | ENCODE_DALVIK_REG))) continue; + if (!(this_mem_mask & (ENCODE_LITERAL | ENCODE_DALVIK_REG))) { + continue; + } uint64_t stop_def_reg_mask = this_lir->def_mask & ~ENCODE_MEM; uint64_t stop_use_reg_mask; @@ -127,12 +132,13 @@ void Mir2Lir::ApplyLoadStoreElimination(LIR* head_lir, LIR* tail_lir) { } for (check_lir = NEXT_LIR(this_lir); check_lir != tail_lir; check_lir = NEXT_LIR(check_lir)) { - /* * Skip already dead instructions (whose dataflow information is * outdated and misleading). */ - if (check_lir->flags.is_nop || is_pseudo_opcode(check_lir->opcode)) continue; + if (check_lir->flags.is_nop || is_pseudo_opcode(check_lir->opcode)) { + continue; + } uint64_t check_mem_mask = (check_lir->use_mask | check_lir->def_mask) & ENCODE_MEM; uint64_t alias_condition = this_mem_mask & check_mem_mask; @@ -274,12 +280,15 @@ void Mir2Lir::ApplyLoadHoisting(LIR* head_lir, LIR* tail_lir) { LIR* prev_inst_list[MAX_HOIST_DISTANCE]; /* Empty block */ - if (head_lir == tail_lir) return; + if (head_lir == tail_lir) { + return; + } /* Start from the second instruction */ for (this_lir = NEXT_LIR(head_lir); this_lir != tail_lir; this_lir = NEXT_LIR(this_lir)) { - - if (is_pseudo_opcode(this_lir->opcode)) continue; + if (is_pseudo_opcode(this_lir->opcode)) { + continue; + } uint64_t target_flags = GetTargetInstFlags(this_lir->opcode); /* Skip non-interesting instructions */ @@ -312,12 +321,13 @@ void Mir2Lir::ApplyLoadHoisting(LIR* head_lir, LIR* tail_lir) { /* Try to hoist the load to a good spot */ for (check_lir = PREV_LIR(this_lir); check_lir != head_lir; check_lir = PREV_LIR(check_lir)) { - /* * Skip already dead instructions (whose dataflow information is * outdated and misleading). */ - if (check_lir->flags.is_nop) continue; + if (check_lir->flags.is_nop) { + continue; + } uint64_t check_mem_mask = check_lir->def_mask & ENCODE_MEM; uint64_t alias_condition = stop_use_all_mask & check_mem_mask; @@ -355,7 +365,9 @@ void Mir2Lir::ApplyLoadHoisting(LIR* head_lir, LIR* tail_lir) { */ if (stop_here || !is_pseudo_opcode(check_lir->opcode)) { prev_inst_list[next_slot++] = check_lir; - if (next_slot == MAX_HOIST_DISTANCE) break; + if (next_slot == MAX_HOIST_DISTANCE) { + break; + } } /* Found a new place to put the load - move it here */ @@ -400,12 +412,16 @@ void Mir2Lir::ApplyLoadHoisting(LIR* head_lir, LIR* tail_lir) { * If the first instruction is a load, don't hoist anything * above it since it is unlikely to be beneficial. */ - if (GetTargetInstFlags(cur_lir->opcode) & IS_LOAD) continue; + if (GetTargetInstFlags(cur_lir->opcode) & IS_LOAD) { + continue; + } /* * If the remaining number of slots is less than LD_LATENCY, * insert the hoisted load here. */ - if (slot < LD_LATENCY) break; + if (slot < LD_LATENCY) { + break; + } } // Don't look across a barrier label @@ -461,7 +477,6 @@ void Mir2Lir::RemoveRedundantBranches() { LIR* this_lir; for (this_lir = first_lir_insn_; this_lir != last_lir_insn_; this_lir = NEXT_LIR(this_lir)) { - /* Branch to the next instruction */ if (IsUnconditionalBranch(this_lir)) { LIR* next_lir = this_lir; diff --git a/compiler/dex/quick/mips/codegen_mips.h b/compiler/dex/quick/mips/codegen_mips.h index 376ad7f10e..802ff625c9 100644 --- a/compiler/dex/quick/mips/codegen_mips.h +++ b/compiler/dex/quick/mips/codegen_mips.h @@ -24,7 +24,6 @@ namespace art { class MipsMir2Lir : public Mir2Lir { public: - MipsMir2Lir(CompilationUnit* cu, MIRGraph* mir_graph, ArenaAllocator* arena); // Required for target - codegen utilities. @@ -175,7 +174,6 @@ class MipsMir2Lir : public Mir2Lir { private: void ConvertShortToLongBranch(LIR* lir); - }; } // namespace art diff --git a/compiler/dex/quick/mir_to_lir.h b/compiler/dex/quick/mir_to_lir.h index abb687cb84..41e5a2d988 100644 --- a/compiler/dex/quick/mir_to_lir.h +++ b/compiler/dex/quick/mir_to_lir.h @@ -166,7 +166,6 @@ Mir2Lir* X86CodeGenerator(CompilationUnit* const cu, MIRGraph* const mir_graph, #define is_pseudo_opcode(opcode) (static_cast<int>(opcode) < 0) class Mir2Lir : public Backend { - public: struct SwitchTable { int offset; diff --git a/compiler/dex/quick/x86/codegen_x86.h b/compiler/dex/quick/x86/codegen_x86.h index 4fa9dfb4d9..edb5ae57c2 100644 --- a/compiler/dex/quick/x86/codegen_x86.h +++ b/compiler/dex/quick/x86/codegen_x86.h @@ -24,7 +24,6 @@ namespace art { class X86Mir2Lir : public Mir2Lir { public: - X86Mir2Lir(CompilationUnit* cu, MIRGraph* mir_graph, ArenaAllocator* arena); // Required for target - codegen helpers. diff --git a/compiler/dex/ssa_transformation.cc b/compiler/dex/ssa_transformation.cc index ccd2454a49..3a0cbcc67c 100644 --- a/compiler/dex/ssa_transformation.cc +++ b/compiler/dex/ssa_transformation.cc @@ -46,9 +46,13 @@ BasicBlock* MIRGraph::NextUnvisitedSuccessor(BasicBlock* bb) { GrowableArray<SuccessorBlockInfo*>::Iterator iterator(bb->successor_block_list.blocks); while (true) { SuccessorBlockInfo *sbi = iterator.Next(); - if (sbi == NULL) break; + if (sbi == NULL) { + break; + } res = NeedsVisit(sbi->block); - if (res != NULL) break; + if (res != NULL) { + break; + } } } } @@ -112,12 +116,16 @@ void MIRGraph::ComputeDFSOrders() { * register idx is defined in BasicBlock bb. */ bool MIRGraph::FillDefBlockMatrix(BasicBlock* bb) { - if (bb->data_flow_info == NULL) return false; + if (bb->data_flow_info == NULL) { + return false; + } ArenaBitVector::Iterator iterator(bb->data_flow_info->def_v); while (true) { int idx = iterator.Next(); - if (idx == -1) break; + if (idx == -1) { + break; + } /* Block bb defines register idx */ def_block_matrix_[idx]->SetBit(bb->id); } @@ -222,7 +230,9 @@ bool MIRGraph::ComputeDominanceFrontier(BasicBlock* bb) { GrowableArray<SuccessorBlockInfo*>::Iterator iterator(bb->successor_block_list.blocks); while (true) { SuccessorBlockInfo *successor_block_info = iterator.Next(); - if (successor_block_info == NULL) break; + if (successor_block_info == NULL) { + break; + } BasicBlock* succ_bb = successor_block_info->block; CheckForDominanceFrontier(bb, succ_bb); } @@ -233,13 +243,17 @@ bool MIRGraph::ComputeDominanceFrontier(BasicBlock* bb) { while (true) { //TUNING: hot call to BitVectorIteratorNext int dominated_idx = bv_iterator.Next(); - if (dominated_idx == -1) break; + if (dominated_idx == -1) { + break; + } BasicBlock* dominated_bb = GetBasicBlock(dominated_idx); ArenaBitVector::Iterator df_iterator(dominated_bb->dom_frontier); while (true) { //TUNING: hot call to BitVectorIteratorNext int df_up_idx = df_iterator.Next(); - if (df_up_idx == -1) break; + if (df_up_idx == -1) { + break; + } BasicBlock* df_up_block = GetBasicBlock(df_up_idx); CheckForDominanceFrontier(bb, df_up_block); } @@ -313,7 +327,9 @@ bool MIRGraph::ComputeblockIDom(BasicBlock* bb) { /* Scan the rest of the predecessors */ while (true) { BasicBlock* pred_bb = iter.Next(); - if (!pred_bb) break; + if (!pred_bb) { + break; + } if (i_dom_list_[pred_bb->dfs_id] == NOTVISITED) { continue; } else { @@ -443,7 +459,9 @@ void MIRGraph::ComputeSuccLineIn(ArenaBitVector* dest, const ArenaBitVector* src bool MIRGraph::ComputeBlockLiveIns(BasicBlock* bb) { ArenaBitVector* temp_dalvik_register_v = temp_dalvik_register_v_; - if (bb->data_flow_info == NULL) return false; + if (bb->data_flow_info == NULL) { + return false; + } temp_dalvik_register_v->Copy(bb->data_flow_info->live_in_v); if (bb->taken && bb->taken->data_flow_info) ComputeSuccLineIn(temp_dalvik_register_v, bb->taken->data_flow_info->live_in_v, @@ -455,7 +473,9 @@ bool MIRGraph::ComputeBlockLiveIns(BasicBlock* bb) { GrowableArray<SuccessorBlockInfo*>::Iterator iterator(bb->successor_block_list.blocks); while (true) { SuccessorBlockInfo *successor_block_info = iterator.Next(); - if (successor_block_info == NULL) break; + if (successor_block_info == NULL) { + break; + } BasicBlock* succ_bb = successor_block_info->block; if (succ_bb->data_flow_info) { ComputeSuccLineIn(temp_dalvik_register_v, succ_bb->data_flow_info->live_in_v, @@ -504,25 +524,27 @@ void MIRGraph::InsertPhiNodes() { while (true) { int idx = iterator.Next(); - if (idx == -1) break; - BasicBlock* def_bb = GetBasicBlock(idx); + if (idx == -1) { + break; + } + BasicBlock* def_bb = GetBasicBlock(idx); - /* Merge the dominance frontier to tmp_blocks */ - //TUNING: hot call to Union(). - if (def_bb->dom_frontier != NULL) { - tmp_blocks->Union(def_bb->dom_frontier); - } + /* Merge the dominance frontier to tmp_blocks */ + //TUNING: hot call to Union(). + if (def_bb->dom_frontier != NULL) { + tmp_blocks->Union(def_bb->dom_frontier); } - if (!phi_blocks->Equal(tmp_blocks)) { - change = true; - phi_blocks->Copy(tmp_blocks); - - /* - * Iterate through the original blocks plus the new ones in - * the dominance frontier. - */ - input_blocks->Copy(phi_blocks); - input_blocks->Union(def_block_matrix_[dalvik_reg]); + } + if (!phi_blocks->Equal(tmp_blocks)) { + change = true; + phi_blocks->Copy(tmp_blocks); + + /* + * Iterate through the original blocks plus the new ones in + * the dominance frontier. + */ + input_blocks->Copy(phi_blocks); + input_blocks->Union(def_block_matrix_[dalvik_reg]); } } while (change); @@ -533,10 +555,14 @@ void MIRGraph::InsertPhiNodes() { ArenaBitVector::Iterator iterator(phi_blocks); while (true) { int idx = iterator.Next(); - if (idx == -1) break; + if (idx == -1) { + break; + } BasicBlock* phi_bb = GetBasicBlock(idx); /* Variable will be clobbered before being used - no need for phi */ - if (!phi_bb->data_flow_info->live_in_v->IsBitSet(dalvik_reg)) continue; + if (!phi_bb->data_flow_info->live_in_v->IsBitSet(dalvik_reg)) { + continue; + } MIR *phi = static_cast<MIR*>(arena_->NewMem(sizeof(MIR), true, ArenaAllocator::kAllocDFInfo)); phi->dalvikInsn.opcode = static_cast<Instruction::Code>(kMirOpPhi); @@ -572,7 +598,9 @@ bool MIRGraph::InsertPhiNodeOperands(BasicBlock* bb) { GrowableArray<BasicBlock*>::Iterator iter(bb->predecessors); while (true) { BasicBlock* pred_bb = iter.Next(); - if (!pred_bb) break; + if (!pred_bb) { + break; + } int ssa_reg = pred_bb->data_flow_info->vreg_to_ssa_map[v_reg]; uses.push_back(ssa_reg); incoming_arc.push_back(pred_bb->id); @@ -605,8 +633,9 @@ bool MIRGraph::InsertPhiNodeOperands(BasicBlock* bb) { } void MIRGraph::DoDFSPreOrderSSARename(BasicBlock* block) { - - if (block->visited || block->hidden) return; + if (block->visited || block->hidden) { + return; + } block->visited = true; /* Process this block */ @@ -632,7 +661,9 @@ void MIRGraph::DoDFSPreOrderSSARename(BasicBlock* block) { GrowableArray<SuccessorBlockInfo*>::Iterator iterator(block->successor_block_list.blocks); while (true) { SuccessorBlockInfo *successor_block_info = iterator.Next(); - if (successor_block_info == NULL) break; + if (successor_block_info == NULL) { + break; + } BasicBlock* succ_bb = successor_block_info->block; DoDFSPreOrderSSARename(succ_bb); /* Restore SSA map snapshot */ diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index d1d21b1d03..f1082db9bc 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -1402,7 +1402,6 @@ class ParallelCompilationManager { } private: - class ForAllClosure : public Task { public: ForAllClosure(ParallelCompilationManager* manager, size_t begin, size_t end, Callback* callback, @@ -1423,6 +1422,7 @@ class ParallelCompilationManager { virtual void Finalize() { delete this; } + private: const ParallelCompilationManager* const manager_; const size_t begin_; diff --git a/compiler/elf_writer_mclinker.cc b/compiler/elf_writer_mclinker.cc index 472a606cc6..05f3b025e7 100644 --- a/compiler/elf_writer_mclinker.cc +++ b/compiler/elf_writer_mclinker.cc @@ -307,7 +307,6 @@ void ElfWriterMclinker::AddRuntimeInputs(const std::string& android_root, bool i // TODO: ownership of libm_lib_input? mcld::Input* libm_lib_input_input = ir_builder_->ReadInput(libm_lib, libm_lib); CHECK(libm_lib_input_input != NULL); - } #endif diff --git a/compiler/elf_writer_mclinker.h b/compiler/elf_writer_mclinker.h index 468fa9a84f..3b33bc4986 100644 --- a/compiler/elf_writer_mclinker.h +++ b/compiler/elf_writer_mclinker.h @@ -38,7 +38,6 @@ class CompiledCode; class ElfWriterMclinker : public ElfWriter { public: - // Write an ELF file. Returns true on success, false on failure. static bool Create(File* file, std::vector<uint8_t>& oat_contents, diff --git a/compiler/elf_writer_test.cc b/compiler/elf_writer_test.cc index 4a02b61242..e48806ecc4 100644 --- a/compiler/elf_writer_test.cc +++ b/compiler/elf_writer_test.cc @@ -22,7 +22,6 @@ namespace art { class ElfWriterTest : public CommonTest { - protected: virtual void SetUp() { ReserveImageSpace(); diff --git a/compiler/jni/portable/jni_compiler.cc b/compiler/jni/portable/jni_compiler.cc index 44d0c2d215..57b8a315a1 100644 --- a/compiler/jni/portable/jni_compiler.cc +++ b/compiler/jni/portable/jni_compiler.cc @@ -46,11 +46,10 @@ using namespace runtime_support; JniCompiler::JniCompiler(LlvmCompilationUnit* cunit, const CompilerDriver& driver, const DexCompilationUnit* dex_compilation_unit) -: cunit_(cunit), driver_(&driver), module_(cunit_->GetModule()), - context_(cunit_->GetLLVMContext()), irb_(*cunit_->GetIRBuilder()), - dex_compilation_unit_(dex_compilation_unit), - func_(NULL), elf_func_idx_(0) { - + : cunit_(cunit), driver_(&driver), module_(cunit_->GetModule()), + context_(cunit_->GetLLVMContext()), irb_(*cunit_->GetIRBuilder()), + dex_compilation_unit_(dex_compilation_unit), + func_(NULL), elf_func_idx_(0) { // Check: Ensure that JNI compiler will only get "native" method CHECK(dex_compilation_unit->IsNative()); } diff --git a/compiler/jni/quick/x86/calling_convention_x86.cc b/compiler/jni/quick/x86/calling_convention_x86.cc index b671bd190c..45dd42960c 100644 --- a/compiler/jni/quick/x86/calling_convention_x86.cc +++ b/compiler/jni/quick/x86/calling_convention_x86.cc @@ -159,7 +159,6 @@ size_t X86JniCallingConvention::NumberOfOutgoingStackArgs() { // count JNIEnv* and return pc (pushed after Method*) size_t total_args = static_args + param_args + 2; return total_args; - } } // namespace x86 diff --git a/compiler/llvm/gbc_expander.cc b/compiler/llvm/gbc_expander.cc index b139e322f1..94cc9731aa 100644 --- a/compiler/llvm/gbc_expander.cc +++ b/compiler/llvm/gbc_expander.cc @@ -361,7 +361,6 @@ class GBCExpanderPass : public llvm::FunctionPass { llvm::Value* ExpandIntrinsic(IntrinsicHelper::IntrinsicId intr_id, llvm::CallInst& call_inst); - }; char GBCExpanderPass::ID = 0; @@ -710,7 +709,6 @@ llvm::Value* GBCExpanderPass::EmitLoadArrayLength(llvm::Value* array) { art::mirror::Array::LengthOffset().Int32Value(), irb_.getJIntTy(), kTBAAConstJObject); - } llvm::Value* @@ -751,7 +749,6 @@ EmitLoadVirtualCalleeMethodObjectAddr(int vtable_idx, llvm::Value* this_addr) { llvm::Value* GBCExpanderPass::EmitArrayGEP(llvm::Value* array_addr, llvm::Value* index_value, JType elem_jty) { - int data_offset; if (elem_jty == kLong || elem_jty == kDouble || (elem_jty == kObject && sizeof(uint64_t) == sizeof(art::mirror::Object*))) { @@ -1426,7 +1423,6 @@ llvm::Value* GBCExpanderPass::Expand_LongCompare(llvm::Value* src1_value, llvm:: llvm::Value* GBCExpanderPass::EmitCompareResultSelection(llvm::Value* cmp_eq, llvm::Value* cmp_lt) { - llvm::Constant* zero = irb_.getJInt(0); llvm::Constant* pos1 = irb_.getJInt(1); llvm::Constant* neg1 = irb_.getJInt(-1); @@ -2437,7 +2433,6 @@ EmitCallRuntimeForCalleeMethodObjectAddr(uint32_t callee_method_idx, llvm::Value* this_addr, uint32_t dex_pc, bool is_fast_path) { - llvm::Function* runtime_func = NULL; switch (invoke_type) { diff --git a/compiler/llvm/ir_builder.h b/compiler/llvm/ir_builder.h index 65da005e9b..c81ba278a8 100644 --- a/compiler/llvm/ir_builder.h +++ b/compiler/llvm/ir_builder.h @@ -219,7 +219,6 @@ class IRBuilder : public LLVMIRBuilder { ::llvm::Value* CreatePtrDisp(::llvm::Value* base, ::llvm::Value* offset, ::llvm::PointerType* ret_ty) { - ::llvm::Value* base_int = CreatePtrToInt(base, getPtrEquivIntTy()); ::llvm::Value* result_int = CreateAdd(base_int, offset); ::llvm::Value* result = CreateIntToPtr(result_int, ret_ty); @@ -232,7 +231,6 @@ class IRBuilder : public LLVMIRBuilder { ::llvm::Value* count, ::llvm::Value* offset, ::llvm::PointerType* ret_ty) { - ::llvm::Value* block_offset = CreateMul(bs, count); ::llvm::Value* total_offset = CreateAdd(block_offset, offset); diff --git a/compiler/llvm/llvm_compilation_unit.cc b/compiler/llvm/llvm_compilation_unit.cc index dfb572477e..1f2b977921 100644 --- a/compiler/llvm/llvm_compilation_unit.cc +++ b/compiler/llvm/llvm_compilation_unit.cc @@ -166,7 +166,6 @@ void LlvmCompilationUnit::DumpBitcodeToString(std::string& str_buffer) { } bool LlvmCompilationUnit::Materialize() { - const bool kDumpBitcode = false; if (kDumpBitcode) { // Dump the bitcode for debugging diff --git a/compiler/oat_writer.cc b/compiler/oat_writer.cc index 0bfa4ec328..4c32506d43 100644 --- a/compiler/oat_writer.cc +++ b/compiler/oat_writer.cc @@ -83,7 +83,6 @@ OatWriter::OatWriter(const std::vector<const DexFile*>& dex_files, size_oat_dex_file_methods_offsets_(0), size_oat_class_status_(0), size_oat_class_method_offsets_(0) { - size_t offset = InitOatHeader(); offset = InitOatDexFiles(offset); offset = InitDexFiles(offset); |