[Lldb-commits] [lldb] r345637 - NFC: Remove the ObjC1/ObjC2 distinction from clang (and related projects)

Erik Pilkington via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 30 13:31:31 PDT 2018


Author: epilk
Date: Tue Oct 30 13:31:30 2018
New Revision: 345637

URL: http://llvm.org/viewvc/llvm-project?rev=345637&view=rev
Log:
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

Modified:
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
    lldb/trunk/source/Plugins/Language/ClangCommon/ClangHighlighter.cpp
    lldb/trunk/source/Symbol/ClangASTContext.cpp

Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp (original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp Tue Oct 30 13:31:30 2018
@@ -381,8 +381,7 @@ ClangExpressionParser::ClangExpressionPa
     m_compiler->getLangOpts().CPlusPlus = true;
     break;
   case lldb::eLanguageTypeObjC:
-    m_compiler->getLangOpts().ObjC1 = true;
-    m_compiler->getLangOpts().ObjC2 = true;
+    m_compiler->getLangOpts().ObjC = true;
     // FIXME: the following language option is a temporary workaround,
     // to "ask for ObjC, get ObjC++" (see comment above).
     m_compiler->getLangOpts().CPlusPlus = true;
@@ -406,13 +405,12 @@ ClangExpressionParser::ClangExpressionPa
     // FIXME: the following language option is a temporary workaround,
     // to "ask for C++, get ObjC++".  Apple hopes to remove this requirement on
     // non-Apple platforms, but for now it is needed.
-    m_compiler->getLangOpts().ObjC1 = true;
+    m_compiler->getLangOpts().ObjC = true;
     break;
   case lldb::eLanguageTypeObjC_plus_plus:
   case lldb::eLanguageTypeUnknown:
   default:
-    m_compiler->getLangOpts().ObjC1 = true;
-    m_compiler->getLangOpts().ObjC2 = true;
+    m_compiler->getLangOpts().ObjC = true;
     m_compiler->getLangOpts().CPlusPlus = true;
     m_compiler->getLangOpts().CPlusPlus11 = true;
     m_compiler->getHeaderSearchOpts().UseLibcxx = true;
@@ -436,7 +434,7 @@ ClangExpressionParser::ClangExpressionPa
   // long time parsing and importing debug information.
   m_compiler->getLangOpts().SpellChecking = false;
 
-  if (process_sp && m_compiler->getLangOpts().ObjC1) {
+  if (process_sp && m_compiler->getLangOpts().ObjC) {
     if (process_sp->GetObjCLanguageRuntime()) {
       if (process_sp->GetObjCLanguageRuntime()->GetRuntimeVersion() ==
           ObjCLanguageRuntime::ObjCRuntimeVersions::eAppleObjC_V2)

Modified: lldb/trunk/source/Plugins/Language/ClangCommon/ClangHighlighter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ClangCommon/ClangHighlighter.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/ClangCommon/ClangHighlighter.cpp (original)
+++ lldb/trunk/source/Plugins/Language/ClangCommon/ClangHighlighter.cpp Tue Oct 30 13:31:30 2018
@@ -155,7 +155,8 @@ void ClangHighlighter::Highlight(const H
   // Let's just enable the latest ObjC and C++ which should get most tokens
   // right.
   LangOptions Opts;
-  Opts.ObjC2 = true;
+  Opts.ObjC = true;
+  // FIXME: This should probably set CPlusPlus, CPlusPlus11, ... too
   Opts.CPlusPlus17 = true;
   Opts.LineComment = true;
 

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=345637&r1=345636&r2=345637&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Tue Oct 30 13:31:30 2018
@@ -459,7 +459,7 @@ static void ParseLangArgs(LangOptions &O
   if (IK.getLanguage() == InputKind::Asm) {
     Opts.AsmPreprocessor = 1;
   } else if (IK.isObjectiveC()) {
-    Opts.ObjC1 = Opts.ObjC2 = 1;
+    Opts.ObjC = 1;
   }
 
   LangStandard::Kind LangStd = LangStandard::lang_unspecified;




More information about the lldb-commits mailing list