From e1dcbc21bc41e383255561184def6905f797a4f8 Mon Sep 17 00:00:00 2001 From: Erik Pilkington Date: Tue, 30 Oct 2018 20:31:30 +0000 Subject: NFC: Remove the ObjC1/ObjC2 distinction from clang (and related projects) We haven't supported compiling ObjC1 for a long time (and never will again), so there isn't any reason to keep these separate. This patch replaces LangOpts::ObjC1 and LangOpts::ObjC2 with LangOpts::ObjC. Differential revision: https://reviews.llvm.org/D53547 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345637 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Lex/Lexer.cpp | 2 +- lib/Lex/PPDirectives.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/Lex') diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp index 35ba8c11ec..a929da4e23 100644 --- a/lib/Lex/Lexer.cpp +++ b/lib/Lex/Lexer.cpp @@ -3844,7 +3844,7 @@ LexNextToken: case '@': // Objective C support. - if (CurPtr[-1] == '@' && LangOpts.ObjC1) + if (CurPtr[-1] == '@' && LangOpts.ObjC) Kind = tok::at; else Kind = tok::unknown; diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp index af922c0698..e47735e627 100644 --- a/lib/Lex/PPDirectives.cpp +++ b/lib/Lex/PPDirectives.cpp @@ -690,7 +690,7 @@ Preprocessor::getModuleHeaderToIncludeForDiagnostics(SourceLocation IncLoc, // If we have a module import syntax, we shouldn't include a header to // make a particular module visible. - if (getLangOpts().ObjC2) + if (getLangOpts().ObjC) return nullptr; Module *TopM = M->getTopLevelModule(); @@ -1629,7 +1629,7 @@ static void diagnoseAutoModuleImport( Preprocessor &PP, SourceLocation HashLoc, Token &IncludeTok, ArrayRef> Path, SourceLocation PathEnd) { - assert(PP.getLangOpts().ObjC2 && "no import syntax available"); + assert(PP.getLangOpts().ObjC && "no import syntax available"); SmallString<128> PathString; for (size_t I = 0, N = Path.size(); I != N; ++I) { @@ -1978,7 +1978,7 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc, // Warn that we're replacing the include/import with a module import. // We only do this in Objective-C, where we have a module-import syntax. - if (getLangOpts().ObjC2) + if (getLangOpts().ObjC) diagnoseAutoModuleImport(*this, HashLoc, IncludeTok, Path, CharEnd); // Load the module to import its macros. We'll make the declarations @@ -2215,7 +2215,7 @@ void Preprocessor::HandleMicrosoftImportDirective(Token &Tok) { /// void Preprocessor::HandleImportDirective(SourceLocation HashLoc, Token &ImportTok) { - if (!LangOpts.ObjC1) { // #import is standard for ObjC. + if (!LangOpts.ObjC) { // #import is standard for ObjC. if (LangOpts.MSVCCompat) return HandleMicrosoftImportDirective(ImportTok); Diag(ImportTok, diag::ext_pp_import_directive); @@ -2686,7 +2686,7 @@ void Preprocessor::HandleDefineDirective( II->isStr("__unsafe_unretained") || II->isStr("__autoreleasing"); }; - if (getLangOpts().ObjC1 && + if (getLangOpts().ObjC && SourceMgr.getFileID(OtherMI->getDefinitionLoc()) == getPredefinesFileID() && isObjCProtectedMacro(MacroNameTok.getIdentifierInfo())) { -- cgit v1.2.3