mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-02 07:11:49 +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 {
|
||||
MCValue Value;
|
||||
|
||||
// Fast path constants.
|
||||
if (const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(this)) {
|
||||
Res = CE->getValue();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!EvaluateAsRelocatable(Value, Layout) || !Value.isAbsolute())
|
||||
return false;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user