diff options
author | Fangrui Song <i@maskray.me> | 2025-07-28 22:12:15 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-28 22:12:15 -0700 |
commit | f36ce53adf9294556c5d5f5f55c484c923f0c286 (patch) | |
tree | f80190927e0739e6573cc5722fefeef594cab245 /llvm/lib/MC/MCWin64EH.cpp | |
parent | 96a9e8c9fa4ed8e53c5a13669e9dea16a566c48a (diff) | |
download | llvm-f36ce53adf9294556c5d5f5f55c484c923f0c286.zip llvm-f36ce53adf9294556c5d5f5f55c484c923f0c286.tar.gz llvm-f36ce53adf9294556c5d5f5f55c484c923f0c286.tar.bz2 |
MCFragment: Use trailing data for fixed-size part
The fixed-size content of the MCFragment object is now stored as
trailing data, replacing ContentStart/ContentEnd with ContentSize. The
available space for trailing data is tracked using `FragSpace`. If the
available space is insufficient, a new block is allocated within the
bump allocator `MCObjectStreamer::FragStorage`.
FragList::Tail cannot be reused when switching sections or subsections,
as it is not associated with the fragment space tracked by `FragSpace`.
Instead, allocate a new fragment, which becomes less expensive after #150574.
Data can only be appended to the tail fragment of a subsection, not to
fragments in the middle. Post-assembler-layout adjustments (such as
.llvm_addrsig and .llvm.call-graph-profile) have been updated to use the
variable-size part instead.
Pull Request: https://github.com/llvm/llvm-project/pull/150846
Diffstat (limited to 'llvm/lib/MC/MCWin64EH.cpp')
-rw-r--r-- | llvm/lib/MC/MCWin64EH.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCWin64EH.cpp b/llvm/lib/MC/MCWin64EH.cpp index 72a8dd7..a87648a 100644 --- a/llvm/lib/MC/MCWin64EH.cpp +++ b/llvm/lib/MC/MCWin64EH.cpp @@ -318,6 +318,9 @@ static void EmitUnwindInfo(MCStreamer &streamer, WinEH::FrameInfo *info) { // Emit the epilog instructions. if (EnableUnwindV2) { + // Ensure the fixups and appended content apply to the same fragment. + OS->ensureHeadroom(info->EpilogMap.size() * 2); + bool IsLast = true; for (const auto &Epilog : llvm::reverse(info->EpilogMap)) { if (IsLast) { |