aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCObjectStreamer.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2024-06-22 21:48:11 -0700
committerFangrui Song <i@maskray.me>2024-06-22 21:48:11 -0700
commit95f983f8239c071712cc42d0d54d3ebfa7c32a22 (patch)
tree262a817f9c5d7517e8f9b2ee70ce45bc91819b1c /llvm/lib/MC/MCObjectStreamer.cpp
parentb37a4b9991a0a669594b53caa0eb75f489211d69 (diff)
downloadllvm-95f983f8239c071712cc42d0d54d3ebfa7c32a22.zip
llvm-95f983f8239c071712cc42d0d54d3ebfa7c32a22.tar.gz
llvm-95f983f8239c071712cc42d0d54d3ebfa7c32a22.tar.bz2
[MC] Change Subsection parameters from const MCExpr * to uint32_t
Follow-up to 05ba5c0648ae5e80d5afce270495bf3b1eef9af4. uint32_t is preferred over const MCExpr * in the section stack uses because it should only be evaluated once. Change the paramter type to match.
Diffstat (limited to 'llvm/lib/MC/MCObjectStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCObjectStreamer.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/llvm/lib/MC/MCObjectStreamer.cpp b/llvm/lib/MC/MCObjectStreamer.cpp
index 6257ad2..25c5768 100644
--- a/llvm/lib/MC/MCObjectStreamer.cpp
+++ b/llvm/lib/MC/MCObjectStreamer.cpp
@@ -285,22 +285,17 @@ void MCObjectStreamer::emitWeakReference(MCSymbol *Alias,
report_fatal_error("This file format doesn't support weak aliases.");
}
-void MCObjectStreamer::changeSection(MCSection *Section,
- const MCExpr *Subsection) {
+void MCObjectStreamer::changeSection(MCSection *Section, uint32_t Subsection) {
changeSectionImpl(Section, Subsection);
}
bool MCObjectStreamer::changeSectionImpl(MCSection *Section,
- const MCExpr *SubsecExpr) {
+ uint32_t Subsection) {
assert(Section && "Cannot switch to a null section!");
getContext().clearDwarfLocSeen();
bool Created = getAssembler().registerSection(*Section);
-
- int64_t Subsec = 0;
- if (SubsecExpr)
- (void)SubsecExpr->evaluateAsAbsolute(Subsec, getAssemblerPtr());
- CurSubsectionIdx = uint32_t(Subsec);
+ CurSubsectionIdx = Subsection;
Section->switchSubsection(CurSubsectionIdx);
return Created;
}