diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2018-04-14 22:07:23 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2018-04-14 22:07:23 +0000 |
commit | 84e99265d6a7589fee870f8f0a85ad50351e6cdc (patch) | |
tree | 765e1a976eb94b818e1215ff810691fefb9560f7 /llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp | |
parent | 3072b130b2e2bd471d66933ac3eb0b497a0867d7 (diff) | |
download | bcm5719-llvm-84e99265d6a7589fee870f8f0a85ad50351e6cdc.tar.gz bcm5719-llvm-84e99265d6a7589fee870f8f0a85ad50351e6cdc.zip |
[DebugInfo] Use WithColor to print errors/warnings
Use the convenience methods from WithColor to consistently print errors
and warnings in libDebugInfo.
llvm-svn: 330092
Diffstat (limited to 'llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp index cba21b07d4c..dd74ea3a594 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp @@ -17,6 +17,7 @@ #include "llvm/DebugInfo/DWARF/DWARFRelocMap.h" #include "llvm/Support/Format.h" #include "llvm/Support/Path.h" +#include "llvm/Support/WithColor.h" #include "llvm/Support/raw_ostream.h" #include <algorithm> #include <cassert> @@ -318,10 +319,11 @@ bool DWARFDebugLine::Prologue::parse(const DWARFDataExtractor &DebugLineData, if (!parseV5DirFileTables(DebugLineData, OffsetPtr, EndPrologueOffset, FormParams, Ctx, U, ContentTypes, IncludeDirectories, FileNames)) { - fprintf(stderr, - "warning: parsing line table prologue at 0x%8.8" PRIx64 - " found an invalid directory or file table description at" - " 0x%8.8" PRIx64 "\n", PrologueOffset, (uint64_t)*OffsetPtr); + WithColor::warning() << format( + "parsing line table prologue at 0x%8.8" PRIx64 + " found an invalid directory or file table description at" + " 0x%8.8" PRIx64 "\n", + PrologueOffset, (uint64_t)*OffsetPtr); return false; } } else @@ -329,11 +331,11 @@ bool DWARFDebugLine::Prologue::parse(const DWARFDataExtractor &DebugLineData, ContentTypes, IncludeDirectories, FileNames); if (*OffsetPtr != EndPrologueOffset) { - fprintf(stderr, - "warning: parsing line table prologue at 0x%8.8" PRIx64 - " should have ended at 0x%8.8" PRIx64 - " but it ended at 0x%8.8" PRIx64 "\n", - PrologueOffset, EndPrologueOffset, (uint64_t)*OffsetPtr); + WithColor::warning() << format( + "parsing line table prologue at 0x%8.8" PRIx64 + " should have ended at 0x%8.8" PRIx64 " but it ended at 0x%8.8" PRIx64 + "\n", + PrologueOffset, EndPrologueOffset, (uint64_t)*OffsetPtr); return false; } return true; @@ -828,10 +830,9 @@ bool DWARFDebugLine::LineTable::parse(DWARFDataExtractor &DebugLineData, *OS << "\n"; } - if (!State.Sequence.Empty) { - fprintf(stderr, "warning: last sequence in debug line table is not" - "terminated!\n"); - } + if (!State.Sequence.Empty) + WithColor::warning() << "last sequence in debug line table is not" + "terminated!\n"; // Sort all sequences so that address lookup will work faster. if (!Sequences.empty()) { |