aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2011-04-15 00:35:23 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2011-04-15 00:35:23 +0000
commit7e7fbd05a5dfdb0addfc8b5af2fcbed8c7b5fb87 (patch)
treefbae3477a58af24bdc57f7957ddbe0b63752b0ea /lib
parentb38b6a77ab946ed331f06f6028963d781bac7431 (diff)
C1X: add a language standard
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129553 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Basic/IdentifierTable.cpp4
-rw-r--r--lib/Frontend/CompilerInvocation.cpp1
-rw-r--r--lib/Serialization/ASTReader.cpp2
-rw-r--r--lib/Serialization/ASTWriter.cpp1
4 files changed, 7 insertions, 1 deletions
diff --git a/lib/Basic/IdentifierTable.cpp b/lib/Basic/IdentifierTable.cpp
index 3d08bf807e..bbea23ab8d 100644
--- a/lib/Basic/IdentifierTable.cpp
+++ b/lib/Basic/IdentifierTable.cpp
@@ -91,7 +91,8 @@ namespace {
KEYNOCXX = 0x80,
KEYBORLAND = 0x100,
KEYOPENCL = 0x200,
- KEYALL = 0x3ff
+ KEYC1X = 0x400,
+ KEYALL = 0x7ff
};
}
@@ -118,6 +119,7 @@ static void AddKeyword(llvm::StringRef Keyword,
else if (LangOpts.AltiVec && (Flags & KEYALTIVEC)) AddResult = 2;
else if (LangOpts.OpenCL && (Flags & KEYOPENCL)) AddResult = 2;
else if (!LangOpts.CPlusPlus && (Flags & KEYNOCXX)) AddResult = 2;
+ else if (LangOpts.C1X && (Flags & KEYC1X)) AddResult = 2;
// Don't add this keyword if disabled in this language.
if (AddResult == 0) return;
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp
index 00418967fe..3dd1be93de 100644
--- a/lib/Frontend/CompilerInvocation.cpp
+++ b/lib/Frontend/CompilerInvocation.cpp
@@ -1335,6 +1335,7 @@ void CompilerInvocation::setLangDefaults(LangOptions &Opts, InputKind IK,
const LangStandard &Std = LangStandard::getLangStandardForKind(LangStd);
Opts.BCPLComment = Std.hasBCPLComments();
Opts.C99 = Std.isC99();
+ Opts.C1X = Std.isC1X();
Opts.CPlusPlus = Std.isCPlusPlus();
Opts.CPlusPlus0x = Std.isCPlusPlus0x();
Opts.Digraphs = Std.hasDigraphs();
diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp
index a7c3fea7d6..66b4890d2a 100644
--- a/lib/Serialization/ASTReader.cpp
+++ b/lib/Serialization/ASTReader.cpp
@@ -79,6 +79,7 @@ PCHValidator::ReadLanguageOptions(const LangOptions &LangOpts) {
PARSE_LANGOPT_BENIGN(Digraphs);
PARSE_LANGOPT_BENIGN(HexFloats);
PARSE_LANGOPT_IMPORTANT(C99, diag::warn_pch_c99);
+ PARSE_LANGOPT_IMPORTANT(C1X, diag::warn_pch_c1x);
PARSE_LANGOPT_IMPORTANT(Microsoft, diag::warn_pch_microsoft_extensions);
PARSE_LANGOPT_BENIGN(MSCVersion);
PARSE_LANGOPT_IMPORTANT(CPlusPlus, diag::warn_pch_cplusplus);
@@ -2799,6 +2800,7 @@ bool ASTReader::ParseLanguageOptions(
PARSE_LANGOPT(Digraphs);
PARSE_LANGOPT(HexFloats);
PARSE_LANGOPT(C99);
+ PARSE_LANGOPT(C1X);
PARSE_LANGOPT(Microsoft);
PARSE_LANGOPT(CPlusPlus);
PARSE_LANGOPT(CPlusPlus0x);
diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp
index 85b5326da9..d6a9a95ea4 100644
--- a/lib/Serialization/ASTWriter.cpp
+++ b/lib/Serialization/ASTWriter.cpp
@@ -1007,6 +1007,7 @@ void ASTWriter::WriteLanguageOptions(const LangOptions &LangOpts) {
Record.push_back(LangOpts.Digraphs); // C94, C99 and C++
Record.push_back(LangOpts.HexFloats); // C99 Hexadecimal float constants.
Record.push_back(LangOpts.C99); // C99 Support
+ Record.push_back(LangOpts.C1X); // C1X Support
Record.push_back(LangOpts.Microsoft); // Microsoft extensions.
// LangOpts.MSCVersion is ignored because all it does it set a macro, which is
// already saved elsewhere.