From: Nick Kledzik Date: Tue, 2 Sep 2014 18:50:24 +0000 (+0000) Subject: Code review tweaks X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9bf0327ea77669212b10325f934c6efe1d011f3e;p=oota-llvm.git Code review tweaks git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216931 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Object/MachOObjectFile.cpp b/lib/Object/MachOObjectFile.cpp index f3367a79599..fbdc0a6c91c 100644 --- a/lib/Object/MachOObjectFile.cpp +++ b/lib/Object/MachOObjectFile.cpp @@ -1542,15 +1542,15 @@ bool ExportEntry::operator==(const ExportEntry &Other) const { return true; } -uint64_t ExportEntry::readULEB128(const uint8_t *&p) { - unsigned count; - uint64_t result = decodeULEB128(p, &count); - p += count; - if (p > Trie.end()) { - p = Trie.end(); +uint64_t ExportEntry::readULEB128(const uint8_t *&Ptr) { + unsigned Count; + uint64_t Result = decodeULEB128(Ptr, &Count); + Ptr += Count; + if (Ptr > Trie.end()) { + Ptr = Trie.end(); Malformed = true; } - return result; + return Result; } StringRef ExportEntry::name() const { @@ -1616,8 +1616,8 @@ void ExportEntry::pushDownUntilBottom() { NodeState &Top = Stack.back(); CumulativeString.resize(Top.ParentStringLength); for (;*Top.Current != 0; Top.Current++) { - char c = *Top.Current; - CumulativeString.push_back(c); + char C = *Top.Current; + CumulativeString.push_back(C); } Top.Current += 1; uint64_t childNodeIndex = readULEB128(Top.Current); diff --git a/tools/llvm-objdump/MachODump.cpp b/tools/llvm-objdump/MachODump.cpp index bfff4456b01..fe9513a4c77 100644 --- a/tools/llvm-objdump/MachODump.cpp +++ b/tools/llvm-objdump/MachODump.cpp @@ -1789,8 +1789,8 @@ void llvm::printMachOFileHeader(const object::ObjectFile *Obj) { //===----------------------------------------------------------------------===// void llvm::printMachOExportsTrie(const object::MachOObjectFile *Obj) { - for (const llvm::object::ExportEntry &entry : Obj->exports()) { - uint64_t Flags = entry.flags(); + for (const llvm::object::ExportEntry &Entry : Obj->exports()) { + uint64_t Flags = Entry.flags(); bool ReExport = (Flags & MachO::EXPORT_SYMBOL_FLAGS_REEXPORT); bool WeakDef = (Flags & MachO::EXPORT_SYMBOL_FLAGS_WEAK_DEFINITION); bool ThreadLocal = ((Flags & MachO::EXPORT_SYMBOL_FLAGS_KIND_MASK) == @@ -1802,43 +1802,43 @@ void llvm::printMachOExportsTrie(const object::MachOObjectFile *Obj) { outs() << "[re-export] "; else outs() - << format("0x%08llX ", entry.address()); // FIXME:add in base address - outs() << entry.name(); + << format("0x%08llX ", Entry.address()); // FIXME:add in base address + outs() << Entry.name(); if (WeakDef || ThreadLocal || Resolver || Abs) { - bool needComma = false; + bool NeedsComma = false; printf(" ["); if (WeakDef) { outs() << "weak_def"; - needComma = true; + NeedsComma = true; } if (ThreadLocal) { - if (needComma) + if (NeedsComma) outs() << ", "; outs() << "per-thread"; - needComma = true; + NeedsComma = true; } if (Abs) { - if (needComma) + if (NeedsComma) outs() << ", "; outs() << "absolute"; - needComma = true; + NeedsComma = true; } if (Resolver) { - if (needComma) + if (NeedsComma) outs() << ", "; - outs() << format("resolver=0x%08llX", entry.other()); - needComma = true; + outs() << format("resolver=0x%08llX", Entry.other()); + NeedsComma = true; } outs() << "]"; } if (ReExport) { StringRef DylibName = "unknown"; - int ordinal = entry.other() - 1; - Obj->getLibraryShortNameByIndex(ordinal, DylibName); - if (entry.otherName().empty()) + int Ordinal = Entry.other() - 1; + Obj->getLibraryShortNameByIndex(Ordinal, DylibName); + if (Entry.otherName().empty()) outs() << " (from " << DylibName << ")"; else - outs() << " (" << entry.otherName() << " from " << DylibName << ")"; + outs() << " (" << Entry.otherName() << " from " << DylibName << ")"; } outs() << "\n"; }