зеркало из https://github.com/microsoft/clang-1.git
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
This commit is contained in:
Родитель
8755ec3361
Коммит
68f7a24262
|
@ -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);
|
||||
|
|
|
@ -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, \
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче