diff options
author | Fangrui Song <i@maskray.me> | 2025-03-15 15:33:09 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2025-03-15 15:33:09 -0700 |
commit | ff2ed154a8a9ea52adb3667833fe6fddd27b0487 (patch) | |
tree | a83f5e599a29713c050cfe781605f820d6f7d78b /llvm/lib/MC/MachObjectWriter.cpp | |
parent | 5e65b40f9c0fd9fc9bc17c36dbd5ee1beec15d4f (diff) | |
download | llvm-ff2ed154a8a9ea52adb3667833fe6fddd27b0487.zip llvm-ff2ed154a8a9ea52adb3667833fe6fddd27b0487.tar.gz llvm-ff2ed154a8a9ea52adb3667833fe6fddd27b0487.tar.bz2 |
[MC] evaluateAsAbsolute requires MCValue::RefKind==0
In `.equ a, 3; .if a@plt`, a@plt does not evaluate to an absolute value
(MCExpr::evaluateAsRelocatableImpl disables evaluation when the Kind !=
0 at parse time). Similarly, when using MCTargetValue,
evaluateAsAbsolute should return false when MCValue::RefKind==0.
This allows us to remove `if (!Asm)` check from MipsMCExpr.cpp
(%hi(0xdeadbeef) is not evaluated to a constant without RefKind) and
make targets less error-prone.
Diffstat (limited to 'llvm/lib/MC/MachObjectWriter.cpp')
0 files changed, 0 insertions, 0 deletions