aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCCodeView.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/MC/MCCodeView.cpp')
-rw-r--r--llvm/lib/MC/MCCodeView.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/MC/MCCodeView.cpp b/llvm/lib/MC/MCCodeView.cpp
index 7d528a5..335934a7 100644
--- a/llvm/lib/MC/MCCodeView.cpp
+++ b/llvm/lib/MC/MCCodeView.cpp
@@ -436,12 +436,11 @@ void CodeViewContext::emitInlineLineTableForFunction(MCObjectStreamer &OS,
const MCSymbol *FnEndSym) {
// Create and insert a fragment into the current section that will be encoded
// later.
- auto *F = MCCtx->allocFragment<MCCVInlineLineTableFragment>(
+ OS.newSpecialFragment<MCCVInlineLineTableFragment>(
PrimaryFunctionId, SourceFileId, SourceLineNum, FnStartSym, FnEndSym);
- OS.insert(F);
}
-MCFragment *CodeViewContext::emitDefRange(
+void CodeViewContext::emitDefRange(
MCObjectStreamer &OS,
ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
StringRef FixedSizePortion) {
@@ -451,9 +450,7 @@ MCFragment *CodeViewContext::emitDefRange(
auto &Saved = DefRangeStorage.emplace_back(Ranges.begin(), Ranges.end());
// Create and insert a fragment into the current section that will be encoded
// later.
- auto *F = MCCtx->allocFragment<MCCVDefRangeFragment>(Saved, FixedSizePortion);
- OS.insert(F);
- return F;
+ OS.newSpecialFragment<MCCVDefRangeFragment>(Saved, FixedSizePortion);
}
static unsigned computeLabelDiff(const MCAssembler &Asm, const MCSymbol *Begin,
@@ -695,5 +692,7 @@ void CodeViewContext::encodeDefRange(const MCAssembler &Asm,
}
Frag.setVarContents(Contents);
+ assert(Fixups.size() < 256 && "Store fixups outside of MCFragment's VarFixup "
+ "storage if the number ever exceeds 256");
Frag.setVarFixups(Fixups);
}