[C++] Use 'nullptr'. Tools edition.
[oota-llvm.git] / tools / llvm-readobj / COFFDumper.cpp
index 8d08d021a38fae82bdf86b372fcac1bf5167acaf..b53520daefb048d1d9f76ac3b04711ff1b66c0f3 100644 (file)
@@ -534,7 +534,7 @@ void COFFDumper::printDataDirectory(uint32_t Index, const std::string &FieldName
 
 void COFFDumper::printFileHeaders() {
   // Print COFF header
-  const coff_file_header *COFFHeader = 0;
+  const coff_file_header *COFFHeader = nullptr;
   if (error(Obj->getCOFFHeader(COFFHeader)))
     return;
 
@@ -557,13 +557,13 @@ void COFFDumper::printFileHeaders() {
 
   // Print PE header. This header does not exist if this is an object file and
   // not an executable.
-  const pe32_header *PEHeader = 0;
+  const pe32_header *PEHeader = nullptr;
   if (error(Obj->getPE32Header(PEHeader)))
     return;
   if (PEHeader)
     printPEHeader<pe32_header>(PEHeader);
 
-  const pe32plus_header *PEPlusHeader = 0;
+  const pe32plus_header *PEPlusHeader = nullptr;
   if (error(Obj->getPE32PlusHeader(PEPlusHeader)))
     return;
   if (PEPlusHeader)
@@ -693,7 +693,7 @@ void COFFDumper::printCodeViewLineTables(const SectionRef &Section) {
         break;
       }
       case COFF::DEBUG_STRING_TABLE_SUBSECTION:
-        if (PayloadSize == 0 || StringTable.data() != 0 ||
+        if (PayloadSize == 0 || StringTable.data() != nullptr ||
             Contents.back() != '\0') {
           // Empty or duplicate or non-null-terminated subsection.
           error(object_error::parse_failed);
@@ -705,7 +705,8 @@ void COFFDumper::printCodeViewLineTables(const SectionRef &Section) {
         // Holds the translation table from file indices
         // to offsets in the string table.
 
-        if (PayloadSize == 0 || FileIndexToStringOffsetTable.data() != 0) {
+        if (PayloadSize == 0 ||
+            FileIndexToStringOffsetTable.data() != nullptr) {
           // Empty or duplicate subsection.
           error(object_error::parse_failed);
           return;
@@ -981,6 +982,7 @@ void COFFDumper::printSymbol(const SymbolRef &Sym) {
       StringRef Name(Aux->FileName,
                      Symbol->NumberOfAuxSymbols * COFF::SymbolSize);
       W.printString("FileName", Name.rtrim(StringRef("\0", 1)));
+      break;
     } else if (Symbol->isSectionDefinition()) {
       const coff_aux_section_definition *Aux;
       if (error(getSymbolAuxData(Obj, Symbol + I, Aux)))
@@ -1089,7 +1091,7 @@ void COFFDumper::printRuntimeFunction(
   W.printString("UnwindInfoAddress",
                 formatSymbol(Rels, OffsetInSection + 8, RTF.UnwindInfoOffset));
 
-  const coff_section* XData = 0;
+  const coff_section* XData = nullptr;
   uint64_t UnwindInfoOffset = 0;
   if (error(getSection(Rels, OffsetInSection + 8, &XData, &UnwindInfoOffset)))
     return;