[llvm] 88601d9 - [CSKY] Rename VK_CSKY_ to VK_ and VariantKind to Specifier

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 22 20:56:04 PDT 2025


Author: Fangrui Song
Date: 2025-03-22T20:55:59-07:00
New Revision: 88601d97a4b33ff157d3ffe8a9026c5e8162851b

URL: https://github.com/llvm/llvm-project/commit/88601d97a4b33ff157d3ffe8a9026c5e8162851b
DIFF: https://github.com/llvm/llvm-project/commit/88601d97a4b33ff157d3ffe8a9026c5e8162851b.diff

LOG: [CSKY] Rename VK_CSKY_ to VK_ and VariantKind to Specifier

Similar to the simplification for RISCV and other targets.

Added: 
    

Modified: 
    llvm/lib/Target/CSKY/AsmParser/CSKYAsmParser.cpp
    llvm/lib/Target/CSKY/CSKYAsmPrinter.cpp
    llvm/lib/Target/CSKY/CSKYMCInstLower.cpp
    llvm/lib/Target/CSKY/MCTargetDesc/CSKYELFObjectWriter.cpp
    llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCCodeEmitter.cpp
    llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCExpr.cpp
    llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCExpr.h
    llvm/lib/Target/CSKY/MCTargetDesc/CSKYTargetStreamer.cpp
    llvm/lib/Target/CSKY/MCTargetDesc/CSKYTargetStreamer.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/CSKY/AsmParser/CSKYAsmParser.cpp b/llvm/lib/Target/CSKY/AsmParser/CSKYAsmParser.cpp
index 80239453fb3ff..88bec214f92c9 100644
--- a/llvm/lib/Target/CSKY/AsmParser/CSKYAsmParser.cpp
+++ b/llvm/lib/Target/CSKY/AsmParser/CSKYAsmParser.cpp
@@ -850,9 +850,9 @@ bool CSKYAsmParser::processLRW(MCInst &Inst, SMLoc IDLoc, MCStreamer &Out) {
     const MCExpr *AdjustExpr = nullptr;
     if (const CSKYMCExpr *CSKYExpr =
             dyn_cast<CSKYMCExpr>(Inst.getOperand(1).getExpr())) {
-      if (CSKYExpr->getKind() == CSKYMCExpr::VK_CSKY_TLSGD ||
-          CSKYExpr->getKind() == CSKYMCExpr::VK_CSKY_TLSIE ||
-          CSKYExpr->getKind() == CSKYMCExpr::VK_CSKY_TLSLDM) {
+      if (CSKYExpr->getKind() == CSKYMCExpr::VK_TLSGD ||
+          CSKYExpr->getKind() == CSKYMCExpr::VK_TLSIE ||
+          CSKYExpr->getKind() == CSKYMCExpr::VK_TLSLDM) {
         MCSymbol *Dot = getContext().createNamedTempSymbol();
         Out.emitLabel(Dot);
         AdjustExpr = MCSymbolRefExpr::create(Dot, getContext());
@@ -1172,25 +1172,25 @@ ParseStatus CSKYAsmParser::parseCSKYSymbol(OperandVector &Operands) {
   if (getParser().parseIdentifier(Identifier))
     return Error(getLoc(), "unknown identifier");
 
-  CSKYMCExpr::VariantKind Kind = CSKYMCExpr::VK_CSKY_None;
+  CSKYMCExpr::Specifier Kind = CSKYMCExpr::VK_None;
   if (Identifier.consume_back("@GOT"))
-    Kind = CSKYMCExpr::VK_CSKY_GOT;
+    Kind = CSKYMCExpr::VK_GOT;
   else if (Identifier.consume_back("@GOTOFF"))
-    Kind = CSKYMCExpr::VK_CSKY_GOTOFF;
+    Kind = CSKYMCExpr::VK_GOTOFF;
   else if (Identifier.consume_back("@PLT"))
-    Kind = CSKYMCExpr::VK_CSKY_PLT;
+    Kind = CSKYMCExpr::VK_PLT;
   else if (Identifier.consume_back("@GOTPC"))
-    Kind = CSKYMCExpr::VK_CSKY_GOTPC;
+    Kind = CSKYMCExpr::VK_GOTPC;
   else if (Identifier.consume_back("@TLSGD32"))
-    Kind = CSKYMCExpr::VK_CSKY_TLSGD;
+    Kind = CSKYMCExpr::VK_TLSGD;
   else if (Identifier.consume_back("@GOTTPOFF"))
-    Kind = CSKYMCExpr::VK_CSKY_TLSIE;
+    Kind = CSKYMCExpr::VK_TLSIE;
   else if (Identifier.consume_back("@TPOFF"))
-    Kind = CSKYMCExpr::VK_CSKY_TLSLE;
+    Kind = CSKYMCExpr::VK_TLSLE;
   else if (Identifier.consume_back("@TLSLDM32"))
-    Kind = CSKYMCExpr::VK_CSKY_TLSLDM;
+    Kind = CSKYMCExpr::VK_TLSLDM;
   else if (Identifier.consume_back("@TLSLDO32"))
-    Kind = CSKYMCExpr::VK_CSKY_TLSLDO;
+    Kind = CSKYMCExpr::VK_TLSLDO;
 
   MCSymbol *Sym = getContext().getInlineAsmLabel(Identifier);
 
@@ -1210,7 +1210,7 @@ ParseStatus CSKYAsmParser::parseCSKYSymbol(OperandVector &Operands) {
   MCBinaryExpr::Opcode Opcode;
   switch (getLexer().getKind()) {
   default:
-    if (Kind != CSKYMCExpr::VK_CSKY_None)
+    if (Kind != CSKYMCExpr::VK_None)
       Res = CSKYMCExpr::create(Res, Kind, getContext());
 
     Operands.push_back(CSKYOperand::createImm(Res, S, E));
@@ -1258,11 +1258,11 @@ ParseStatus CSKYAsmParser::parseDataSymbol(OperandVector &Operands) {
   if (getParser().parseIdentifier(Identifier))
     return Error(getLoc(), "unknown identifier " + Identifier);
 
-  CSKYMCExpr::VariantKind Kind = CSKYMCExpr::VK_CSKY_None;
+  CSKYMCExpr::Specifier Kind = CSKYMCExpr::VK_None;
   if (Identifier.consume_back("@GOT"))
-    Kind = CSKYMCExpr::VK_CSKY_GOT_IMM18_BY4;
+    Kind = CSKYMCExpr::VK_GOT_IMM18_BY4;
   else if (Identifier.consume_back("@PLT"))
-    Kind = CSKYMCExpr::VK_CSKY_PLT_IMM18_BY4;
+    Kind = CSKYMCExpr::VK_PLT_IMM18_BY4;
 
   MCSymbol *Sym = getContext().getInlineAsmLabel(Identifier);
 
@@ -1288,7 +1288,7 @@ ParseStatus CSKYAsmParser::parseDataSymbol(OperandVector &Operands) {
 
     getLexer().Lex(); // Eat ']'.
 
-    if (Kind != CSKYMCExpr::VK_CSKY_None)
+    if (Kind != CSKYMCExpr::VK_None)
       Res = CSKYMCExpr::create(Res, Kind, getContext());
 
     Operands.push_back(CSKYOperand::createConstpoolOp(Res, S, E));

diff  --git a/llvm/lib/Target/CSKY/CSKYAsmPrinter.cpp b/llvm/lib/Target/CSKY/CSKYAsmPrinter.cpp
index 7ab3b5cb81c2d..9a259eac52f47 100644
--- a/llvm/lib/Target/CSKY/CSKYAsmPrinter.cpp
+++ b/llvm/lib/Target/CSKY/CSKYAsmPrinter.cpp
@@ -168,25 +168,25 @@ void CSKYAsmPrinter::emitInstruction(const MachineInstr *MI) {
 
 // Convert a CSKY-specific constant pool modifier into the associated
 // MCSymbolRefExpr variant kind.
-static CSKYMCExpr::VariantKind
+static CSKYMCExpr::Specifier
 getModifierVariantKind(CSKYCP::CSKYCPModifier Modifier) {
   switch (Modifier) {
   case CSKYCP::NO_MOD:
-    return CSKYMCExpr::VK_CSKY_None;
+    return CSKYMCExpr::VK_None;
   case CSKYCP::ADDR:
-    return CSKYMCExpr::VK_CSKY_ADDR;
+    return CSKYMCExpr::VK_ADDR;
   case CSKYCP::GOT:
-    return CSKYMCExpr::VK_CSKY_GOT;
+    return CSKYMCExpr::VK_GOT;
   case CSKYCP::GOTOFF:
-    return CSKYMCExpr::VK_CSKY_GOTOFF;
+    return CSKYMCExpr::VK_GOTOFF;
   case CSKYCP::PLT:
-    return CSKYMCExpr::VK_CSKY_PLT;
+    return CSKYMCExpr::VK_PLT;
   case CSKYCP::TLSGD:
-    return CSKYMCExpr::VK_CSKY_TLSGD;
+    return CSKYMCExpr::VK_TLSGD;
   case CSKYCP::TLSLE:
-    return CSKYMCExpr::VK_CSKY_TLSLE;
+    return CSKYMCExpr::VK_TLSLE;
   case CSKYCP::TLSIE:
-    return CSKYMCExpr::VK_CSKY_TLSIE;
+    return CSKYMCExpr::VK_TLSIE;
   }
   llvm_unreachable("Invalid CSKYCPModifier!");
 }

diff  --git a/llvm/lib/Target/CSKY/CSKYMCInstLower.cpp b/llvm/lib/Target/CSKY/CSKYMCInstLower.cpp
index 5fe7eea4f236b..a91f94bb2357a 100644
--- a/llvm/lib/Target/CSKY/CSKYMCInstLower.cpp
+++ b/llvm/lib/Target/CSKY/CSKYMCInstLower.cpp
@@ -36,38 +36,38 @@ void CSKYMCInstLower::Lower(const MachineInstr *MI, MCInst &OutMI) const {
 
 MCOperand CSKYMCInstLower::lowerSymbolOperand(const MachineOperand &MO,
                                               MCSymbol *Sym) const {
-  CSKYMCExpr::VariantKind Kind;
+  CSKYMCExpr::Specifier Spec;
   MCContext &Ctx = Printer.OutContext;
 
   switch (MO.getTargetFlags()) {
   default:
     llvm_unreachable("Unknown target flag.");
   case CSKYII::MO_None:
-    Kind = CSKYMCExpr::VK_CSKY_None;
+    Spec = CSKYMCExpr::VK_None;
     break;
   case CSKYII::MO_GOT32:
-    Kind = CSKYMCExpr::VK_CSKY_GOT;
+    Spec = CSKYMCExpr::VK_GOT;
     break;
   case CSKYII::MO_GOTOFF:
-    Kind = CSKYMCExpr::VK_CSKY_GOTOFF;
+    Spec = CSKYMCExpr::VK_GOTOFF;
     break;
   case CSKYII::MO_ADDR32:
-    Kind = CSKYMCExpr::VK_CSKY_ADDR;
+    Spec = CSKYMCExpr::VK_ADDR;
     break;
   case CSKYII::MO_PLT32:
-    Kind = CSKYMCExpr::VK_CSKY_PLT;
+    Spec = CSKYMCExpr::VK_PLT;
     break;
   case CSKYII::MO_ADDR_HI16:
-    Kind = CSKYMCExpr::VK_CSKY_ADDR_HI16;
+    Spec = CSKYMCExpr::VK_ADDR_HI16;
     break;
   case CSKYII::MO_ADDR_LO16:
-    Kind = CSKYMCExpr::VK_CSKY_ADDR_LO16;
+    Spec = CSKYMCExpr::VK_ADDR_LO16;
     break;
   }
   const MCExpr *ME = MCSymbolRefExpr::create(Sym, Ctx);
 
-  if (Kind != CSKYMCExpr::VK_CSKY_None)
-    ME = CSKYMCExpr::create(ME, Kind, Ctx);
+  if (Spec != CSKYMCExpr::VK_None)
+    ME = CSKYMCExpr::create(ME, Spec, Ctx);
 
   return MCOperand::createExpr(ME);
 }

diff  --git a/llvm/lib/Target/CSKY/MCTargetDesc/CSKYELFObjectWriter.cpp b/llvm/lib/Target/CSKY/MCTargetDesc/CSKYELFObjectWriter.cpp
index 2548c83770ffb..f305770bf559a 100644
--- a/llvm/lib/Target/CSKY/MCTargetDesc/CSKYELFObjectWriter.cpp
+++ b/llvm/lib/Target/CSKY/MCTargetDesc/CSKYELFObjectWriter.cpp
@@ -80,27 +80,27 @@ unsigned CSKYELFObjectWriter::getRelocType(MCContext &Ctx,
   case FK_Data_4:
     if (Expr->getKind() == MCExpr::Target) {
       auto TK = cast<CSKYMCExpr>(Expr)->getKind();
-      if (TK == CSKYMCExpr::VK_CSKY_ADDR)
+      if (TK == CSKYMCExpr::VK_ADDR)
         return ELF::R_CKCORE_ADDR32;
-      if (TK == CSKYMCExpr::VK_CSKY_GOT)
+      if (TK == CSKYMCExpr::VK_GOT)
         return ELF::R_CKCORE_GOT32;
-      if (TK == CSKYMCExpr::VK_CSKY_GOTOFF)
+      if (TK == CSKYMCExpr::VK_GOTOFF)
         return ELF::R_CKCORE_GOTOFF;
-      if (TK == CSKYMCExpr::VK_CSKY_PLT)
+      if (TK == CSKYMCExpr::VK_PLT)
         return ELF::R_CKCORE_PLT32;
-      if (TK == CSKYMCExpr::VK_CSKY_TLSIE)
+      if (TK == CSKYMCExpr::VK_TLSIE)
         return ELF::R_CKCORE_TLS_IE32;
-      if (TK == CSKYMCExpr::VK_CSKY_TLSLE)
+      if (TK == CSKYMCExpr::VK_TLSLE)
         return ELF::R_CKCORE_TLS_LE32;
-      if (TK == CSKYMCExpr::VK_CSKY_TLSGD)
+      if (TK == CSKYMCExpr::VK_TLSGD)
         return ELF::R_CKCORE_TLS_GD32;
-      if (TK == CSKYMCExpr::VK_CSKY_TLSLDM)
+      if (TK == CSKYMCExpr::VK_TLSLDM)
         return ELF::R_CKCORE_TLS_LDM32;
-      if (TK == CSKYMCExpr::VK_CSKY_TLSLDO)
+      if (TK == CSKYMCExpr::VK_TLSLDO)
         return ELF::R_CKCORE_TLS_LDO32;
-      if (TK == CSKYMCExpr::VK_CSKY_GOTPC)
+      if (TK == CSKYMCExpr::VK_GOTPC)
         return ELF::R_CKCORE_GOTPC;
-      if (TK == CSKYMCExpr::VK_CSKY_None)
+      if (TK == CSKYMCExpr::VK_None)
         return ELF::R_CKCORE_ADDR32;
 
       LLVM_DEBUG(dbgs() << "Unknown FK_Data_4 TK  = " << TK);

diff  --git a/llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCCodeEmitter.cpp b/llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCCodeEmitter.cpp
index acee2916de17c..c508b0121888a 100644
--- a/llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCCodeEmitter.cpp
+++ b/llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCCodeEmitter.cpp
@@ -298,23 +298,23 @@ MCFixupKind CSKYMCCodeEmitter::getTargetFixup(const MCExpr *Expr) const {
   switch (CSKYExpr->getKind()) {
   default:
     llvm_unreachable("Unhandled fixup kind!");
-  case CSKYMCExpr::VK_CSKY_ADDR:
+  case CSKYMCExpr::VK_ADDR:
     return MCFixupKind(CSKY::fixup_csky_addr32);
-  case CSKYMCExpr::VK_CSKY_ADDR_HI16:
+  case CSKYMCExpr::VK_ADDR_HI16:
     return MCFixupKind(CSKY::fixup_csky_addr_hi16);
-  case CSKYMCExpr::VK_CSKY_ADDR_LO16:
+  case CSKYMCExpr::VK_ADDR_LO16:
     return MCFixupKind(CSKY::fixup_csky_addr_lo16);
-  case CSKYMCExpr::VK_CSKY_GOT:
+  case CSKYMCExpr::VK_GOT:
     return MCFixupKind(CSKY::fixup_csky_got32);
-  case CSKYMCExpr::VK_CSKY_GOTPC:
+  case CSKYMCExpr::VK_GOTPC:
     return MCFixupKind(CSKY::fixup_csky_gotpc);
-  case CSKYMCExpr::VK_CSKY_GOTOFF:
+  case CSKYMCExpr::VK_GOTOFF:
     return MCFixupKind(CSKY::fixup_csky_gotoff);
-  case CSKYMCExpr::VK_CSKY_PLT:
+  case CSKYMCExpr::VK_PLT:
     return MCFixupKind(CSKY::fixup_csky_plt32);
-  case CSKYMCExpr::VK_CSKY_PLT_IMM18_BY4:
+  case CSKYMCExpr::VK_PLT_IMM18_BY4:
     return MCFixupKind(CSKY::fixup_csky_plt_imm18_scale4);
-  case CSKYMCExpr::VK_CSKY_GOT_IMM18_BY4:
+  case CSKYMCExpr::VK_GOT_IMM18_BY4:
     return MCFixupKind(CSKY::fixup_csky_got_imm18_scale4);
   }
 }

diff  --git a/llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCExpr.cpp b/llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCExpr.cpp
index 5fcc49005506d..daed79f3aa58c 100644
--- a/llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCExpr.cpp
+++ b/llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCExpr.cpp
@@ -19,41 +19,41 @@ using namespace llvm;
 
 #define DEBUG_TYPE "csky-mc-expr"
 
-const CSKYMCExpr *CSKYMCExpr::create(const MCExpr *Expr, VariantKind Kind,
+const CSKYMCExpr *CSKYMCExpr::create(const MCExpr *Expr, Specifier Kind,
                                      MCContext &Ctx) {
-  return new (Ctx) CSKYMCExpr(Kind, Expr);
+  return new (Ctx) CSKYMCExpr(Expr, Kind);
 }
 
-StringRef CSKYMCExpr::getVariantKindName(VariantKind Kind) {
+StringRef CSKYMCExpr::getVariantKindName(Specifier Kind) {
   switch (Kind) {
   default:
     llvm_unreachable("Invalid ELF symbol kind");
-  case VK_CSKY_None:
-  case VK_CSKY_ADDR:
+  case VK_None:
+  case VK_ADDR:
     return "";
-  case VK_CSKY_ADDR_HI16:
+  case VK_ADDR_HI16:
     return "@HI16";
-  case VK_CSKY_ADDR_LO16:
+  case VK_ADDR_LO16:
     return "@LO16";
-  case VK_CSKY_GOT_IMM18_BY4:
-  case VK_CSKY_GOT:
+  case VK_GOT_IMM18_BY4:
+  case VK_GOT:
     return "@GOT";
-  case VK_CSKY_GOTPC:
+  case VK_GOTPC:
     return "@GOTPC";
-  case VK_CSKY_GOTOFF:
+  case VK_GOTOFF:
     return "@GOTOFF";
-  case VK_CSKY_PLT_IMM18_BY4:
-  case VK_CSKY_PLT:
+  case VK_PLT_IMM18_BY4:
+  case VK_PLT:
     return "@PLT";
-  case VK_CSKY_TLSLE:
+  case VK_TLSLE:
     return "@TPOFF";
-  case VK_CSKY_TLSIE:
+  case VK_TLSIE:
     return "@GOTTPOFF";
-  case VK_CSKY_TLSGD:
+  case VK_TLSGD:
     return "@TLSGD32";
-  case VK_CSKY_TLSLDO:
+  case VK_TLSLDO:
     return "@TLSLDO32";
-  case VK_CSKY_TLSLDM:
+  case VK_TLSLDM:
     return "@TLSLDM32";
   }
 }
@@ -100,9 +100,9 @@ void CSKYMCExpr::fixELFSymbolsInTLSFixups(MCAssembler &Asm) const {
   switch (getKind()) {
   default:
     return;
-  case VK_CSKY_TLSLE:
-  case VK_CSKY_TLSIE:
-  case VK_CSKY_TLSGD:
+  case VK_TLSLE:
+  case VK_TLSIE:
+  case VK_TLSGD:
     break;
   }
 
@@ -119,17 +119,17 @@ bool CSKYMCExpr::evaluateAsRelocatableImpl(MCValue &Res,
     switch (getKind()) {
     default:
       return true;
-    case VK_CSKY_GOT:
-    case VK_CSKY_GOT_IMM18_BY4:
-    case VK_CSKY_GOTPC:
-    case VK_CSKY_GOTOFF:
-    case VK_CSKY_PLT:
-    case VK_CSKY_PLT_IMM18_BY4:
-    case VK_CSKY_TLSIE:
-    case VK_CSKY_TLSLE:
-    case VK_CSKY_TLSGD:
-    case VK_CSKY_TLSLDO:
-    case VK_CSKY_TLSLDM:
+    case VK_GOT:
+    case VK_GOT_IMM18_BY4:
+    case VK_GOTPC:
+    case VK_GOTOFF:
+    case VK_PLT:
+    case VK_PLT_IMM18_BY4:
+    case VK_TLSIE:
+    case VK_TLSLE:
+    case VK_TLSGD:
+    case VK_TLSLDO:
+    case VK_TLSLDM:
       return false;
     }
   }

diff  --git a/llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCExpr.h b/llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCExpr.h
index db97bbef576ec..e24c7589a1fa3 100644
--- a/llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCExpr.h
+++ b/llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCExpr.h
@@ -16,39 +16,39 @@ namespace llvm {
 
 class CSKYMCExpr : public MCTargetExpr {
 public:
-  enum VariantKind {
-    VK_CSKY_None,
-    VK_CSKY_ADDR,
-    VK_CSKY_ADDR_HI16,
-    VK_CSKY_ADDR_LO16,
-    VK_CSKY_PCREL,
-    VK_CSKY_GOT,
-    VK_CSKY_GOT_IMM18_BY4,
-    VK_CSKY_GOTPC,
-    VK_CSKY_GOTOFF,
-    VK_CSKY_PLT,
-    VK_CSKY_PLT_IMM18_BY4,
-    VK_CSKY_TLSIE,
-    VK_CSKY_TLSLE,
-    VK_CSKY_TLSGD,
-    VK_CSKY_TLSLDO,
-    VK_CSKY_TLSLDM,
-    VK_CSKY_Invalid
+  enum Specifier : uint8_t {
+    VK_None,
+    VK_ADDR = MCSymbolRefExpr::FirstTargetSpecifier,
+    VK_ADDR_HI16,
+    VK_ADDR_LO16,
+    VK_PCREL,
+    VK_GOT,
+    VK_GOT_IMM18_BY4,
+    VK_GOTPC,
+    VK_GOTOFF,
+    VK_PLT,
+    VK_PLT_IMM18_BY4,
+    VK_TLSIE,
+    VK_TLSLE,
+    VK_TLSGD,
+    VK_TLSLDO,
+    VK_TLSLDM,
+    VK_Invalid
   };
 
 private:
-  const VariantKind Kind;
   const MCExpr *Expr;
+  const Specifier specifier;
 
-  explicit CSKYMCExpr(VariantKind Kind, const MCExpr *Expr)
-      : Kind(Kind), Expr(Expr) {}
+  explicit CSKYMCExpr(const MCExpr *Expr, Specifier S)
+      : Expr(Expr), specifier(S) {}
 
 public:
-  static const CSKYMCExpr *create(const MCExpr *Expr, VariantKind Kind,
+  static const CSKYMCExpr *create(const MCExpr *Expr, Specifier Kind,
                                   MCContext &Ctx);
 
   // Returns the kind of this expression.
-  VariantKind getKind() const { return Kind; }
+  Specifier getKind() const { return specifier; }
 
   // Returns the child of this expression.
   const MCExpr *getSubExpr() const { return Expr; }
@@ -69,7 +69,7 @@ class CSKYMCExpr : public MCTargetExpr {
     return E->getKind() == MCExpr::Target;
   }
 
-  static StringRef getVariantKindName(VariantKind Kind);
+  static StringRef getVariantKindName(Specifier Kind);
 };
 } // end namespace llvm
 

diff  --git a/llvm/lib/Target/CSKY/MCTargetDesc/CSKYTargetStreamer.cpp b/llvm/lib/Target/CSKY/MCTargetDesc/CSKYTargetStreamer.cpp
index 00942414d484c..796d60c815b31 100644
--- a/llvm/lib/Target/CSKY/MCTargetDesc/CSKYTargetStreamer.cpp
+++ b/llvm/lib/Target/CSKY/MCTargetDesc/CSKYTargetStreamer.cpp
@@ -84,7 +84,7 @@ CSKYTargetStreamer::CSKYTargetStreamer(MCStreamer &S)
 const MCExpr *
 CSKYTargetStreamer::addConstantPoolEntry(const MCExpr *Expr, SMLoc Loc,
                                          const MCExpr *AdjustExpr) {
-  auto ELFRefKind = CSKYMCExpr::VK_CSKY_Invalid;
+  auto ELFRefKind = CSKYMCExpr::VK_Invalid;
   ConstantCounter++;
 
   const MCExpr *OrigExpr = Expr;

diff  --git a/llvm/lib/Target/CSKY/MCTargetDesc/CSKYTargetStreamer.h b/llvm/lib/Target/CSKY/MCTargetDesc/CSKYTargetStreamer.h
index 270d48d5939c7..03d5a7b0e08cb 100644
--- a/llvm/lib/Target/CSKY/MCTargetDesc/CSKYTargetStreamer.h
+++ b/llvm/lib/Target/CSKY/MCTargetDesc/CSKYTargetStreamer.h
@@ -46,7 +46,7 @@ class CSKYTargetStreamer : public MCTargetStreamer {
 public:
   typedef struct {
     const MCSymbol *sym;
-    CSKYMCExpr::VariantKind kind;
+    CSKYMCExpr::Specifier kind;
   } SymbolIndex;
 
 protected:
@@ -76,10 +76,10 @@ class CSKYTargetStreamer : public MCTargetStreamer {
 
 template <> struct DenseMapInfo<CSKYTargetStreamer::SymbolIndex> {
   static inline CSKYTargetStreamer::SymbolIndex getEmptyKey() {
-    return {nullptr, CSKYMCExpr::VK_CSKY_Invalid};
+    return {nullptr, CSKYMCExpr::VK_Invalid};
   }
   static inline CSKYTargetStreamer::SymbolIndex getTombstoneKey() {
-    return {nullptr, CSKYMCExpr::VK_CSKY_Invalid};
+    return {nullptr, CSKYMCExpr::VK_Invalid};
   }
   static unsigned getHashValue(const CSKYTargetStreamer::SymbolIndex &V) {
     return hash_combine(DenseMapInfo<const MCSymbol *>::getHashValue(V.sym),


        


More information about the llvm-commits mailing list