[TableGen] const char *const x => const char x[]
authorFangrui Song <i@maskray.me>
Sat, 11 Jun 2022 02:13:59 +0000 (19:13 -0700)
committerFangrui Song <i@maskray.me>
Sat, 11 Jun 2022 02:13:59 +0000 (19:13 -0700)
llvm/test/TableGen/MixedCasedMnemonic.td
llvm/test/TableGen/bare-minimum-psets.td
llvm/test/TableGen/inhibit-pset.td
llvm/utils/TableGen/AsmMatcherEmitter.cpp
llvm/utils/TableGen/CodeGenTarget.cpp
llvm/utils/TableGen/RegisterInfoEmitter.cpp

index 3dd6a21..3dc44ab 100644 (file)
@@ -40,7 +40,7 @@ def :MnemonicAlias<"Insta", "aInst">;
 def :MnemonicAlias<"InstB", "BInst">;
 
 // Check that the matcher lower()s the mnemonics it matches.
-// MATCHER: static const char *const MnemonicTable =
+// MATCHER: static const char MnemonicTable[] =
 // MATCHER-NEXT: "\005ainst\005binst";
 
 // Check that aInst appears before BInst in the match table.
index e5c842c..25e0bd2 100644 (file)
@@ -48,7 +48,7 @@ def MyTarget : Target;
 // NAMESPACE-NEXT: } // end namespace TestNamespace
 
 // CHECK-LABEL: getRegPressureSetName(unsigned Idx) const {
-// CHECK-NEXT:    static const char *const PressureNameTable[] = {
+// CHECK-NEXT:    static const char *PressureNameTable[] = {
 // CHECK-NEXT:      "D_32",
 // CHECK-NEXT:    };
 // CHECK-NEXT:    return PressureNameTable[Idx];
index d9f5613..1f4f8a1 100644 (file)
@@ -8,7 +8,7 @@ include "reg-with-subregs-common.td"
 def X0 : Register <"x0">;
 
 // CHECK-LABEL: getRegPressureSetName(unsigned Idx) const {
-// CHECK-NEXT:    static const char *const PressureNameTable[] = {
+// CHECK-NEXT:    static const char *PressureNameTable[] = {
 // CHECK-NEXT:      "GPR32",
 // CHECK-NEXT:    };
 // CHECK-NEXT:    return PressureNameTable[Idx];
index 2c2239f..1acc2a8 100644 (file)
@@ -3395,7 +3395,7 @@ void AsmMatcherEmitter::run(raw_ostream &OS) {
                         StringTable.GetOrAddStringOffset(LenMnemonic, false));
   }
 
-  OS << "static const char *const MnemonicTable =\n";
+  OS << "static const char MnemonicTable[] =\n";
   StringTable.EmitString(OS);
   OS << ";\n\n";
 
index 65ccb74..6c1b021 100644 (file)
@@ -474,7 +474,7 @@ GetInstByName(const char *Name,
   return I->second.get();
 }
 
-static const char *const FixedInstrs[] = {
+static const char *FixedInstrs[] = {
 #define HANDLE_TARGET_OPCODE(OPC) #OPC,
 #include "llvm/Support/TargetOpcodes.def"
     nullptr};
index 0ba6dee..3a0fa56 100644 (file)
@@ -268,7 +268,7 @@ EmitRegUnitPressure(raw_ostream &OS, const CodeGenRegBank &RegBank,
   OS << "// Get the name of this register unit pressure set.\n"
      << "const char *" << ClassName << "::\n"
      << "getRegPressureSetName(unsigned Idx) const {\n"
-     << "  static const char *const PressureNameTable[] = {\n";
+     << "  static const char *PressureNameTable[] = {\n";
   unsigned MaxRegUnitWeight = 0;
   for (unsigned i = 0; i < NumSets; ++i ) {
     const RegUnitSet &RegUnits = RegBank.getRegSetAt(i);
@@ -1264,7 +1264,7 @@ RegisterInfoEmitter::runTargetDesc(raw_ostream &OS, CodeGenTarget &Target,
   OS << "};\n";
 
   // Emit SubRegIndex names, skipping 0.
-  OS << "\nstatic const char *const SubRegIndexNameTable[] = { \"";
+  OS << "\nstatic const char *SubRegIndexNameTable[] = { \"";
 
   for (const auto &Idx : SubRegIndices) {
     OS << Idx.getName();
@@ -1681,7 +1681,7 @@ RegisterInfoEmitter::runTargetDesc(raw_ostream &OS, CodeGenTarget &Target,
   OS << "ArrayRef<const char *> " << ClassName
      << "::getRegMaskNames() const {\n";
   if (!CSRSets.empty()) {
-  OS << "  static const char *const Names[] = {\n";
+    OS << "  static const char *Names[] = {\n";
     for (Record *CSRSet : CSRSets)
       OS << "    " << '"' << CSRSet->getName() << '"' << ",\n";
     OS << "  };\n";