Add 'const' qualifier to some arrays.
authorCraig Topper <craig.topper@gmail.com>
Mon, 15 Jul 2013 08:02:13 +0000 (08:02 +0000)
committerCraig Topper <craig.topper@gmail.com>
Mon, 15 Jul 2013 08:02:13 +0000 (08:02 +0000)
llvm-svn: 186312

llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
llvm/lib/Transforms/Utils/MetaRenamer.cpp
llvm/utils/TableGen/CodeGenTarget.cpp

index 900f1401523b586617897b531e38c7c76b16339f..f5fe168547c131e353e36fcc71eef9bd3d2a3e5d 100644 (file)
@@ -2401,7 +2401,8 @@ static bool BURRSort(SUnit *left, SUnit *right, RegReductionPQBase *SPQ) {
     bool RHasPhysReg = right->hasPhysRegDefs;
     if (LHasPhysReg != RHasPhysReg) {
       #ifndef NDEBUG
-      const char *const PhysRegMsg[] = {" has no physreg"," defines a physreg"};
+      static const char *const PhysRegMsg[] = { " has no physreg",
+                                                " defines a physreg" };
       #endif
       DEBUG(dbgs() << "  SU (" << left->NodeNum << ") "
             << PhysRegMsg[LHasPhysReg] << " SU(" << right->NodeNum << ") "
index 3716f586ff0626bc38bf41cf65dce9a36a738746..c37045312296be041a78ef37dc8f5ed666e34c05 100644 (file)
@@ -53,7 +53,7 @@ namespace {
     }
 
     bool runOnModule(Module &M) {
-      static const char *metaNames[] = {
+      static const char *const metaNames[] = {
         // See http://en.wikipedia.org/wiki/Metasyntactic_variable
         "foo", "bar", "baz", "quux", "barney", "snork", "zot", "blam", "hoge",
         "wibble", "wobble", "widget", "wombat", "ham", "eggs", "pluto", "spam"
index a85ad0978ca1d7105801914c09590ffdc9fdd84f..b2c883da0ed331e23453b195f889c6df1e61a3de 100644 (file)
@@ -298,7 +298,7 @@ struct SortInstByName {
 /// target, ordered by their enum value.
 void CodeGenTarget::ComputeInstrsByEnum() const {
   // The ordering here must match the ordering in TargetOpcodes.h.
-  const char *const FixedInstrs[] = {
+  static const char *const FixedInstrs[] = {
     "PHI",
     "INLINEASM",
     "PROLOG_LABEL",