Skip to content

Commit 9fbde32

Browse files
committed
Revert "CodeView: Move MCCVDefRangeFragment storage to MCContext/MCFragment"
This reverts commit e47d401. Causing a few tests to crash on Windows buildbots.
1 parent e0864b5 commit 9fbde32

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

llvm/include/llvm/MC/MCCodeView.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "llvm/ADT/SmallVector.h"
1919
#include "llvm/ADT/StringMap.h"
2020
#include "llvm/ADT/StringRef.h"
21-
#include <deque>
2221
#include <map>
2322
#include <vector>
2423

@@ -269,9 +268,6 @@ class CodeViewContext {
269268
/// Indicate whether we have already laid out the checksum table addresses or
270269
/// not.
271270
bool ChecksumOffsetsAssigned = false;
272-
273-
/// Storage of MCCVDefRangeFragment::Ranges.
274-
std::deque<std::pair<const MCSymbol *, const MCSymbol *>> DefRangeStorage;
275271
};
276272

277273
} // end namespace llvm

llvm/include/llvm/MC/MCFragment.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,8 @@ class MCCVInlineLineTableFragment : public MCFragment {
492492

493493
/// Fragment representing the .cv_def_range directive.
494494
class MCCVDefRangeFragment : public MCEncodedFragmentWithFixups<32, 4> {
495-
ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges;
496-
StringRef FixedSizePortion;
495+
SmallVector<std::pair<const MCSymbol *, const MCSymbol *>, 2> Ranges;
496+
SmallString<32> FixedSizePortion;
497497

498498
/// CodeViewContext has the real knowledge about this format, so let it access
499499
/// our members.
@@ -510,7 +510,7 @@ class MCCVDefRangeFragment : public MCEncodedFragmentWithFixups<32, 4> {
510510
return Ranges;
511511
}
512512

513-
StringRef getFixedSizePortion() const { return FixedSizePortion; }
513+
StringRef getFixedSizePortion() const { return FixedSizePortion.str(); }
514514

515515
static bool classof(const MCFragment *F) {
516516
return F->getKind() == MCFragment::FT_CVDefRange;

llvm/lib/MC/MCCodeView.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -444,11 +444,6 @@ MCFragment *CodeViewContext::emitDefRange(
444444
StringRef FixedSizePortion) {
445445
// Create and insert a fragment into the current section that will be encoded
446446
// later.
447-
FixedSizePortion = MCCtx->allocateString(FixedSizePortion);
448-
auto Pos = DefRangeStorage.size();
449-
llvm::append_range(DefRangeStorage, Ranges);
450-
if (!Ranges.empty())
451-
Ranges = {&DefRangeStorage[Pos], Ranges.size()};
452447
auto *F =
453448
MCCtx->allocFragment<MCCVDefRangeFragment>(Ranges, FixedSizePortion);
454449
OS.insert(F);

0 commit comments

Comments
 (0)