mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-23 00:20:25 +00:00
add scaffolding for target-specific MCExprs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95559 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -17,6 +17,8 @@ using namespace llvm;
|
||||
|
||||
void MCExpr::print(raw_ostream &OS) const {
|
||||
switch (getKind()) {
|
||||
case MCExpr::Target:
|
||||
return cast<MCTargetExpr>(this)->PrintImpl(OS);
|
||||
case MCExpr::Constant:
|
||||
OS << cast<MCConstantExpr>(*this).getValue();
|
||||
return;
|
||||
@@ -131,6 +133,7 @@ const MCSymbolRefExpr *MCSymbolRefExpr::Create(StringRef Name, MCContext &Ctx) {
|
||||
return Create(Ctx.GetOrCreateSymbol(Name), Ctx);
|
||||
}
|
||||
|
||||
MCTargetExpr::~MCTargetExpr() {}
|
||||
|
||||
/* *** */
|
||||
|
||||
@@ -168,6 +171,9 @@ static bool EvaluateSymbolicAdd(const MCValue &LHS, const MCSymbol *RHS_A,
|
||||
|
||||
bool MCExpr::EvaluateAsRelocatable(MCValue &Res) const {
|
||||
switch (getKind()) {
|
||||
case Target:
|
||||
return cast<MCTargetExpr>(this)->EvaluateAsRelocatableImpl(Res);
|
||||
|
||||
case Constant:
|
||||
Res = MCValue::get(cast<MCConstantExpr>(this)->getValue());
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user