|
42 | 42 | #include "llvm/Support/LEB128.h"
|
43 | 43 | #include "llvm/Support/Parallel.h"
|
44 | 44 | #include "llvm/Support/TimeProfiler.h"
|
| 45 | +#include <cinttypes> |
45 | 46 | #include <cstdlib>
|
46 | 47 |
|
47 | 48 | using namespace llvm;
|
@@ -2744,18 +2745,17 @@ readEntry(uint64_t &offset, const DWARFDebugNames::NameIndex &ni,
|
2744 | 2745 | uint64_t ulebVal = namesExtractor.getULEB128(&offset, &err);
|
2745 | 2746 | if (err)
|
2746 | 2747 | return createStringError(inconvertibleErrorCode(),
|
2747 |
| - "invalid abbrev code in entry: %s", |
| 2748 | + "invalid abbrev code: %s", |
2748 | 2749 | toString(std::move(err)).c_str());
|
2749 |
| - if (ulebVal <= UINT32_MAX) |
2750 |
| - ie->abbrevCode = static_cast<uint32_t>(ulebVal); |
2751 |
| - else |
| 2750 | + if (!isUInt<32>(ulebVal)) |
2752 | 2751 | return createStringError(inconvertibleErrorCode(),
|
2753 |
| - "abbrev code in entry too large for DWARF32: %d", |
| 2752 | + "abbrev code too large for DWARF32: %" PRIu64, |
2754 | 2753 | ulebVal);
|
| 2754 | + ie->abbrevCode = static_cast<uint32_t>(ulebVal); |
2755 | 2755 | auto it = ni.getAbbrevs().find_as(ie->abbrevCode);
|
2756 | 2756 | if (it == ni.getAbbrevs().end())
|
2757 | 2757 | return createStringError(inconvertibleErrorCode(),
|
2758 |
| - "entry abbrev code not found in abbrev table: %d", |
| 2758 | + "abbrev code not found in abbrev table: %" PRIu32, |
2759 | 2759 | ie->abbrevCode);
|
2760 | 2760 |
|
2761 | 2761 | DebugNamesBaseSection::AttrValue attr, cuAttr = {0, 0};
|
@@ -2806,7 +2806,6 @@ readEntry(uint64_t &offset, const DWARFDebugNames::NameIndex &ni,
|
2806 | 2806 |
|
2807 | 2807 | // Canonicalize abbrev by placing the CU/TU index at the end.
|
2808 | 2808 | ie->attrValues.push_back(cuAttr);
|
2809 |
| - |
2810 | 2809 | return ie;
|
2811 | 2810 | }
|
2812 | 2811 |
|
@@ -2919,7 +2918,7 @@ void DebugNamesBaseSection::computeHdrAndAbbrevTable(
|
2919 | 2918 | hdr.CompUnitCount += nd.hdr.CompUnitCount;
|
2920 | 2919 | // TODO: We don't handle type units yet, so LocalTypeUnitCount &
|
2921 | 2920 | // ForeignTypeUnitCount are left as 0.
|
2922 |
| - if (nd.hdr.LocalTypeUnitCount || nd. hdr.ForeignTypeUnitCount) |
| 2921 | + if (nd.hdr.LocalTypeUnitCount || nd.hdr.ForeignTypeUnitCount) |
2923 | 2922 | warn(toString(inputChunk.section.sec) +
|
2924 | 2923 | Twine(": type units are not implemented"));
|
2925 | 2924 | // If augmentation strings are not identical, use an empty string.
|
|
0 commit comments