diff options
| author | Nuno Lopes <nunoplopes@sapo.pt> | 2009-12-10 00:07:02 +0000 | 
|---|---|---|
| committer | Nuno Lopes <nunoplopes@sapo.pt> | 2009-12-10 00:07:02 +0000 | 
| commit | 221c1fd63e970da4187bb258f1ca51ecf42e38cd (patch) | |
| tree | ae4f3ea4aa1eb9d768d4161b0c441b65ffd5755d /clang | |
| parent | 75546b8c88aeac5563c10dcf01299a7258b59eee (diff) | |
| download | bcm5719-llvm-221c1fd63e970da4187bb258f1ca51ecf42e38cd.tar.gz bcm5719-llvm-221c1fd63e970da4187bb258f1ca51ecf42e38cd.zip  | |
spread 'const' love to some variables. this considerably reduces the amount of dirty data around.
llvm-svn: 91002
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/AST/DeclarationName.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/Driver/DriverOptions.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/Driver/Types.cpp | 4 | ||||
| -rw-r--r-- | clang/lib/Frontend/LangStandards.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/Parse/ParseTemplate.cpp | 2 | 
5 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/AST/DeclarationName.cpp b/clang/lib/AST/DeclarationName.cpp index 3471657b652..0ce03c21405 100644 --- a/clang/lib/AST/DeclarationName.cpp +++ b/clang/lib/AST/DeclarationName.cpp @@ -338,7 +338,7 @@ void DeclarationName::setFETokenInfo(void *T) {  DeclarationName DeclarationName::getUsingDirectiveName() {    // Single instance of DeclarationNameExtra for using-directive -  static DeclarationNameExtra UDirExtra = +  static const DeclarationNameExtra UDirExtra =      { DeclarationNameExtra::CXXUsingDirective };    uintptr_t Ptr = reinterpret_cast<uintptr_t>(&UDirExtra); diff --git a/clang/lib/Driver/DriverOptions.cpp b/clang/lib/Driver/DriverOptions.cpp index d1af95cd450..72aaf56ad3e 100644 --- a/clang/lib/Driver/DriverOptions.cpp +++ b/clang/lib/Driver/DriverOptions.cpp @@ -14,7 +14,7 @@  using namespace clang::driver;  using namespace clang::driver::options; -static OptTable::Info InfoTable[] = { +static const OptTable::Info InfoTable[] = {  #define OPTION(NAME, ID, KIND, GROUP, ALIAS, FLAGS, PARAM, \                 HELPTEXT, METAVAR)   \    { NAME, HELPTEXT, METAVAR, Option::KIND##Class, FLAGS, PARAM, \ diff --git a/clang/lib/Driver/Types.cpp b/clang/lib/Driver/Types.cpp index 33976772271..433af03237c 100644 --- a/clang/lib/Driver/Types.cpp +++ b/clang/lib/Driver/Types.cpp @@ -23,7 +23,7 @@ struct TypeInfo {    ID PreprocessedType;  }; -static TypeInfo TypeInfos[] = { +static const TypeInfo TypeInfos[] = {  #define TYPE(NAME, ID, PP_TYPE, TEMP_SUFFIX, FLAGS) \    { NAME, FLAGS, TEMP_SUFFIX, TY_##PP_TYPE, },  #include "clang/Driver/Types.def" @@ -31,7 +31,7 @@ static TypeInfo TypeInfos[] = {  };  static const unsigned numTypes = sizeof(TypeInfos) / sizeof(TypeInfos[0]); -static TypeInfo &getInfo(unsigned id) { +static const TypeInfo &getInfo(unsigned id) {    assert(id > 0 && id - 1 < numTypes && "Invalid Type ID.");    return TypeInfos[id - 1];  } diff --git a/clang/lib/Frontend/LangStandards.cpp b/clang/lib/Frontend/LangStandards.cpp index 771a58c6050..08fd9329f27 100644 --- a/clang/lib/Frontend/LangStandards.cpp +++ b/clang/lib/Frontend/LangStandards.cpp @@ -14,7 +14,7 @@ using namespace clang;  using namespace clang::frontend;  #define LANGSTANDARD(id, name, desc, features) \ -  static LangStandard Lang_##id = { name, desc, features }; +  static const LangStandard Lang_##id = { name, desc, features };  #include "clang/Frontend/LangStandards.def"  const LangStandard &LangStandard::getLangStandardForKind(Kind K) { diff --git a/clang/lib/Parse/ParseTemplate.cpp b/clang/lib/Parse/ParseTemplate.cpp index 0dbf37c830f..b827a48f6a4 100644 --- a/clang/lib/Parse/ParseTemplate.cpp +++ b/clang/lib/Parse/ParseTemplate.cpp @@ -522,7 +522,7 @@ Parser::ParseTemplateTemplateParameter(unsigned Depth, unsigned Position) {      if (Default.isInvalid()) {        Diag(Tok.getLocation(),              diag::err_default_template_template_parameter_not_template); -      static tok::TokenKind EndToks[] = {  +      static const tok::TokenKind EndToks[] = {           tok::comma, tok::greater, tok::greatergreater        };        SkipUntil(EndToks, 3, true, true);  | 

