diff options
author | Andrew Ng <anng.sw@gmail.com> | 2018-04-20 15:29:47 +0000 |
---|---|---|
committer | Andrew Ng <anng.sw@gmail.com> | 2018-04-20 15:29:47 +0000 |
commit | 7a2fa74ab046353c5ea337e96212375008547314 (patch) | |
tree | 60741873373a17d78eead8c999e3c6aadead048f /llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp | |
parent | ab9798765c51233e10c4a6a4eae03ef33e294eb4 (diff) | |
download | bcm5719-llvm-7a2fa74ab046353c5ea337e96212375008547314.tar.gz bcm5719-llvm-7a2fa74ab046353c5ea337e96212375008547314.zip |
[DebugInfo] Use WithColor for more debug line warnings
Updated two more debug line related warnings to use WithColor. This was
necessary to ensure consistent output order of the warnings on Windows
for debug line tests.
Differential Revision: https://reviews.llvm.org/D45871
llvm-svn: 330440
Diffstat (limited to 'llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp index dd74ea3a594..257d309b373 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp @@ -554,9 +554,10 @@ bool DWARFDebugLine::LineTable::parse(DWARFDataExtractor &DebugLineData, if (DebugLineData.getAddressSize() == 0) DebugLineData.setAddressSize(Len - 1); else if (DebugLineData.getAddressSize() != Len - 1) { - fprintf(stderr, "Mismatching address size at offset 0x%8.8" PRIx32 - " expected 0x%2.2" PRIx8 " found 0x%2.2" PRIx64 "\n", - ExtOffset, DebugLineData.getAddressSize(), Len - 1); + WithColor::warning() + << format("mismatching address size at offset 0x%8.8" PRIx32 + " expected 0x%2.2" PRIx8 " found 0x%2.2" PRIx64 "\n", + ExtOffset, DebugLineData.getAddressSize(), Len - 1); // Skip the rest of the line-number program. *OffsetPtr = EndOffset; return false; @@ -621,9 +622,10 @@ bool DWARFDebugLine::LineTable::parse(DWARFDataExtractor &DebugLineData, // Make sure the stated and parsed lengths are the same. // Otherwise we have an unparseable line-number program. if (*OffsetPtr - ExtOffset != Len) { - fprintf(stderr, "Unexpected line op length at offset 0x%8.8" PRIx32 - " expected 0x%2.2" PRIx64 " found 0x%2.2" PRIx32 "\n", - ExtOffset, Len, *OffsetPtr - ExtOffset); + WithColor::warning() + << format("unexpected line op length at offset 0x%8.8" PRIx32 + " expected 0x%2.2" PRIx64 " found 0x%2.2" PRIx32 "\n", + ExtOffset, Len, *OffsetPtr - ExtOffset); // Skip the rest of the line-number program. *OffsetPtr = EndOffset; return false; |