aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2009-12-10 00:07:02 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2009-12-10 00:07:02 +0000
commit68f7a2426227476bcfa33ada70b708c82419dfdc (patch)
treec78b4518065eee91f4f72e990703ed56b2ecf1ac
parent8755ec336108839b9621c3b18f0e175f8a3b671c (diff)
spread 'const' love to some variables. this considerably reduces the amount of dirty data around.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91002 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/AST/DeclarationName.cpp2
-rw-r--r--lib/Driver/DriverOptions.cpp2
-rw-r--r--lib/Driver/Types.cpp4
-rw-r--r--lib/Frontend/LangStandards.cpp2
-rw-r--r--lib/Parse/ParseTemplate.cpp2
5 files changed, 6 insertions, 6 deletions
diff --git a/lib/AST/DeclarationName.cpp b/lib/AST/DeclarationName.cpp
index 3471657b65..0ce03c2140 100644
--- a/lib/AST/DeclarationName.cpp
+++ b/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/lib/Driver/DriverOptions.cpp b/lib/Driver/DriverOptions.cpp
index d1af95cd45..72aaf56ad3 100644
--- a/lib/Driver/DriverOptions.cpp
+++ b/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/lib/Driver/Types.cpp b/lib/Driver/Types.cpp
index 3397677227..433af03237 100644
--- a/lib/Driver/Types.cpp
+++ b/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/lib/Frontend/LangStandards.cpp b/lib/Frontend/LangStandards.cpp
index 771a58c605..08fd9329f2 100644
--- a/lib/Frontend/LangStandards.cpp
+++ b/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/lib/Parse/ParseTemplate.cpp b/lib/Parse/ParseTemplate.cpp
index 0dbf37c830..b827a48f6a 100644
--- a/lib/Parse/ParseTemplate.cpp
+++ b/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);