mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-20 10:38:46 +00:00
llvm-readobj: Do not print NULL StringRefs
llvm-svn: 180005
This commit is contained in:
parent
087fe129d8
commit
bb000645f5
@ -726,9 +726,9 @@ void COFFDumper::printSymbol(symbol_iterator SymI) {
|
||||
if (Obj->getSymbolName(Symbol, SymbolName))
|
||||
SymbolName = "";
|
||||
|
||||
StringRef SectionName;
|
||||
if (Section && Obj->getSectionName(Section, SectionName))
|
||||
SectionName = "";
|
||||
StringRef SectionName = "";
|
||||
if (Section)
|
||||
Obj->getSectionName(Section, SectionName);
|
||||
|
||||
W.printString("Name", SymbolName);
|
||||
W.printNumber("Value", Symbol->Value);
|
||||
|
@ -643,9 +643,9 @@ void ELFDumper<ELFT>::printSymbol(symbol_iterator SymI, bool IsDynamic) {
|
||||
if (SymI->getName(SymbolName))
|
||||
SymbolName = "";
|
||||
|
||||
StringRef SectionName;
|
||||
if (Section && Obj->getSectionName(Section, SectionName))
|
||||
SectionName = "";
|
||||
StringRef SectionName = "";
|
||||
if (Section)
|
||||
Obj->getSectionName(Section, SectionName);
|
||||
|
||||
std::string FullSymbolName(SymbolName);
|
||||
if (IsDynamic) {
|
||||
|
@ -406,12 +406,11 @@ void MachODumper::printSymbol(symbol_iterator SymI) {
|
||||
MachOSymbol Symbol;
|
||||
getSymbol(Obj, SymI->getRawDataRefImpl(), Symbol);
|
||||
|
||||
StringRef SectionName;
|
||||
StringRef SectionName = "";
|
||||
section_iterator SecI(Obj->end_sections());
|
||||
if (error(SymI->getSection(SecI)) ||
|
||||
SecI == Obj->end_sections() ||
|
||||
error(SecI->getName(SectionName)))
|
||||
SectionName = "";
|
||||
if (!error(SymI->getSection(SecI)) &&
|
||||
SecI != Obj->end_sections())
|
||||
error(SecI->getName(SectionName));
|
||||
|
||||
DictScope D(W, "Symbol");
|
||||
W.printNumber("Name", SymbolName, Symbol.StringIndex);
|
||||
|
Loading…
Reference in New Issue
Block a user