Skip to content

Commit a83812b

Browse files
committed
removed assert, changed to SmallVector
1 parent 6193f98 commit a83812b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

bolt/include/bolt/Core/DebugData.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -440,10 +440,7 @@ class DebugStrOffsetsWriter {
440440
void updateAddressMap(uint32_t Index, uint32_t Address);
441441

442442
/// Get offset for given index in original .debug_str_offsets section.
443-
uint64_t getOffset(uint32_t Index) const {
444-
assert(StrOffsets.size() >= Index && "Index is out of bounds.");
445-
return StrOffsets[Index];
446-
}
443+
uint64_t getOffset(uint32_t Index) const { return StrOffsets[Index]; }
447444
/// Writes out current sections entry into .debug_str_offsets.
448445
void finalizeSection(DWARFUnit &Unit, DIEBuilder &DIEBldr);
449446

@@ -468,7 +465,7 @@ class DebugStrOffsetsWriter {
468465
std::unique_ptr<DebugStrOffsetsBufferVector> StrOffsetsBuffer;
469466
std::unique_ptr<raw_svector_ostream> StrOffsetsStream;
470467
std::map<uint32_t, uint32_t> IndexToAddressMap;
471-
std::vector<uint32_t> StrOffsets;
468+
SmallVector<uint32_t, 5> StrOffsets;
472469
std::unordered_map<uint64_t, uint64_t> ProcessedBaseOffsets;
473470
bool StrOffsetSectionWasModified = false;
474471
};

0 commit comments

Comments
 (0)