Code review tweaks

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216931 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nick Kledzik 2014-09-02 18:50:24 +00:00
parent 0565503d5d
commit 9bf0327ea7
2 changed files with 26 additions and 26 deletions

View File

@ -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);

View File

@ -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";
}