aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCCodeView.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2025-06-29 18:56:02 -0700
committerFangrui Song <i@maskray.me>2025-06-29 18:56:02 -0700
commite47d4010d34119c2b4a28e7609fde35449a8b437 (patch)
treee2873304d607922b49ebb13a1d639870fff56c2d /llvm/lib/MC/MCCodeView.cpp
parent9a6e0688b04f1122012548b5f7d627ed347acfba (diff)
downloadllvm-e47d4010d34119c2b4a28e7609fde35449a8b437.zip
llvm-e47d4010d34119c2b4a28e7609fde35449a8b437.tar.gz
llvm-e47d4010d34119c2b4a28e7609fde35449a8b437.tar.bz2
CodeView: Move MCCVDefRangeFragment storage to MCContext/MCFragment
Work toward making ~MCCVInlineLineTableFragment trivial.
Diffstat (limited to 'llvm/lib/MC/MCCodeView.cpp')
-rw-r--r--llvm/lib/MC/MCCodeView.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCCodeView.cpp b/llvm/lib/MC/MCCodeView.cpp
index 1407bc5..e053747 100644
--- a/llvm/lib/MC/MCCodeView.cpp
+++ b/llvm/lib/MC/MCCodeView.cpp
@@ -444,6 +444,11 @@ MCFragment *CodeViewContext::emitDefRange(
StringRef FixedSizePortion) {
// Create and insert a fragment into the current section that will be encoded
// later.
+ FixedSizePortion = MCCtx->allocateString(FixedSizePortion);
+ auto Pos = DefRangeStorage.size();
+ llvm::append_range(DefRangeStorage, Ranges);
+ if (!Ranges.empty())
+ Ranges = {&DefRangeStorage[Pos], Ranges.size()};
auto *F =
MCCtx->allocFragment<MCCVDefRangeFragment>(Ranges, FixedSizePortion);
OS.insert(F);