diff options
author | Fangrui Song <i@maskray.me> | 2024-06-27 22:00:40 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2024-06-27 22:00:40 -0700 |
commit | fadc72235ed59eba8538d803fba5c79cd9cda5e9 (patch) | |
tree | e39469acacc6d5500babcc4e92247d21d83045d1 /llvm/lib/MC/MCStreamer.cpp | |
parent | 567b2c608c307c097315dd5ec4d6a5bbcddf898d (diff) | |
download | llvm-fadc72235ed59eba8538d803fba5c79cd9cda5e9.zip llvm-fadc72235ed59eba8538d803fba5c79cd9cda5e9.tar.gz llvm-fadc72235ed59eba8538d803fba5c79cd9cda5e9.tar.bz2 |
[MC] switchSectionNoPrint: update CurFrag
To ensure that CurFrag->Parent and SectionStack.back() are in sync.
Diffstat (limited to 'llvm/lib/MC/MCStreamer.cpp')
-rw-r--r-- | llvm/lib/MC/MCStreamer.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCStreamer.cpp b/llvm/lib/MC/MCStreamer.cpp index cfc27be..c0879fd 100644 --- a/llvm/lib/MC/MCStreamer.cpp +++ b/llvm/lib/MC/MCStreamer.cpp @@ -1290,6 +1290,12 @@ bool MCStreamer::switchSection(MCSection *Section, const MCExpr *SubsecExpr) { return false; } +void MCStreamer::switchSectionNoPrint(MCSection *Section) { + SectionStack.back().second = SectionStack.back().first; + SectionStack.back().first = MCSectionSubPair(Section, 0); + CurFrag = &Section->getDummyFragment(); +} + MCSymbol *MCStreamer::endSection(MCSection *Section) { // TODO: keep track of the last subsection so that this symbol appears in the // correct place. |