forked from OSchip/llvm-project
DWARFVerifier: Change vector of IntervalMap to vector of unique_ptrs
This is a workaround for compilation issue on FreeBSD. See comments in https://reviews.llvm.org/rG0d8cb8b399ad for more information. This fixes https://github.com/llvm/llvm-project/issues/55414. Differential Revision: https://reviews.llvm.org/D125611
This commit is contained in:
parent
0ee1c0388c
commit
23bb550eeb
|
@ -406,9 +406,9 @@ unsigned DWARFVerifier::verifyIndex(StringRef Name,
|
||||||
DataExtractor D(IndexStr, DCtx.isLittleEndian(), 0);
|
DataExtractor D(IndexStr, DCtx.isLittleEndian(), 0);
|
||||||
if (!Index.parse(D))
|
if (!Index.parse(D))
|
||||||
return 1;
|
return 1;
|
||||||
IntervalMap<uint32_t, uint64_t>::Allocator Alloc;
|
using MapType = IntervalMap<uint32_t, uint64_t>;
|
||||||
std::vector<IntervalMap<uint32_t, uint64_t>> Sections(
|
MapType::Allocator Alloc;
|
||||||
Index.getColumnKinds().size(), IntervalMap<uint32_t, uint64_t>(Alloc));
|
std::vector<std::unique_ptr<MapType>> Sections(Index.getColumnKinds().size());
|
||||||
for (const DWARFUnitIndex::Entry &E : Index.getRows()) {
|
for (const DWARFUnitIndex::Entry &E : Index.getRows()) {
|
||||||
uint64_t Sig = E.getSignature();
|
uint64_t Sig = E.getSignature();
|
||||||
if (!E.getContributions())
|
if (!E.getContributions())
|
||||||
|
@ -421,7 +421,9 @@ unsigned DWARFVerifier::verifyIndex(StringRef Name,
|
||||||
int Col = E.index();
|
int Col = E.index();
|
||||||
if (SC.Length == 0)
|
if (SC.Length == 0)
|
||||||
continue;
|
continue;
|
||||||
auto &M = Sections[Col];
|
if (!Sections[Col])
|
||||||
|
Sections[Col] = std::make_unique<MapType>(Alloc);
|
||||||
|
auto &M = *Sections[Col];
|
||||||
auto I = M.find(SC.Offset);
|
auto I = M.find(SC.Offset);
|
||||||
if (I != M.end() && I.start() < (SC.Offset + SC.Length)) {
|
if (I != M.end() && I.start() < (SC.Offset + SC.Length)) {
|
||||||
error() << llvm::formatv(
|
error() << llvm::formatv(
|
||||||
|
|
Loading…
Reference in New Issue