[cfe-commits] r91002 - in /cfe/trunk/lib: AST/DeclarationName.cpp Driver/DriverOptions.cpp Driver/Types.cpp Frontend/LangStandards.cpp Parse/ParseTemplate.cpp
Nuno Lopes
nunoplopes at sapo.pt
Wed Dec 9 16:07:02 PST 2009
Author: nlopes
Date: Wed Dec 9 18:07:02 2009
New Revision: 91002
URL: http://llvm.org/viewvc/llvm-project?rev=91002&view=rev
Log:
spread 'const' love to some variables. this considerably reduces the amount of dirty data around.
Modified:
cfe/trunk/lib/AST/DeclarationName.cpp
cfe/trunk/lib/Driver/DriverOptions.cpp
cfe/trunk/lib/Driver/Types.cpp
cfe/trunk/lib/Frontend/LangStandards.cpp
cfe/trunk/lib/Parse/ParseTemplate.cpp
Modified: cfe/trunk/lib/AST/DeclarationName.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclarationName.cpp?rev=91002&r1=91001&r2=91002&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclarationName.cpp (original)
+++ cfe/trunk/lib/AST/DeclarationName.cpp Wed Dec 9 18:07:02 2009
@@ -338,7 +338,7 @@
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);
Modified: cfe/trunk/lib/Driver/DriverOptions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/DriverOptions.cpp?rev=91002&r1=91001&r2=91002&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/DriverOptions.cpp (original)
+++ cfe/trunk/lib/Driver/DriverOptions.cpp Wed Dec 9 18:07:02 2009
@@ -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, \
Modified: cfe/trunk/lib/Driver/Types.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Types.cpp?rev=91002&r1=91001&r2=91002&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Types.cpp (original)
+++ cfe/trunk/lib/Driver/Types.cpp Wed Dec 9 18:07:02 2009
@@ -23,7 +23,7 @@
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 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];
}
Modified: cfe/trunk/lib/Frontend/LangStandards.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/LangStandards.cpp?rev=91002&r1=91001&r2=91002&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/LangStandards.cpp (original)
+++ cfe/trunk/lib/Frontend/LangStandards.cpp Wed Dec 9 18:07:02 2009
@@ -14,7 +14,7 @@
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) {
Modified: cfe/trunk/lib/Parse/ParseTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseTemplate.cpp?rev=91002&r1=91001&r2=91002&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseTemplate.cpp (original)
+++ cfe/trunk/lib/Parse/ParseTemplate.cpp Wed Dec 9 18:07:02 2009
@@ -522,7 +522,7 @@
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);
More information about the cfe-commits
mailing list