diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-01-02 11:42:31 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-01-02 11:42:31 +0000 |
commit | 80ad52f327b532bded5c5b0ee38779d841c6cd35 (patch) | |
tree | 7432bb450d11702b6816ebb0342fa513af6822f8 /lib/Lex | |
parent | b99083e60325a28063fb588f458a871151971fdc (diff) |
s/CPlusPlus0x/CPlusPlus11/g
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171367 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex')
-rw-r--r-- | lib/Lex/Lexer.cpp | 14 | ||||
-rw-r--r-- | lib/Lex/LiteralSupport.cpp | 4 | ||||
-rw-r--r-- | lib/Lex/PPDirectives.cpp | 8 | ||||
-rw-r--r-- | lib/Lex/PPExpressions.cpp | 2 | ||||
-rw-r--r-- | lib/Lex/PPMacroExpansion.cpp | 70 | ||||
-rw-r--r-- | lib/Lex/TokenConcatenation.cpp | 20 |
6 files changed, 59 insertions, 59 deletions
diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp index ab3004917b..1bcff98cf4 100644 --- a/lib/Lex/Lexer.cpp +++ b/lib/Lex/Lexer.cpp @@ -1630,7 +1630,7 @@ const char *Lexer::LexUDSuffix(Token &Result, const char *CurPtr) { unsigned Size; char C = getCharAndSize(CurPtr, Size); if (isIdentifierHead(C)) { - if (!getLangOpts().CPlusPlus0x) { + if (!getLangOpts().CPlusPlus11) { if (!isLexingRawMode()) Diag(CurPtr, C == '_' ? diag::warn_cxx11_compat_user_defined_literal @@ -2425,7 +2425,7 @@ bool Lexer::LexEndOfFile(Token &Result, const char *CurPtr) { // C99 5.1.1.2p2: If the file is non-empty and didn't end in a newline, issue // a pedwarn. if (CurPtr != BufferStart && (CurPtr[-1] != '\n' && CurPtr[-1] != '\r')) - Diag(BufferEnd, LangOpts.CPlusPlus0x ? // C++11 [lex.phases] 2.2 p2 + Diag(BufferEnd, LangOpts.CPlusPlus11 ? // C++11 [lex.phases] 2.2 p2 diag::warn_cxx98_compat_no_newline_eof : diag::ext_no_newline_eof) << FixItHint::CreateInsertion(getSourceLocation(BufferEnd), "\n"); @@ -2731,7 +2731,7 @@ LexNextToken: // Notify MIOpt that we read a non-whitespace/non-comment token. MIOpt.ReadToken(); - if (LangOpts.CPlusPlus0x) { + if (LangOpts.CPlusPlus11) { Char = getCharAndSize(CurPtr, SizeTmp); // UTF-16 string literal @@ -2783,7 +2783,7 @@ LexNextToken: // Notify MIOpt that we read a non-whitespace/non-comment token. MIOpt.ReadToken(); - if (LangOpts.CPlusPlus0x) { + if (LangOpts.CPlusPlus11) { Char = getCharAndSize(CurPtr, SizeTmp); // UTF-32 string literal @@ -2811,7 +2811,7 @@ LexNextToken: // Notify MIOpt that we read a non-whitespace/non-comment token. MIOpt.ReadToken(); - if (LangOpts.CPlusPlus0x) { + if (LangOpts.CPlusPlus11) { Char = getCharAndSize(CurPtr, SizeTmp); if (Char == '"') @@ -2834,7 +2834,7 @@ LexNextToken: tok::wide_string_literal); // Wide raw string literal. - if (LangOpts.CPlusPlus0x && Char == 'R' && + if (LangOpts.CPlusPlus11 && Char == 'R' && getCharAndSize(CurPtr + SizeTmp, SizeTmp2) == '"') return LexRawStringLiteral(Result, ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result), @@ -3091,7 +3091,7 @@ LexNextToken: CurPtr = ConsumeChar(CurPtr, SizeTmp, Result); Kind = tok::lessequal; } else if (LangOpts.Digraphs && Char == ':') { // '<:' -> '[' - if (LangOpts.CPlusPlus0x && + if (LangOpts.CPlusPlus11 && getCharAndSize(CurPtr + SizeTmp, SizeTmp2) == ':') { // C++0x [lex.pptoken]p3: // Otherwise, if the next three characters are <:: and the subsequent diff --git a/lib/Lex/LiteralSupport.cpp b/lib/Lex/LiteralSupport.cpp index aef2e975fe..f77f80cc9e 100644 --- a/lib/Lex/LiteralSupport.cpp +++ b/lib/Lex/LiteralSupport.cpp @@ -267,7 +267,7 @@ static bool ProcessUCNEscape(const char *ThisTokBegin, const char *&ThisTokBuf, // characters inside character and string literals if (UcnVal < 0xa0 && (UcnVal != 0x24 && UcnVal != 0x40 && UcnVal != 0x60)) { // $, @, ` - bool IsError = (!Features.CPlusPlus0x || !in_char_string_literal); + bool IsError = (!Features.CPlusPlus11 || !in_char_string_literal); if (Diags) { char BasicSCSChar = UcnVal; if (UcnVal >= 0x20 && UcnVal < 0x7f) @@ -616,7 +616,7 @@ NumericLiteralParser::NumericLiteralParser(StringRef TokSpelling, } if (s != ThisTokEnd) { - if (PP.getLangOpts().CPlusPlus0x && s == SuffixBegin && *s == '_') { + if (PP.getLangOpts().CPlusPlus11 && s == SuffixBegin && *s == '_') { // We have a ud-suffix! By C++11 [lex.ext]p10, ud-suffixes not starting // with an '_' are ill-formed. saw_ud_suffix = true; diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp index 5f95260ea8..edf91a9d56 100644 --- a/lib/Lex/PPDirectives.cpp +++ b/lib/Lex/PPDirectives.cpp @@ -834,11 +834,11 @@ void Preprocessor::HandleLineDirective(Token &Tok) { // Enforce C99 6.10.4p3: "The digit sequence shall not specify ... a // number greater than 2147483647". C90 requires that the line # be <= 32767. unsigned LineLimit = 32768U; - if (LangOpts.C99 || LangOpts.CPlusPlus0x) + if (LangOpts.C99 || LangOpts.CPlusPlus11) LineLimit = 2147483648U; if (LineNo >= LineLimit) Diag(DigitTok, diag::ext_pp_line_too_big) << LineLimit; - else if (LangOpts.CPlusPlus0x && LineNo >= 32768U) + else if (LangOpts.CPlusPlus11 && LineNo >= 32768U) Diag(DigitTok, diag::warn_cxx98_compat_pp_line_too_big); int FilenameID = -1; @@ -1644,7 +1644,7 @@ bool Preprocessor::ReadMacroDefinitionArgList(MacroInfo *MI, Token &Tok) { return true; case tok::ellipsis: // #define X(... -> C99 varargs if (!LangOpts.C99) - Diag(Tok, LangOpts.CPlusPlus0x ? + Diag(Tok, LangOpts.CPlusPlus11 ? diag::warn_cxx98_compat_variadic_macro : diag::ext_variadic_macro); @@ -1770,7 +1770,7 @@ void Preprocessor::HandleDefineDirective(Token &DefineTok) { // Read the first token after the arg list for down below. LexUnexpandedToken(Tok); - } else if (LangOpts.C99 || LangOpts.CPlusPlus0x) { + } else if (LangOpts.C99 || LangOpts.CPlusPlus11) { // C99 requires whitespace between the macro definition and the body. Emit // a diagnostic for something like "#define X+". Diag(Tok, diag::ext_c99_whitespace_required_after_macro_name); diff --git a/lib/Lex/PPExpressions.cpp b/lib/Lex/PPExpressions.cpp index 9b33c91bcb..c564653e8f 100644 --- a/lib/Lex/PPExpressions.cpp +++ b/lib/Lex/PPExpressions.cpp @@ -230,7 +230,7 @@ static bool EvaluateValue(PPValue &Result, Token &PeekTok, DefinedTracker &DT, if (!PP.getLangOpts().C99 && Literal.isLongLong) { if (PP.getLangOpts().CPlusPlus) PP.Diag(PeekTok, - PP.getLangOpts().CPlusPlus0x ? + PP.getLangOpts().CPlusPlus11 ? diag::warn_cxx98_compat_longlong : diag::ext_cxx11_longlong); else PP.Diag(PeekTok, diag::ext_c99_longlong); diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp index 8ba8318fe9..49ba601b45 100644 --- a/lib/Lex/PPMacroExpansion.cpp +++ b/lib/Lex/PPMacroExpansion.cpp @@ -600,7 +600,7 @@ MacroArgs *Preprocessor::ReadFunctionLikeMacroArgs(Token &MacroName, // Empty arguments are standard in C99 and C++0x, and are supported as an extension in // other modes. if (ArgTokens.size() == ArgTokenStart && !LangOpts.C99) - Diag(Tok, LangOpts.CPlusPlus0x ? + Diag(Tok, LangOpts.CPlusPlus11 ? diag::warn_cxx98_compat_empty_fnmacro_arg : diag::ext_empty_fnmacro_arg); @@ -834,41 +834,41 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) { .Case("c_generic_selections", LangOpts.C11) .Case("c_static_assert", LangOpts.C11) // C++11 features - .Case("cxx_access_control_sfinae", LangOpts.CPlusPlus0x) - .Case("cxx_alias_templates", LangOpts.CPlusPlus0x) - .Case("cxx_alignas", LangOpts.CPlusPlus0x) - .Case("cxx_atomic", LangOpts.CPlusPlus0x) - .Case("cxx_attributes", LangOpts.CPlusPlus0x) - .Case("cxx_auto_type", LangOpts.CPlusPlus0x) - .Case("cxx_constexpr", LangOpts.CPlusPlus0x) - .Case("cxx_decltype", LangOpts.CPlusPlus0x) - .Case("cxx_decltype_incomplete_return_types", LangOpts.CPlusPlus0x) - .Case("cxx_default_function_template_args", LangOpts.CPlusPlus0x) - .Case("cxx_defaulted_functions", LangOpts.CPlusPlus0x) - .Case("cxx_delegating_constructors", LangOpts.CPlusPlus0x) - .Case("cxx_deleted_functions", LangOpts.CPlusPlus0x) - .Case("cxx_explicit_conversions", LangOpts.CPlusPlus0x) - .Case("cxx_generalized_initializers", LangOpts.CPlusPlus0x) - .Case("cxx_implicit_moves", LangOpts.CPlusPlus0x) + .Case("cxx_access_control_sfinae", LangOpts.CPlusPlus11) + .Case("cxx_alias_templates", LangOpts.CPlusPlus11) + .Case("cxx_alignas", LangOpts.CPlusPlus11) + .Case("cxx_atomic", LangOpts.CPlusPlus11) + .Case("cxx_attributes", LangOpts.CPlusPlus11) + .Case("cxx_auto_type", LangOpts.CPlusPlus11) + .Case("cxx_constexpr", LangOpts.CPlusPlus11) + .Case("cxx_decltype", LangOpts.CPlusPlus11) + .Case("cxx_decltype_incomplete_return_types", LangOpts.CPlusPlus11) + .Case("cxx_default_function_template_args", LangOpts.CPlusPlus11) + .Case("cxx_defaulted_functions", LangOpts.CPlusPlus11) + .Case("cxx_delegating_constructors", LangOpts.CPlusPlus11) + .Case("cxx_deleted_functions", LangOpts.CPlusPlus11) + .Case("cxx_explicit_conversions", LangOpts.CPlusPlus11) + .Case("cxx_generalized_initializers", LangOpts.CPlusPlus11) + .Case("cxx_implicit_moves", LangOpts.CPlusPlus11) //.Case("cxx_inheriting_constructors", false) - .Case("cxx_inline_namespaces", LangOpts.CPlusPlus0x) - .Case("cxx_lambdas", LangOpts.CPlusPlus0x) - .Case("cxx_local_type_template_args", LangOpts.CPlusPlus0x) - .Case("cxx_nonstatic_member_init", LangOpts.CPlusPlus0x) - .Case("cxx_noexcept", LangOpts.CPlusPlus0x) - .Case("cxx_nullptr", LangOpts.CPlusPlus0x) - .Case("cxx_override_control", LangOpts.CPlusPlus0x) - .Case("cxx_range_for", LangOpts.CPlusPlus0x) - .Case("cxx_raw_string_literals", LangOpts.CPlusPlus0x) - .Case("cxx_reference_qualified_functions", LangOpts.CPlusPlus0x) - .Case("cxx_rvalue_references", LangOpts.CPlusPlus0x) - .Case("cxx_strong_enums", LangOpts.CPlusPlus0x) - .Case("cxx_static_assert", LangOpts.CPlusPlus0x) - .Case("cxx_trailing_return", LangOpts.CPlusPlus0x) - .Case("cxx_unicode_literals", LangOpts.CPlusPlus0x) - .Case("cxx_unrestricted_unions", LangOpts.CPlusPlus0x) - .Case("cxx_user_literals", LangOpts.CPlusPlus0x) - .Case("cxx_variadic_templates", LangOpts.CPlusPlus0x) + .Case("cxx_inline_namespaces", LangOpts.CPlusPlus11) + .Case("cxx_lambdas", LangOpts.CPlusPlus11) + .Case("cxx_local_type_template_args", LangOpts.CPlusPlus11) + .Case("cxx_nonstatic_member_init", LangOpts.CPlusPlus11) + .Case("cxx_noexcept", LangOpts.CPlusPlus11) + .Case("cxx_nullptr", LangOpts.CPlusPlus11) + .Case("cxx_override_control", LangOpts.CPlusPlus11) + .Case("cxx_range_for", LangOpts.CPlusPlus11) + .Case("cxx_raw_string_literals", LangOpts.CPlusPlus11) + .Case("cxx_reference_qualified_functions", LangOpts.CPlusPlus11) + .Case("cxx_rvalue_references", LangOpts.CPlusPlus11) + .Case("cxx_strong_enums", LangOpts.CPlusPlus11) + .Case("cxx_static_assert", LangOpts.CPlusPlus11) + .Case("cxx_trailing_return", LangOpts.CPlusPlus11) + .Case("cxx_unicode_literals", LangOpts.CPlusPlus11) + .Case("cxx_unrestricted_unions", LangOpts.CPlusPlus11) + .Case("cxx_user_literals", LangOpts.CPlusPlus11) + .Case("cxx_variadic_templates", LangOpts.CPlusPlus11) // Type traits .Case("has_nothrow_assign", LangOpts.CPlusPlus) .Case("has_nothrow_copy", LangOpts.CPlusPlus) diff --git a/lib/Lex/TokenConcatenation.cpp b/lib/Lex/TokenConcatenation.cpp index dd7ebb0ce3..f7b594594f 100644 --- a/lib/Lex/TokenConcatenation.cpp +++ b/lib/Lex/TokenConcatenation.cpp @@ -20,17 +20,17 @@ using namespace clang; /// IsStringPrefix - Return true if Str is a string prefix. /// 'L', 'u', 'U', or 'u8'. Including raw versions. -static bool IsStringPrefix(StringRef Str, bool CPlusPlus0x) { +static bool IsStringPrefix(StringRef Str, bool CPlusPlus11) { if (Str[0] == 'L' || - (CPlusPlus0x && (Str[0] == 'u' || Str[0] == 'U' || Str[0] == 'R'))) { + (CPlusPlus11 && (Str[0] == 'u' || Str[0] == 'U' || Str[0] == 'R'))) { if (Str.size() == 1) return true; // "L", "u", "U", and "R" // Check for raw flavors. Need to make sure the first character wasn't - // already R. Need CPlusPlus0x check for "LR". - if (Str[1] == 'R' && Str[0] != 'R' && Str.size() == 2 && CPlusPlus0x) + // already R. Need CPlusPlus11 check for "LR". + if (Str[1] == 'R' && Str[0] != 'R' && Str.size() == 2 && CPlusPlus11) return true; // "LR", "uR", "UR" // Check for "u8" and "u8R" @@ -54,17 +54,17 @@ bool TokenConcatenation::IsIdentifierStringPrefix(const Token &Tok) const { SourceManager &SM = PP.getSourceManager(); const char *Ptr = SM.getCharacterData(SM.getSpellingLoc(Tok.getLocation())); return IsStringPrefix(StringRef(Ptr, Tok.getLength()), - LangOpts.CPlusPlus0x); + LangOpts.CPlusPlus11); } if (Tok.getLength() < 256) { char Buffer[256]; const char *TokPtr = Buffer; unsigned length = PP.getSpelling(Tok, TokPtr); - return IsStringPrefix(StringRef(TokPtr, length), LangOpts.CPlusPlus0x); + return IsStringPrefix(StringRef(TokPtr, length), LangOpts.CPlusPlus11); } - return IsStringPrefix(StringRef(PP.getSpelling(Tok)), LangOpts.CPlusPlus0x); + return IsStringPrefix(StringRef(PP.getSpelling(Tok)), LangOpts.CPlusPlus11); } TokenConcatenation::TokenConcatenation(Preprocessor &pp) : PP(pp) { @@ -87,7 +87,7 @@ TokenConcatenation::TokenConcatenation(Preprocessor &pp) : PP(pp) { TokenInfo[tok::arrow ] |= aci_custom_firstchar; // These tokens have custom code in C++11 mode. - if (PP.getLangOpts().CPlusPlus0x) { + if (PP.getLangOpts().CPlusPlus11) { TokenInfo[tok::string_literal ] |= aci_custom; TokenInfo[tok::wide_string_literal ] |= aci_custom; TokenInfo[tok::utf8_string_literal ] |= aci_custom; @@ -206,7 +206,7 @@ bool TokenConcatenation::AvoidConcat(const Token &PrevPrevTok, case tok::wide_char_constant: case tok::utf16_char_constant: case tok::utf32_char_constant: - if (!PP.getLangOpts().CPlusPlus0x) + if (!PP.getLangOpts().CPlusPlus11) return false; // In C++11, a string or character literal followed by an identifier is a @@ -241,7 +241,7 @@ bool TokenConcatenation::AvoidConcat(const Token &PrevPrevTok, case tok::numeric_constant: return isalnum(FirstChar) || Tok.is(tok::numeric_constant) || FirstChar == '+' || FirstChar == '-' || FirstChar == '.' || - (PP.getLangOpts().CPlusPlus0x && FirstChar == '_'); + (PP.getLangOpts().CPlusPlus11 && FirstChar == '_'); case tok::period: // ..., .*, .1234 return (FirstChar == '.' && PrevPrevTok.is(tok::period)) || isdigit(FirstChar) || |