From 5324ac0774fb74ec58a407c622f9fc2c1807e979 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sun, 8 Mar 2015 16:06:46 +0000 Subject: [PATCH] Make constant static variables const so they can go into a read-only section NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231597 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Format/Format.cpp | 11 ++++++----- lib/Format/TokenAnnotator.cpp | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp index 035dc735d9..d312e8d86e 100644 --- a/lib/Format/Format.cpp +++ b/lib/Format/Format.cpp @@ -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)) diff --git a/lib/Format/TokenAnnotator.cpp b/lib/Format/TokenAnnotator.cpp index 1688568c7b..b8f8b992ce 100644 --- a/lib/Format/TokenAnnotator.cpp +++ b/lib/Format/TokenAnnotator.cpp @@ -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. -- 2.40.0