88
99#include " MCTargetDesc/CSKYInstPrinter.h"
1010#include " MCTargetDesc/CSKYMCAsmInfo.h"
11- #include " MCTargetDesc/CSKYMCExpr.h"
1211#include " MCTargetDesc/CSKYMCTargetDesc.h"
1312#include " MCTargetDesc/CSKYTargetStreamer.h"
1413#include " TargetInfo/CSKYTargetInfo.h"
@@ -849,11 +848,11 @@ bool CSKYAsmParser::processLRW(MCInst &Inst, SMLoc IDLoc, MCStreamer &Out) {
849848 }
850849 } else {
851850 const MCExpr *AdjustExpr = nullptr ;
852- if (const CSKYMCExpr *CSKYExpr =
853- dyn_cast<CSKYMCExpr >(Inst.getOperand (1 ).getExpr ())) {
854- if (CSKYExpr->getSpecifier () == CSKYMCExpr::VK_TLSGD ||
855- CSKYExpr->getSpecifier () == CSKYMCExpr::VK_TLSIE ||
856- CSKYExpr->getSpecifier () == CSKYMCExpr::VK_TLSLDM ) {
851+ if (const auto *CSKYExpr =
852+ dyn_cast<MCSpecifierExpr >(Inst.getOperand (1 ).getExpr ())) {
853+ if (CSKYExpr->getSpecifier () == CSKY::S_TLSGD ||
854+ CSKYExpr->getSpecifier () == CSKY::S_TLSIE ||
855+ CSKYExpr->getSpecifier () == CSKY::S_TLSLDM ) {
857856 MCSymbol *Dot = getContext ().createNamedTempSymbol ();
858857 Out.emitLabel (Dot);
859858 AdjustExpr = MCSymbolRefExpr::create (Dot, getContext ());
@@ -1173,25 +1172,25 @@ ParseStatus CSKYAsmParser::parseCSKYSymbol(OperandVector &Operands) {
11731172 if (getParser ().parseIdentifier (Identifier))
11741173 return Error (getLoc (), " unknown identifier" );
11751174
1176- CSKYMCExpr ::Specifier Kind = CSKYMCExpr::VK_None ;
1175+ CSKY ::Specifier Kind = CSKY::S_None ;
11771176 if (Identifier.consume_back (" @GOT" ))
1178- Kind = CSKYMCExpr::VK_GOT ;
1177+ Kind = CSKY::S_GOT ;
11791178 else if (Identifier.consume_back (" @GOTOFF" ))
1180- Kind = CSKYMCExpr::VK_GOTOFF ;
1179+ Kind = CSKY::S_GOTOFF ;
11811180 else if (Identifier.consume_back (" @PLT" ))
1182- Kind = CSKYMCExpr::VK_PLT ;
1181+ Kind = CSKY::S_PLT ;
11831182 else if (Identifier.consume_back (" @GOTPC" ))
1184- Kind = CSKYMCExpr::VK_GOTPC ;
1183+ Kind = CSKY::S_GOTPC ;
11851184 else if (Identifier.consume_back (" @TLSGD32" ))
1186- Kind = CSKYMCExpr::VK_TLSGD ;
1185+ Kind = CSKY::S_TLSGD ;
11871186 else if (Identifier.consume_back (" @GOTTPOFF" ))
1188- Kind = CSKYMCExpr::VK_TLSIE ;
1187+ Kind = CSKY::S_TLSIE ;
11891188 else if (Identifier.consume_back (" @TPOFF" ))
1190- Kind = CSKYMCExpr::VK_TLSLE ;
1189+ Kind = CSKY::S_TLSLE ;
11911190 else if (Identifier.consume_back (" @TLSLDM32" ))
1192- Kind = CSKYMCExpr::VK_TLSLDM ;
1191+ Kind = CSKY::S_TLSLDM ;
11931192 else if (Identifier.consume_back (" @TLSLDO32" ))
1194- Kind = CSKYMCExpr::VK_TLSLDO ;
1193+ Kind = CSKY::S_TLSLDO ;
11951194
11961195 MCSymbol *Sym = getContext ().getInlineAsmLabel (Identifier);
11971196
@@ -1211,8 +1210,8 @@ ParseStatus CSKYAsmParser::parseCSKYSymbol(OperandVector &Operands) {
12111210 MCBinaryExpr::Opcode Opcode;
12121211 switch (getLexer ().getKind ()) {
12131212 default :
1214- if (Kind != CSKYMCExpr::VK_None )
1215- Res = CSKYMCExpr ::create (Res, Kind, getContext ());
1213+ if (Kind != CSKY::S_None )
1214+ Res = MCSpecifierExpr ::create (Res, Kind, getContext ());
12161215
12171216 Operands.push_back (CSKYOperand::createImm (Res, S, E));
12181217 return ParseStatus::Success;
@@ -1259,11 +1258,11 @@ ParseStatus CSKYAsmParser::parseDataSymbol(OperandVector &Operands) {
12591258 if (getParser ().parseIdentifier (Identifier))
12601259 return Error (getLoc (), " unknown identifier " + Identifier);
12611260
1262- CSKYMCExpr ::Specifier Kind = CSKYMCExpr::VK_None ;
1261+ CSKY ::Specifier Kind = CSKY::S_None ;
12631262 if (Identifier.consume_back (" @GOT" ))
1264- Kind = CSKYMCExpr::VK_GOT_IMM18_BY4 ;
1263+ Kind = CSKY::S_GOT_IMM18_BY4 ;
12651264 else if (Identifier.consume_back (" @PLT" ))
1266- Kind = CSKYMCExpr::VK_PLT_IMM18_BY4 ;
1265+ Kind = CSKY::S_PLT_IMM18_BY4 ;
12671266
12681267 MCSymbol *Sym = getContext ().getInlineAsmLabel (Identifier);
12691268
@@ -1289,8 +1288,8 @@ ParseStatus CSKYAsmParser::parseDataSymbol(OperandVector &Operands) {
12891288
12901289 getLexer ().Lex (); // Eat ']'.
12911290
1292- if (Kind != CSKYMCExpr::VK_None )
1293- Res = CSKYMCExpr ::create (Res, Kind, getContext ());
1291+ if (Kind != CSKY::S_None )
1292+ Res = MCSpecifierExpr ::create (Res, Kind, getContext ());
12941293
12951294 Operands.push_back (CSKYOperand::createConstpoolOp (Res, S, E));
12961295 return ParseStatus::Success;
0 commit comments