@@ -339,7 +339,6 @@ class MipsAsmParser : public MCTargetAsmParser {
339
339
340
340
bool parseMemOffset (const MCExpr *&Res, bool isParenExpr);
341
341
342
- bool isEvaluated (const MCExpr *Expr);
343
342
bool parseSetMips0Directive ();
344
343
bool parseSetArchDirective ();
345
344
bool parseSetFeature (uint64_t Feature);
@@ -1796,6 +1795,26 @@ static unsigned countMCSymbolRefExpr(const MCExpr *Expr) {
1796
1795
return 0 ;
1797
1796
}
1798
1797
1798
+ static bool isEvaluated (const MCExpr *Expr) {
1799
+ switch (Expr->getKind ()) {
1800
+ case MCExpr::Constant:
1801
+ return true ;
1802
+ case MCExpr::SymbolRef:
1803
+ return (cast<MCSymbolRefExpr>(Expr)->getKind () != MCSymbolRefExpr::VK_None);
1804
+ case MCExpr::Binary: {
1805
+ const MCBinaryExpr *BE = cast<MCBinaryExpr>(Expr);
1806
+ if (!isEvaluated (BE->getLHS ()))
1807
+ return false ;
1808
+ return isEvaluated (BE->getRHS ());
1809
+ }
1810
+ case MCExpr::Unary:
1811
+ return isEvaluated (cast<MCUnaryExpr>(Expr)->getSubExpr ());
1812
+ case MCExpr::Target:
1813
+ return true ;
1814
+ }
1815
+ return false ;
1816
+ }
1817
+
1799
1818
bool MipsAsmParser::processInstruction (MCInst &Inst, SMLoc IDLoc,
1800
1819
MCStreamer &Out,
1801
1820
const MCSubtargetInfo *STI) {
@@ -6094,26 +6113,6 @@ bool MipsAsmParser::parseOperand(OperandVector &Operands, StringRef Mnemonic) {
6094
6113
return true ;
6095
6114
}
6096
6115
6097
- bool MipsAsmParser::isEvaluated (const MCExpr *Expr) {
6098
- switch (Expr->getKind ()) {
6099
- case MCExpr::Constant:
6100
- return true ;
6101
- case MCExpr::SymbolRef:
6102
- return (cast<MCSymbolRefExpr>(Expr)->getKind () != MCSymbolRefExpr::VK_None);
6103
- case MCExpr::Binary: {
6104
- const MCBinaryExpr *BE = cast<MCBinaryExpr>(Expr);
6105
- if (!isEvaluated (BE->getLHS ()))
6106
- return false ;
6107
- return isEvaluated (BE->getRHS ());
6108
- }
6109
- case MCExpr::Unary:
6110
- return isEvaluated (cast<MCUnaryExpr>(Expr)->getSubExpr ());
6111
- case MCExpr::Target:
6112
- return true ;
6113
- }
6114
- return false ;
6115
- }
6116
-
6117
6116
bool MipsAsmParser::ParseRegister (unsigned &RegNo, SMLoc &StartLoc,
6118
6117
SMLoc &EndLoc) {
6119
6118
SmallVector<std::unique_ptr<MCParsedAsmOperand>, 1 > Operands;
0 commit comments