aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCObjectStreamer.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2024-06-12 14:13:20 -0700
committerFangrui Song <i@maskray.me>2024-06-12 14:13:20 -0700
commit2cc4bc132cbcc76c5552cbc128830943ea596b3e (patch)
treed58434234e6a0b9eee485d476dd059fc3d4cc3ec /llvm/lib/MC/MCObjectStreamer.cpp
parent2c6f4864d14402ab815c050caefb23196796694d (diff)
downloadllvm-2cc4bc132cbcc76c5552cbc128830943ea596b3e.zip
llvm-2cc4bc132cbcc76c5552cbc128830943ea596b3e.tar.gz
llvm-2cc4bc132cbcc76c5552cbc128830943ea596b3e.tar.bz2
MCFragment: Initialize Offset to 0
After 9d0754ada5dbbc0c009bcc2f7824488419cc5530 ("[MC] Relax fragments eagerly") removes the assert of Offset, it is no longer useful to initialize the member to -1. Now the symbol value estimate is more precise, which leads to slight behavior change to layout-interdependency.s.
Diffstat (limited to 'llvm/lib/MC/MCObjectStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCObjectStreamer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCObjectStreamer.cpp b/llvm/lib/MC/MCObjectStreamer.cpp
index bf1ce76..ff0558b 100644
--- a/llvm/lib/MC/MCObjectStreamer.cpp
+++ b/llvm/lib/MC/MCObjectStreamer.cpp
@@ -300,7 +300,7 @@ void MCObjectStreamer::emitLabel(MCSymbol *Symbol, SMLoc Loc) {
// Assign all pending labels to offset 0 within the dummy "pending"
// fragment. (They will all be reassigned to a real fragment in
// flushPendingLabels())
- Symbol->setOffset(0);
+ assert(Symbol->getOffset() == 0);
addPendingLabel(Symbol);
}