mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-26 07:34:14 +00:00
llvm-mc: Fast path EvaluateAbsolute of constants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99348 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9972aff7da
commit
ef6e96f91f
@ -194,6 +194,12 @@ void MCTargetExpr::Anchor() {}
|
|||||||
bool MCExpr::EvaluateAsAbsolute(int64_t &Res, const MCAsmLayout *Layout) const {
|
bool MCExpr::EvaluateAsAbsolute(int64_t &Res, const MCAsmLayout *Layout) const {
|
||||||
MCValue Value;
|
MCValue Value;
|
||||||
|
|
||||||
|
// Fast path constants.
|
||||||
|
if (const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(this)) {
|
||||||
|
Res = CE->getValue();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (!EvaluateAsRelocatable(Value, Layout) || !Value.isAbsolute())
|
if (!EvaluateAsRelocatable(Value, Layout) || !Value.isAbsolute())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user