diff options
| author | David Blaikie <dblaikie@gmail.com> | 2012-03-11 07:00:24 +0000 |
|---|---|---|
| committer | David Blaikie <dblaikie@gmail.com> | 2012-03-11 07:00:24 +0000 |
| commit | bbafb8a745736afb1b4b0c9bf4da896c5587f7c7 (patch) | |
| tree | cb3738dc9bf49bcce799880f76902899ce268da2 /clang/lib/Lex/PPDirectives.cpp | |
| parent | 41bd30e027fa95144963bda5aa00217f3e02ed08 (diff) | |
| download | bcm5719-llvm-bbafb8a745736afb1b4b0c9bf4da896c5587f7c7.tar.gz bcm5719-llvm-bbafb8a745736afb1b4b0c9bf4da896c5587f7c7.zip | |
Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST).
The member variable is always "LangOpts" and the member function is always "getLangOpts".
Reviewed by Chris Lattner
llvm-svn: 152536
Diffstat (limited to 'clang/lib/Lex/PPDirectives.cpp')
| -rw-r--r-- | clang/lib/Lex/PPDirectives.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp index 7345ef21973..53bb5c354e9 100644 --- a/clang/lib/Lex/PPDirectives.cpp +++ b/clang/lib/Lex/PPDirectives.cpp @@ -124,7 +124,7 @@ void Preprocessor::ReadMacroName(Token &MacroNameTok, char isDefineUndef) { const IdentifierInfo &Info = Identifiers.get(Spelling); // Allow #defining |and| and friends in microsoft mode. - if (Info.isCPlusPlusOperatorKeyword() && getLangOptions().MicrosoftMode) { + if (Info.isCPlusPlusOperatorKeyword() && getLangOpts().MicrosoftMode) { MacroNameTok.setIdentifierInfo(getIdentifierInfo(Spelling)); return; } @@ -181,7 +181,7 @@ void Preprocessor::CheckEndOfDirective(const char *DirType, bool EnableMacros) { // trouble than it is worth to insert /**/ and check that there is no /**/ // in the range also. FixItHint Hint; - if ((Features.GNUMode || Features.C99 || Features.CPlusPlus) && + if ((LangOpts.GNUMode || LangOpts.C99 || LangOpts.CPlusPlus) && !CurTokenLexer) Hint = FixItHint::CreateInsertion(Tmp.getLocation(),"//"); Diag(Tmp, diag::ext_pp_extra_tokens_at_eol) << DirType << Hint; @@ -619,7 +619,7 @@ TryAgain: setCodeCompletionReached(); return; case tok::numeric_constant: // # 7 GNU line marker directive. - if (getLangOptions().AsmPreprocessor) + if (getLangOpts().AsmPreprocessor) break; // # 4 is not a preprocessor directive in .S files. return HandleDigitDirective(Result); default: @@ -690,12 +690,12 @@ TryAgain: break; case tok::pp___public_macro: - if (getLangOptions().Modules) + if (getLangOpts().Modules) return HandleMacroPublicDirective(Result); break; case tok::pp___private_macro: - if (getLangOptions().Modules) + if (getLangOpts().Modules) return HandleMacroPrivateDirective(Result); break; } @@ -706,7 +706,7 @@ TryAgain: // directives. This is important because # may be a comment or introduce // various pseudo-ops. Just return the # token and push back the following // token to be lexed next time. - if (getLangOptions().AsmPreprocessor) { + if (getLangOpts().AsmPreprocessor) { Token *Toks = new Token[2]; // Return the # and the token after it. Toks[0] = SavedHash; @@ -805,11 +805,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 (Features.C99 || Features.CPlusPlus0x) + if (LangOpts.C99 || LangOpts.CPlusPlus0x) LineLimit = 2147483648U; if (LineNo >= LineLimit) Diag(DigitTok, diag::ext_pp_line_too_big) << LineLimit; - else if (Features.CPlusPlus0x && LineNo >= 32768U) + else if (LangOpts.CPlusPlus0x && LineNo >= 32768U) Diag(DigitTok, diag::warn_cxx98_compat_pp_line_too_big); int FilenameID = -1; @@ -1334,7 +1334,7 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc, const FileEntry *File = LookupFile( Filename, isAngled, LookupFrom, CurDir, Callbacks ? &SearchPath : NULL, Callbacks ? &RelativePath : NULL, - getLangOptions().Modules? &SuggestedModule : 0); + getLangOpts().Modules? &SuggestedModule : 0); if (Callbacks) { if (!File) { @@ -1348,7 +1348,7 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc, // Try the lookup again, skipping the cache. File = LookupFile(Filename, isAngled, LookupFrom, CurDir, 0, 0, - getLangOptions().Modules? &SuggestedModule : 0, + getLangOpts().Modules? &SuggestedModule : 0, /*SkipCache*/true); } } @@ -1410,9 +1410,9 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc, // Determine whether we are actually building the module that this // include directive maps to. bool BuildingImportedModule - = Path[0].first->getName() == getLangOptions().CurrentModule; + = Path[0].first->getName() == getLangOpts().CurrentModule; - if (!BuildingImportedModule && getLangOptions().ObjC2) { + if (!BuildingImportedModule && getLangOpts().ObjC2) { // If we're not building the imported module, warn that we're going // to automatically turn this inclusion directive into a module import. // We only do this in Objective-C, where we have a module-import syntax. @@ -1488,7 +1488,7 @@ void Preprocessor::HandleIncludeNextDirective(SourceLocation HashLoc, /// void Preprocessor::HandleImportDirective(SourceLocation HashLoc, Token &ImportTok) { - if (!Features.ObjC1) // #import is standard for ObjC. + if (!LangOpts.ObjC1) // #import is standard for ObjC. Diag(ImportTok, diag::ext_pp_import_directive); return HandleIncludeDirective(HashLoc, ImportTok, 0, true); @@ -1544,8 +1544,8 @@ bool Preprocessor::ReadMacroDefinitionArgList(MacroInfo *MI) { Diag(Tok, diag::err_pp_expected_ident_in_arg_list); return true; case tok::ellipsis: // #define X(... -> C99 varargs - if (!Features.C99) - Diag(Tok, Features.CPlusPlus0x ? + if (!LangOpts.C99) + Diag(Tok, LangOpts.CPlusPlus0x ? diag::warn_cxx98_compat_variadic_macro : diag::ext_variadic_macro); @@ -1671,7 +1671,7 @@ void Preprocessor::HandleDefineDirective(Token &DefineTok) { // Read the first token after the arg list for down below. LexUnexpandedToken(Tok); - } else if (Features.C99 || Features.CPlusPlus0x) { + } else if (LangOpts.C99 || LangOpts.CPlusPlus0x) { // 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); @@ -1736,7 +1736,7 @@ void Preprocessor::HandleDefineDirective(Token &DefineTok) { // the '#' because '#' is often a comment character. However, change // the kind of the token to tok::unknown so that the preprocessor isn't // confused. - if (getLangOptions().AsmPreprocessor && Tok.isNot(tok::eod)) { + if (getLangOpts().AsmPreprocessor && Tok.isNot(tok::eod)) { LastTok.setKind(tok::unknown); } else { Diag(Tok, diag::err_pp_stringize_not_parameter); |

