Code review tweaks
authorNick Kledzik <kledzik@apple.com>
Tue, 2 Sep 2014 18:50:24 +0000 (18:50 +0000)
committerNick Kledzik <kledzik@apple.com>
Tue, 2 Sep 2014 18:50:24 +0000 (18:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216931 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Object/MachOObjectFile.cpp
tools/llvm-objdump/MachODump.cpp

index f3367a79599e851ef56ecb31d290219ad5ef53fa..fbdc0a6c91cba63d0ce71baffbca7b5b344319e9 100644 (file)
@@ -1542,15 +1542,15 @@ bool ExportEntry::operator==(const ExportEntry &Other) const {
   return true;  
 }
 
   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;
   }
     Malformed = true;
   }
-  return result;
+  return Result;
 }
 
 StringRef ExportEntry::name() const {
 }
 
 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++) {
     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);
     }
     Top.Current += 1;
     uint64_t childNodeIndex = readULEB128(Top.Current);
index bfff4456b012506bea98375c2cf37a639e8ceb5d..fe9513a4c77553937c73a9c4aa24750af091913e 100644 (file)
@@ -1789,8 +1789,8 @@ void llvm::printMachOFileHeader(const object::ObjectFile *Obj) {
 //===----------------------------------------------------------------------===//
 
 void llvm::printMachOExportsTrie(const object::MachOObjectFile *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) ==
     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()
       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) {
     if (WeakDef || ThreadLocal || Resolver || Abs) {
-      bool needComma = false;
+      bool NeedsComma = false;
       printf(" [");
       if (WeakDef) {
         outs() << "weak_def";
       printf(" [");
       if (WeakDef) {
         outs() << "weak_def";
-        needComma = true;
+        NeedsComma = true;
       }
       if (ThreadLocal) {
       }
       if (ThreadLocal) {
-        if (needComma)
+        if (NeedsComma)
           outs() << ", ";
         outs() << "per-thread";
           outs() << ", ";
         outs() << "per-thread";
-        needComma = true;
+        NeedsComma = true;
       }
       if (Abs) {
       }
       if (Abs) {
-        if (needComma)
+        if (NeedsComma)
           outs() << ", ";
         outs() << "absolute";
           outs() << ", ";
         outs() << "absolute";
-        needComma = true;
+        NeedsComma = true;
       }
       if (Resolver) {
       }
       if (Resolver) {
-        if (needComma)
+        if (NeedsComma)
           outs() << ", ";
           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";
       }
       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() << " (from " << DylibName << ")";
       else
-        outs() << " (" << entry.otherName() << " from " << DylibName << ")";
+        outs() << " (" << Entry.otherName() << " from " << DylibName << ")";
     }
     outs() << "\n";
   }
     }
     outs() << "\n";
   }