]> granicus.if.org Git - clang/commitdiff
Make constant static variables const so they can go into a read-only section
authorBenjamin Kramer <benny.kra@googlemail.com>
Sun, 8 Mar 2015 16:06:46 +0000 (16:06 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sun, 8 Mar 2015 16:06:46 +0000 (16:06 +0000)
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231597 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Format/Format.cpp
lib/Format/TokenAnnotator.cpp

index 035dc735d93e402c1f91e6cd3f8762739965cc9e..d312e8d86e9a06d5648e922497d4832879b26e93 100644 (file)
@@ -642,11 +642,12 @@ private:
       if (tryMergeTemplateString())
         return;
 
-      static tok::TokenKind JSIdentity[] = {tok::equalequal, tok::equal};
-      static tok::TokenKind JSNotIdentity[] = {tok::exclaimequal, tok::equal};
-      static tok::TokenKind JSShiftEqual[] = {tok::greater, tok::greater,
-                                              tok::greaterequal};
-      static tok::TokenKind JSRightArrow[] = {tok::equal, tok::greater};
+      static const tok::TokenKind JSIdentity[] = {tok::equalequal, tok::equal};
+      static const tok::TokenKind JSNotIdentity[] = {tok::exclaimequal,
+                                                     tok::equal};
+      static const tok::TokenKind JSShiftEqual[] = {tok::greater, tok::greater,
+                                                    tok::greaterequal};
+      static const tok::TokenKind JSRightArrow[] = {tok::equal, tok::greater};
       // FIXME: We probably need to change token type to mimic operator with the
       // correct priority.
       if (tryMergeTokens(JSIdentity))
index 1688568c7b1df43ff96c5ef366425ab7f40777f5..b8f8b992ce7ed5253b2df8f03221dbf66f8cfa93 100644 (file)
@@ -1119,8 +1119,8 @@ private:
   const AdditionalKeywords &Keywords;
 };
 
-static int PrecedenceUnaryOperator = prec::PointerToMember + 1;
-static int PrecedenceArrowAndPeriod = prec::PointerToMember + 2;
+static const int PrecedenceUnaryOperator = prec::PointerToMember + 1;
+static const int PrecedenceArrowAndPeriod = prec::PointerToMember + 2;
 
 /// \brief Parses binary expressions by inserting fake parenthesis based on
 /// operator precedence.