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/DWARFDebugLoc.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/DWARFDebugLoc.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp index 90f3b45af37..d24e1ab69ff 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp @@ -16,6 +16,7 @@ #include "llvm/DebugInfo/DWARF/DWARFUnit.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/Format.h" +#include "llvm/Support/WithColor.h" #include "llvm/Support/raw_ostream.h" #include <algorithm> #include <cinttypes> @@ -91,7 +92,7 @@ DWARFDebugLoc::parseOneLocationList(DWARFDataExtractor Data, unsigned *Offset) { while (true) { Entry E; if (!Data.isValidOffsetForDataOfSize(*Offset, 2 * Data.getAddressSize())) { - llvm::errs() << "Location list overflows the debug_loc section.\n"; + WithColor::error() << "location list overflows the debug_loc section.\n"; return None; } @@ -108,13 +109,13 @@ DWARFDebugLoc::parseOneLocationList(DWARFDataExtractor Data, unsigned *Offset) { return LL; if (!Data.isValidOffsetForDataOfSize(*Offset, 2)) { - llvm::errs() << "Location list overflows the debug_loc section.\n"; + WithColor::error() << "location list overflows the debug_loc section.\n"; return None; } unsigned Bytes = Data.getU16(Offset); if (!Data.isValidOffsetForDataOfSize(*Offset, Bytes)) { - llvm::errs() << "Location list overflows the debug_loc section.\n"; + WithColor::error() << "location list overflows the debug_loc section.\n"; return None; } // A single location description describing the location of the object... @@ -138,7 +139,7 @@ void DWARFDebugLoc::parse(const DWARFDataExtractor &data) { break; } if (data.isValidOffset(Offset)) - errs() << "error: failed to consume entire .debug_loc section\n"; + WithColor::error() << "failed to consume entire .debug_loc section\n"; } Optional<DWARFDebugLocDWO::LocationList> @@ -150,8 +151,8 @@ DWARFDebugLocDWO::parseOneLocationList(DataExtractor Data, unsigned *Offset) { while (auto Kind = static_cast<dwarf::LocationListEntry>(Data.getU8(Offset))) { if (Kind != dwarf::DW_LLE_startx_length) { - llvm::errs() << "error: dumping support for LLE of kind " << (int)Kind - << " not implemented\n"; + WithColor::error() << "dumping support for LLE of kind " << (int)Kind + << " not implemented\n"; return None; } |