[Lldb-commits] [lldb] r301483 - Update lldb to match clang r301442.

Richard Smith via lldb-commits lldb-commits at lists.llvm.org
Wed Apr 26 15:10:53 PDT 2017


Author: rsmith
Date: Wed Apr 26 17:10:53 2017
New Revision: 301483

URL: http://llvm.org/viewvc/llvm-project?rev=301483&view=rev
Log:
Update lldb to match clang r301442.

This code really doesn't make any sense: there is only ever one InputKind here.
Plus, this is an incomplete and out-of-date copy-paste of some Clang code. This
really ought to be revisited, but this change should get the bots green again.

Modified:
    lldb/trunk/source/Symbol/ClangASTContext.cpp

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=301483&r1=301482&r2=301483&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Wed Apr 26 17:10:53 2017
@@ -378,10 +378,9 @@ static void ParseLangArgs(LangOptions &O
   // Set some properties which depend solely on the input kind; it would be nice
   // to move these to the language standard, and have the driver resolve the
   // input kind + language standard.
-  if (IK == IK_Asm) {
+  if (IK.getLanguage() == InputKind::Asm) {
     Opts.AsmPreprocessor = 1;
-  } else if (IK == IK_ObjC || IK == IK_ObjCXX || IK == IK_PreprocessedObjC ||
-             IK == IK_PreprocessedObjCXX) {
+  } else if (IK.isObjectiveC()) {
     Opts.ObjC1 = Opts.ObjC2 = 1;
   }
 
@@ -389,30 +388,24 @@ static void ParseLangArgs(LangOptions &O
 
   if (LangStd == LangStandard::lang_unspecified) {
     // Based on the base language, pick one.
-    switch (IK) {
-    case IK_None:
-    case IK_AST:
-    case IK_LLVM_IR:
-    case IK_RenderScript:
+    switch (IK.getLanguage()) {
+    case InputKind::Unknown:
+    case InputKind::LLVM_IR:
+    case InputKind::RenderScript:
       llvm_unreachable("Invalid input kind!");
-    case IK_OpenCL:
+    case InputKind::OpenCL:
       LangStd = LangStandard::lang_opencl;
       break;
-    case IK_CUDA:
-    case IK_PreprocessedCuda:
+    case InputKind::CUDA:
       LangStd = LangStandard::lang_cuda;
       break;
-    case IK_Asm:
-    case IK_C:
-    case IK_PreprocessedC:
-    case IK_ObjC:
-    case IK_PreprocessedObjC:
+    case InputKind::Asm:
+    case InputKind::C:
+    case InputKind::ObjC:
       LangStd = LangStandard::lang_gnu99;
       break;
-    case IK_CXX:
-    case IK_PreprocessedCXX:
-    case IK_ObjCXX:
-    case IK_PreprocessedObjCXX:
+    case InputKind::CXX:
+    case InputKind::ObjCXX:
       LangStd = LangStandard::lang_gnucxx98;
       break;
     }
@@ -784,8 +777,8 @@ IdentifierTable *ClangASTContext::getIde
 LangOptions *ClangASTContext::getLanguageOptions() {
   if (m_language_options_ap.get() == nullptr) {
     m_language_options_ap.reset(new LangOptions());
-    ParseLangArgs(*m_language_options_ap, IK_ObjCXX, GetTargetTriple());
-    //        InitializeLangOptions(*m_language_options_ap, IK_ObjCXX);
+    ParseLangArgs(*m_language_options_ap, InputKind::ObjCXX, GetTargetTriple());
+    //        InitializeLangOptions(*m_language_options_ap, InputKind::ObjCXX);
   }
   return m_language_options_ap.get();
 }




More information about the lldb-commits mailing list