diff options
author | Brian Carlstrom <bdc@google.com> | 2013-07-19 11:24:47 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-07-19 11:24:47 -0700 |
commit | 58d8b956e7d83bb1b219405be87e135c89b9cdb2 (patch) | |
tree | 2829f4ab7842a1c17c858bec7a10515a3922a048 | |
parent | 5775391897aa290d96ad903ddbe00f66e7a6a4f8 (diff) | |
parent | 02c8cc6d1312a2b55533f02f6369dc7c94672f90 (diff) | |
download | art-58d8b956e7d83bb1b219405be87e135c89b9cdb2.zip art-58d8b956e7d83bb1b219405be87e135c89b9cdb2.tar.gz art-58d8b956e7d83bb1b219405be87e135c89b9cdb2.tar.bz2 |
am 02c8cc6d: Fixing cpplint whitespace/blank_line, whitespace/end_of_line, whitespace/labels, whitespace/semicolon issues
* commit '02c8cc6d1312a2b55533f02f6369dc7c94672f90':
Fixing cpplint whitespace/blank_line, whitespace/end_of_line, whitespace/labels, whitespace/semicolon issues
25 files changed, 47 insertions, 51 deletions
@@ -334,7 +334,7 @@ endif .PHONY: cpplint-art cpplint-art: ./art/tools/cpplint.py \ - --filter=-,+build/header_guard,+whitespace/braces,+whitespace/comma,+runtime/explicit,+whitespace/newline,+whitespace/parens,+build/namespaces,+readability/fn_size,+whitespace/operators,+readability/braces,+whitespace/indent \ + --filter=-,+build/header_guard,+whitespace/braces,+whitespace/comma,+runtime/explicit,+whitespace/newline,+whitespace/parens,+build/namespaces,+readability/fn_size,+whitespace/operators,+readability/braces,+whitespace/indent,+whitespace/blank_line,+whitespace/end_of_line,+whitespace/labels,+whitespace/semicolon \ $(shell find art -name *.h -o -name *$(ART_CPP_EXTENSION) | grep -v art/compiler/llvm/generated/) # "mm cpplint-art-aspirational" to see warnings we would like to fix diff --git a/compiler/dex/mir_graph.cc b/compiler/dex/mir_graph.cc index a768a19..c2ee8e8 100644 --- a/compiler/dex/mir_graph.cc +++ b/compiler/dex/mir_graph.cc @@ -453,7 +453,7 @@ BasicBlock* MIRGraph::ProcessCanThrow(BasicBlock* cur_block, MIR* insn, int cur_ cur_block->successor_block_list.blocks = new (arena_) GrowableArray<SuccessorBlockInfo*>(arena_, 2, kGrowableArraySuccessorBlocks); - for (;iterator.HasNext(); iterator.Next()) { + for (; iterator.HasNext(); iterator.Next()) { BasicBlock *catch_block = FindBlock(iterator.GetHandlerAddress(), false /* split*/, false /* creat */, NULL /* immed_pred_block_p */); catch_block->catch_entry = true; @@ -994,9 +994,10 @@ char* MIRGraph::GetDalvikDisassembly(const MIR* mir) { case Instruction::k22b: str.append(StringPrintf(", #%d", insn.vC)); break; - default: - ; // Nothing left to print + default: { + // Nothing left to print } + } } if (nop) { str.append("]--optimized away"); diff --git a/compiler/dex/mir_optimization.cc b/compiler/dex/mir_optimization.cc index 22c738a..d79b26e 100644 --- a/compiler/dex/mir_optimization.cc +++ b/compiler/dex/mir_optimization.cc @@ -191,9 +191,9 @@ static SelectInstructionKind SelectKind(MIR* mir) { case Instruction::GOTO_16: case Instruction::GOTO_32: return kSelectGoto; - default:; + default: + return kSelectNone; } - return kSelectNone; } int MIRGraph::GetSSAUseCount(int s_reg) { diff --git a/compiler/dex/quick/codegen_util.cc b/compiler/dex/quick/codegen_util.cc index 7a59644..8daa397 100644 --- a/compiler/dex/quick/codegen_util.cc +++ b/compiler/dex/quick/codegen_util.cc @@ -461,7 +461,7 @@ void Mir2Lir::InstallFillArrayData() { } static int AssignLiteralOffsetCommon(LIR* lir, int offset) { - for (;lir != NULL; lir = lir->next) { + for (; lir != NULL; lir = lir->next) { lir->offset = offset; offset += 4; } diff --git a/compiler/dex/quick/ralloc_util.cc b/compiler/dex/quick/ralloc_util.cc index 92bd94e..4542f8f 100644 --- a/compiler/dex/quick/ralloc_util.cc +++ b/compiler/dex/quick/ralloc_util.cc @@ -507,7 +507,7 @@ void Mir2Lir::NullifyRange(LIR *start, LIR *finish, int s_reg1, int s_reg2) { if (start && finish) { LIR *p; DCHECK_EQ(s_reg1, s_reg2); - for (p = start; ;p = p->next) { + for (p = start; ; p = p->next) { NopLIR(p); if (p == finish) break; diff --git a/compiler/dex/vreg_analysis.cc b/compiler/dex/vreg_analysis.cc index a97d1ec..b50fe71 100644 --- a/compiler/dex/vreg_analysis.cc +++ b/compiler/dex/vreg_analysis.cc @@ -282,7 +282,7 @@ bool MIRGraph::InferTypeAndSize(BasicBlock* bb) { bool defined_ref = rl_temp.defined && rl_temp.ref; bool is_wide = rl_temp.wide || ((attrs & DF_A_WIDE) != 0); bool is_high = is_phi && rl_temp.wide && rl_temp.high_word; - for (int i = 0; i < ssa_rep->num_uses;i++) { + for (int i = 0; i < ssa_rep->num_uses; i++) { rl_temp = reg_location_[ssa_rep->uses[i]]; defined_fp |= rl_temp.defined && rl_temp.fp; defined_core |= rl_temp.defined && rl_temp.core; diff --git a/compiler/llvm/llvm_compilation_unit.cc b/compiler/llvm/llvm_compilation_unit.cc index 592059e..d4568b5 100644 --- a/compiler/llvm/llvm_compilation_unit.cc +++ b/compiler/llvm/llvm_compilation_unit.cc @@ -19,7 +19,7 @@ // #define stat64 stat // #define fstat64 fstat // #define lstat64 lstat -// +// // which causes grief. bionic probably should not do that. #include <llvm/Target/TargetLibraryInfo.h> diff --git a/runtime/base/histogram_test.cc b/runtime/base/histogram_test.cc index 9f3587a..5592f1c 100644 --- a/runtime/base/histogram_test.cc +++ b/runtime/base/histogram_test.cc @@ -129,7 +129,6 @@ TEST(Histtest, UpdateRange) { EXPECT_GE(PerValue, 132); EXPECT_LE(PerValue, 145); } -; TEST(Histtest, Reset) { UniquePtr<Histogram<uint64_t> > hist(new Histogram<uint64_t>("Reset")); @@ -173,7 +172,6 @@ TEST(Histtest, Reset) { EXPECT_GE(PerValue, 132); EXPECT_LE(PerValue, 145); } -; TEST(Histtest, MultipleCreateHist) { UniquePtr<Histogram<uint64_t> > hist(new Histogram<uint64_t>("MultipleCreateHist")); diff --git a/runtime/base/mutex.cc b/runtime/base/mutex.cc index 1df0207..af45f3f 100644 --- a/runtime/base/mutex.cc +++ b/runtime/base/mutex.cc @@ -460,8 +460,8 @@ std::ostream& operator<<(std::ostream& os, const Mutex& mu) { return os; } -ReaderWriterMutex::ReaderWriterMutex(const char* name, LockLevel level) : - BaseMutex(name, level) +ReaderWriterMutex::ReaderWriterMutex(const char* name, LockLevel level) + : BaseMutex(name, level) #if ART_USE_FUTEXES , state_(0), exclusive_owner_(0), num_pending_readers_(0), num_pending_writers_(0) #endif diff --git a/runtime/base/timing_logger.cc b/runtime/base/timing_logger.cc index c7cbbe5..bf6fd17 100644 --- a/runtime/base/timing_logger.cc +++ b/runtime/base/timing_logger.cc @@ -46,7 +46,6 @@ void TimingLogger::AddSplit(const std::string &label) { uint64_t TimingLogger::GetTotalNs() const { return times_.back() - times_.front(); } -; void TimingLogger::Dump(std::ostream &os) const { uint64_t largest_time = 0; diff --git a/runtime/dex_instruction.h b/runtime/dex_instruction.h index aea3371..b0d85e6 100644 --- a/runtime/dex_instruction.h +++ b/runtime/dex_instruction.h @@ -88,7 +88,7 @@ class Instruction { DEX_INSTRUCTION_LIST(INSTRUCTION_ENUM) #undef DEX_INSTRUCTION_LIST #undef INSTRUCTION_ENUM - } ; + }; enum Format { k10x, // op diff --git a/runtime/elf_file.cc b/runtime/elf_file.cc index 6ce36e8..0be274c 100644 --- a/runtime/elf_file.cc +++ b/runtime/elf_file.cc @@ -22,23 +22,23 @@ namespace art { -ElfFile::ElfFile() : - file_(NULL), - writable_(false), - program_header_only_(false), - header_(NULL), - base_address_(NULL), - program_headers_start_(NULL), - section_headers_start_(NULL), - dynamic_program_header_(NULL), - dynamic_section_start_(NULL), - symtab_section_start_(NULL), - dynsym_section_start_(NULL), - strtab_section_start_(NULL), - dynstr_section_start_(NULL), - hash_section_start_(NULL), - symtab_symbol_table_(NULL), - dynsym_symbol_table_(NULL) {} +ElfFile::ElfFile() + : file_(NULL), + writable_(false), + program_header_only_(false), + header_(NULL), + base_address_(NULL), + program_headers_start_(NULL), + section_headers_start_(NULL), + dynamic_program_header_(NULL), + dynamic_section_start_(NULL), + symtab_section_start_(NULL), + dynsym_section_start_(NULL), + strtab_section_start_(NULL), + dynstr_section_start_(NULL), + hash_section_start_(NULL), + symtab_symbol_table_(NULL), + dynsym_symbol_table_(NULL) {} ElfFile* ElfFile::Open(File* file, bool writable, bool program_header_only) { UniquePtr<ElfFile> elf_file(new ElfFile()); diff --git a/runtime/gc/accounting/mod_union_table-inl.h b/runtime/gc/accounting/mod_union_table-inl.h index 9ea74d4..29450c1 100644 --- a/runtime/gc/accounting/mod_union_table-inl.h +++ b/runtime/gc/accounting/mod_union_table-inl.h @@ -27,7 +27,7 @@ namespace accounting { // A mod-union table to record image references to the Zygote and alloc space. class ModUnionTableToZygoteAllocspace : public ModUnionTableReferenceCache { -public: + public: explicit ModUnionTableToZygoteAllocspace(Heap* heap) : ModUnionTableReferenceCache(heap) {} bool AddReference(const mirror::Object* /* obj */, const mirror::Object* ref) { diff --git a/runtime/gc/accounting/mod_union_table.cc b/runtime/gc/accounting/mod_union_table.cc index 940ed13..b33cbce 100644 --- a/runtime/gc/accounting/mod_union_table.cc +++ b/runtime/gc/accounting/mod_union_table.cc @@ -252,7 +252,7 @@ void ModUnionTableReferenceCache::Verify() { const byte* card = &*it->first; if (*card == CardTable::kCardClean) { std::set<const Object*> reference_set; - for (It2 itr = it->second.begin(); itr != it->second.end();++itr) { + for (It2 itr = it->second.begin(); itr != it->second.end(); ++itr) { reference_set.insert(*itr); } ModUnionCheckReferences visitor(this, reference_set); @@ -284,7 +284,7 @@ void ModUnionTableReferenceCache::Dump(std::ostream& os) { uintptr_t end = start + CardTable::kCardSize; os << reinterpret_cast<void*>(start) << "-" << reinterpret_cast<void*>(end) << "->{"; typedef std::vector<const Object*>::const_iterator It3; - for (It3 itr = it->second.begin(); itr != it->second.end();++itr) { + for (It3 itr = it->second.begin(); itr != it->second.end(); ++itr) { os << reinterpret_cast<const void*>(*itr) << ","; } os << "},"; diff --git a/runtime/gc/accounting/space_bitmap_test.cc b/runtime/gc/accounting/space_bitmap_test.cc index 516a449..806f301 100644 --- a/runtime/gc/accounting/space_bitmap_test.cc +++ b/runtime/gc/accounting/space_bitmap_test.cc @@ -66,7 +66,7 @@ TEST_F(SpaceBitmapTest, ScanRange) { EXPECT_TRUE(space_bitmap.get() != NULL); // Set all the odd bits in the first BitsPerWord * 3 to one. - for (size_t j = 0;j < kBitsPerWord * 3; ++j) { + for (size_t j = 0; j < kBitsPerWord * 3; ++j) { const mirror::Object* obj = reinterpret_cast<mirror::Object*>(heap_begin + j * SpaceBitmap::kAlignment); if (reinterpret_cast<uintptr_t>(obj) & 0xF) { diff --git a/runtime/gc/collector/mark_sweep.cc b/runtime/gc/collector/mark_sweep.cc index 92ce4ef..c8e6032 100644 --- a/runtime/gc/collector/mark_sweep.cc +++ b/runtime/gc/collector/mark_sweep.cc @@ -892,7 +892,7 @@ void MarkSweep::SweepArray(accounting::ObjectStack* allocations, bool swap_bitma // Empty the allocation stack. Thread* self = Thread::Current(); - for (size_t i = 0;i < count;++i) { + for (size_t i = 0; i < count; ++i) { Object* obj = objects[i]; // There should only be objects in the AllocSpace/LargeObjectSpace in the allocation stack. if (LIKELY(mark_bitmap->HasAddress(obj))) { @@ -1269,7 +1269,7 @@ void MarkSweep::ProcessMarkStack() { const size_t fifo_size = 4; const size_t fifo_mask = fifo_size - 1; const Object* fifo[fifo_size]; - for (size_t i = 0;i < fifo_size;++i) { + for (size_t i = 0; i < fifo_size; ++i) { fifo[i] = NULL; } size_t fifo_pos = 0; diff --git a/runtime/gc/collector/partial_mark_sweep.h b/runtime/gc/collector/partial_mark_sweep.h index 718c62e..25304b9 100644 --- a/runtime/gc/collector/partial_mark_sweep.h +++ b/runtime/gc/collector/partial_mark_sweep.h @@ -33,7 +33,7 @@ class PartialMarkSweep : public MarkSweep { explicit PartialMarkSweep(Heap* heap, bool is_concurrent, const std::string& name_prefix = ""); ~PartialMarkSweep() {} -protected: + protected: // Bind the live bits to the mark bits of bitmaps for spaces that aren't collected for partial // collections, ie the Zygote space. Also mark this space is immune. virtual void BindBitmaps() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); diff --git a/runtime/gc/collector/sticky_mark_sweep.h b/runtime/gc/collector/sticky_mark_sweep.h index 8cd4aed..e009b62 100644 --- a/runtime/gc/collector/sticky_mark_sweep.h +++ b/runtime/gc/collector/sticky_mark_sweep.h @@ -34,7 +34,7 @@ class StickyMarkSweep : public PartialMarkSweep { explicit StickyMarkSweep(Heap* heap, bool is_concurrent, const std::string& name_prefix = ""); ~StickyMarkSweep() {} -protected: + protected: // Bind the live bits to the mark bits of bitmaps for all spaces, all spaces other than the // alloc space will be marked as immune. void BindBitmaps() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); diff --git a/runtime/gc/space/large_object_space.h b/runtime/gc/space/large_object_space.h index 20a4867..09c55ec 100644 --- a/runtime/gc/space/large_object_space.h +++ b/runtime/gc/space/large_object_space.h @@ -89,7 +89,7 @@ class LargeObjectMapSpace : public LargeObjectSpace { // TODO: disabling thread safety analysis as this may be called when we already hold lock_. bool Contains(const mirror::Object* obj) const NO_THREAD_SAFETY_ANALYSIS; -private: + private: explicit LargeObjectMapSpace(const std::string& name); virtual ~LargeObjectMapSpace() {} diff --git a/runtime/gc/space/space.cc b/runtime/gc/space/space.cc index eae281a..de48b74 100644 --- a/runtime/gc/space/space.cc +++ b/runtime/gc/space/space.cc @@ -22,8 +22,8 @@ namespace art { namespace gc { namespace space { -Space::Space(const std::string& name, GcRetentionPolicy gc_retention_policy) : - name_(name), gc_retention_policy_(gc_retention_policy) { } +Space::Space(const std::string& name, GcRetentionPolicy gc_retention_policy) + : name_(name), gc_retention_policy_(gc_retention_policy) { } void Space::Dump(std::ostream& os) const { os << GetName() << ":" << GetGcRetentionPolicy(); diff --git a/runtime/runtime_support.h b/runtime/runtime_support.h index a6c3b38..43c6784 100644 --- a/runtime/runtime_support.h +++ b/runtime/runtime_support.h @@ -354,7 +354,7 @@ static inline void CheckSuspend(Thread* thread) SHARED_LOCKS_REQUIRED(Locks::mut JValue InvokeProxyInvocationHandler(ScopedObjectAccessUnchecked& soa, const char* shorty, jobject rcvr_jobj, jobject interface_method_jobj, std::vector<jvalue>& args) - SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) ; + SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); // Entry point for deoptimization. static inline uintptr_t GetDeoptimizationEntryPoint() { diff --git a/runtime/runtime_support_llvm.cc b/runtime/runtime_support_llvm.cc index 7b4c3ca..9d83f9e 100644 --- a/runtime/runtime_support_llvm.cc +++ b/runtime/runtime_support_llvm.cc @@ -105,7 +105,6 @@ class ShadowFrameCopyVisitor : public StackVisitor { } // namespace art extern "C" { - using ::art::CatchHandlerIterator; using ::art::DexFile; using ::art::FindFieldFast; @@ -923,5 +922,4 @@ void art_portable_proxy_invoke_handler_from_code(AbstractMethod* proxy_method, . void art_portable_constructor_barrier() { LOG(FATAL) << "Implemented by IRBuilder."; } - } // extern "C" diff --git a/runtime/thread_pool.h b/runtime/thread_pool.h index 7b626fb..c26926c 100644 --- a/runtime/thread_pool.h +++ b/runtime/thread_pool.h @@ -30,7 +30,7 @@ namespace art { class ThreadPool; class Task : public Closure { -public: + public: // Called when references reaches 0. virtual void Finalize() { } }; diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc index f414b79..ca4dce4 100644 --- a/runtime/verifier/method_verifier.cc +++ b/runtime/verifier/method_verifier.cc @@ -58,7 +58,7 @@ void PcToRegisterLineTable::Init(RegisterTrackingMode mode, InstructionFlags* fl interesting = flags[i].IsOpcode(); break; case kTrackCompilerInterestPoints: - interesting = flags[i].IsCompileTimeInfoPoint() || flags[i].IsBranchTarget() ; + interesting = flags[i].IsCompileTimeInfoPoint() || flags[i].IsBranchTarget(); break; case kTrackRegsBranches: interesting = flags[i].IsBranchTarget(); @@ -3756,7 +3756,7 @@ MethodVerifier::PcToConcreteMethodMap* MethodVerifier::GenerateDevirtMap() { } UniquePtr<PcToConcreteMethodMap> pc_to_concrete_method_map; - const uint16_t* insns = code_item_->insns_ ; + const uint16_t* insns = code_item_->insns_; const Instruction* inst = Instruction::At(insns); const Instruction* end = Instruction::At(insns + code_item_->insns_size_in_code_units_); diff --git a/runtime/verifier/reg_type.h b/runtime/verifier/reg_type.h index fa9fc8c..33f4195 100644 --- a/runtime/verifier/reg_type.h +++ b/runtime/verifier/reg_type.h @@ -200,7 +200,7 @@ class RegType { bool IsJavaLangObject() const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); bool IsArrayTypes() const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); bool IsObjectArrayTypes() const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); - Primitive::Type GetPrimitiveType() const ; + Primitive::Type GetPrimitiveType() const; bool IsJavaLangObjectArray() const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); bool IsInstantiableTypes() const; const std::string& GetDescriptor() const { |