[Lldb-commits] [PATCH] D65717: [lldb][clang] Reflect LangStandard.h move to clang/Basic
Rainer Orth via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Sun Aug 4 03:27:48 PDT 2019
ro created this revision.
ro added reviewers: clayborg, shafik.
ro added a project: LLDB.
Herald added a subscriber: teemperor.
D65562 <https://reviews.llvm.org/D65562> moves `LangStandard.h` from `clang/Frontend` to `clang/Basic`. This patch
adjusts the single file in lldb that uses it to match.
Tested on `x86_64-pc-linux-gnu`. Ok for trunk?
One thing I'm unsure about is the scenario of building lldb with an existing (pre-Langstandard.h move)
clang: is this supposed to work in the general case and if so, how to deal with the two
possible paths for the header? I couldn't find an example of this in lldb.
Repository:
rLLDB LLDB
https://reviews.llvm.org/D65717
Files:
source/Symbol/ClangASTContext.cpp
Index: source/Symbol/ClangASTContext.cpp
===================================================================
--- source/Symbol/ClangASTContext.cpp
+++ source/Symbol/ClangASTContext.cpp
@@ -47,11 +47,11 @@
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/FileSystemOptions.h"
+#include "clang/Basic/LangStandard.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Basic/TargetOptions.h"
#include "clang/Frontend/FrontendOptions.h"
-#include "clang/Frontend/LangStandard.h"
#include "clang/Sema/Sema.h"
#ifdef LLDB_DEFINED_NDEBUG_FOR_CLANG
@@ -111,10 +111,10 @@
static inline bool
ClangASTContextSupportsLanguage(lldb::LanguageType language) {
return language == eLanguageTypeUnknown || // Clang is the default type system
- Language::LanguageIsC(language) ||
- Language::LanguageIsCPlusPlus(language) ||
- Language::LanguageIsObjC(language) ||
- Language::LanguageIsPascal(language) ||
+ lldb_private::Language::LanguageIsC(language) ||
+ lldb_private::Language::LanguageIsCPlusPlus(language) ||
+ lldb_private::Language::LanguageIsObjC(language) ||
+ lldb_private::Language::LanguageIsPascal(language) ||
// Use Clang for Rust until there is a proper language plugin for it
language == eLanguageTypeRust ||
language == eLanguageTypeExtRenderScript ||
@@ -571,7 +571,7 @@
// 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.getLanguage() == InputKind::Asm) {
+ if (IK.getLanguage() == clang::Language::Asm) {
Opts.AsmPreprocessor = 1;
} else if (IK.isObjectiveC()) {
Opts.ObjC = 1;
@@ -582,26 +582,26 @@
if (LangStd == LangStandard::lang_unspecified) {
// Based on the base language, pick one.
switch (IK.getLanguage()) {
- case InputKind::Unknown:
- case InputKind::LLVM_IR:
- case InputKind::RenderScript:
+ case clang::Language::Unknown:
+ case clang::Language::LLVM_IR:
+ case clang::Language::RenderScript:
llvm_unreachable("Invalid input kind!");
- case InputKind::OpenCL:
+ case clang::Language::OpenCL:
LangStd = LangStandard::lang_opencl10;
break;
- case InputKind::CUDA:
+ case clang::Language::CUDA:
LangStd = LangStandard::lang_cuda;
break;
- case InputKind::Asm:
- case InputKind::C:
- case InputKind::ObjC:
+ case clang::Language::Asm:
+ case clang::Language::C:
+ case clang::Language::ObjC:
LangStd = LangStandard::lang_gnu99;
break;
- case InputKind::CXX:
- case InputKind::ObjCXX:
+ case clang::Language::CXX:
+ case clang::Language::ObjCXX:
LangStd = LangStandard::lang_gnucxx98;
break;
- case InputKind::HIP:
+ case clang::Language::HIP:
LangStd = LangStandard::lang_hip;
break;
}
@@ -901,8 +901,9 @@
LangOptions *ClangASTContext::getLanguageOptions() {
if (m_language_options_up == nullptr) {
m_language_options_up.reset(new LangOptions());
- ParseLangArgs(*m_language_options_up, InputKind::ObjCXX, GetTargetTriple());
- // InitializeLangOptions(*m_language_options_up, InputKind::ObjCXX);
+ ParseLangArgs(*m_language_options_up, clang::Language::ObjCXX,
+ GetTargetTriple());
+ // InitializeLangOptions(*m_language_options_up, Language::ObjCXX);
}
return m_language_options_up.get();
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65717.213240.patch
Type: text/x-patch
Size: 3596 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190804/437282c1/attachment-0001.bin>
More information about the lldb-commits
mailing list