Skip to content

Commit f8a1db3

Browse files
committed
Do not include SB headers in Plugins/
1 parent 3d267a8 commit f8a1db3

File tree

7 files changed

+20
-18
lines changed

7 files changed

+20
-18
lines changed

lldb/source/Core/ValueObjectDynamicValue.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "lldb/Core/ValueObjectDynamicValue.h"
10-
#include "lldb/API/SBLanguages.h"
1110
#include "lldb/Core/Value.h"
1211
#include "lldb/Core/ValueObject.h"
1312
#include "lldb/Symbol/CompilerType.h"
@@ -22,6 +21,7 @@
2221
#include "lldb/Utility/Scalar.h"
2322
#include "lldb/Utility/Status.h"
2423
#include "lldb/lldb-types.h"
24+
#include "llvm/BinaryFormat/Dwarf.h"
2525

2626
#include <cstring>
2727
#include <optional>
@@ -168,8 +168,8 @@ bool ValueObjectDynamicValue::UpdateValue() {
168168
#ifdef LLDB_ENABLE_SWIFT
169169
// An Objective-C object inside a Swift frame.
170170
if (known_type == eLanguageTypeObjC)
171-
if ((exe_ctx.GetFramePtr() &&
172-
exe_ctx.GetFramePtr()->GetLanguage().name == eLanguageNameSwift) ||
171+
if ((exe_ctx.GetFramePtr() && exe_ctx.GetFramePtr()->GetLanguage().name ==
172+
llvm::dwarf::DW_LNAME_Swift) ||
173173
(exe_ctx.GetTargetPtr() && exe_ctx.GetTargetPtr()->IsSwiftREPL())) {
174174
runtime = process->GetLanguageRuntime(lldb::eLanguageTypeSwift);
175175
if (runtime)

lldb/source/Plugins/ExpressionParser/Swift/SwiftExpressionParser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include "SwiftUserExpression.h"
2323

2424
#include "Plugins/LanguageRuntime/Swift/SwiftLanguageRuntime.h"
25-
#include "lldb/API/SBLanguages.h"
2625
#include "lldb/Core/Module.h"
2726
#include "lldb/Core/ModuleList.h"
2827
#include "lldb/Core/ModuleSpec.h"
@@ -47,6 +46,7 @@
4746
#include "llvm-c/Analysis.h"
4847
#include "llvm/ADT/ArrayRef.h"
4948
#include "llvm/ADT/StringRef.h"
49+
#include "llvm/BinaryFormat/Dwarf.h"
5050
#include "llvm/IR/IRBuilder.h"
5151
#include "llvm/IR/LLVMContext.h"
5252
#include "llvm/IR/Module.h"
@@ -101,7 +101,7 @@ SwiftExpressionParser::SwiftExpressionParser(
101101
m_expr(expr), m_swift_ast_ctx(swift_ast_ctx), m_exe_scope(exe_scope),
102102
m_local_variables(std::move(local_variables)),
103103
m_options(options) {
104-
assert(expr.Language().name == eLanguageNameSwift);
104+
assert(expr.Language().name == llvm::dwarf::DW_LNAME_Swift);
105105

106106
// TODO: This code is copied from ClangExpressionParser.cpp.
107107
// Factor this out into common code.

lldb/source/Plugins/ExpressionParser/Swift/SwiftExpressionSourceCode.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,18 @@
1111

1212
#include "Plugins/ExpressionParser/Swift/SwiftASTManipulator.h"
1313
#include "Plugins/TypeSystem/Swift/SwiftASTContext.h"
14-
#include "lldb/API/SBLanguages.h"
1514
#include "lldb/Target/Language.h"
1615
#include "lldb/Target/Platform.h"
1716
#include "lldb/Target/Target.h"
1817
#include "lldb/Utility/StreamString.h"
1918

20-
#include "llvm/ADT/StringRef.h"
2119
#include "swift/Basic/LangOptions.h"
2220
#include "swift/Demangling/Demangle.h"
2321
#include "swift/Demangling/Demangler.h"
2422

23+
#include "llvm/ADT/StringRef.h"
24+
#include "llvm/BinaryFormat/Dwarf.h"
25+
2526
using namespace lldb;
2627
using namespace lldb_private;
2728

@@ -571,7 +572,7 @@ Status SwiftExpressionSourceCode::GetText(
571572
const uint32_t pound_line = options.GetPoundLineLine();
572573
StreamString pound_body;
573574
if (pound_file && pound_line) {
574-
if (wrapping_language.name == eLanguageNameSwift) {
575+
if (wrapping_language.name == llvm::dwarf::DW_LNAME_Swift) {
575576
pound_body.Printf("#sourceLocation(file: \"%s\", line: %u)\n%s",
576577
pound_file, pound_line, body);
577578
} else {
@@ -580,7 +581,7 @@ Status SwiftExpressionSourceCode::GetText(
580581
body = pound_body.GetString().data();
581582
}
582583

583-
if (wrapping_language.name != eLanguageNameSwift) {
584+
if (wrapping_language.name != llvm::dwarf::DW_LNAME_Swift) {
584585
status.SetErrorString("language is not Swift");
585586
return status;
586587
}

lldb/source/Plugins/ExpressionParser/Swift/SwiftUserExpression.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#endif
2525

2626
#include "Plugins/LanguageRuntime/Swift/SwiftLanguageRuntime.h"
27-
#include "lldb/API/SBLanguages.h"
2827
#include "lldb/Core/Module.h"
2928
#include "lldb/Expression/DiagnosticManager.h"
3029
#include "lldb/Expression/ExpressionParser.h"
@@ -45,6 +44,7 @@
4544
#include "swift/AST/ASTContext.h"
4645
#include "swift/Demangling/Demangler.h"
4746
#include "swift/AST/GenericEnvironment.h"
47+
#include "llvm/BinaryFormat/Dwarf.h"
4848

4949
#include <map>
5050
#include <string>
@@ -98,7 +98,8 @@ void SwiftUserExpression::DidFinishExecuting() {
9898
static bool isSwiftLanguageSymbolContext(const SwiftUserExpression &expr,
9999
const SymbolContext &sym_ctx) {
100100
if (sym_ctx.comp_unit &&
101-
(!expr.Language() || expr.Language().name == eLanguageNameSwift)) {
101+
(!expr.Language() ||
102+
expr.Language().name == llvm::dwarf::DW_LNAME_Swift)) {
102103
if (sym_ctx.comp_unit->GetLanguage() == lldb::eLanguageTypeSwift)
103104
return true;
104105
} else if (sym_ctx.symbol && !expr.Language()) {

lldb/source/Plugins/InstrumentationRuntime/MainThreadChecker/InstrumentationRuntimeMainThreadChecker.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include "InstrumentationRuntimeMainThreadChecker.h"
1010

1111
#include "Plugins/Process/Utility/HistoryThread.h"
12-
#include "lldb/API/SBLanguages.h"
1312
#include "lldb/Breakpoint/StoppointCallbackContext.h"
1413
#include "lldb/Core/Module.h"
1514
#include "lldb/Core/PluginManager.h"
@@ -30,6 +29,7 @@
3029
#include "swift/AST/ASTContext.h"
3130
#include "swift/AST/NameLookup.h"
3231
#include "swift/ClangImporter/ClangImporter.h"
32+
#include "llvm/BinaryFormat/Dwarf.h"
3333
#endif // LLDB_ENABLE_SWIFT
3434

3535
#include <memory>
@@ -227,7 +227,7 @@ InstrumentationRuntimeMainThreadChecker::RetrieveReportData(
227227

228228
#ifdef LLDB_ENABLE_SWIFT
229229
if (responsible_frame) {
230-
if (responsible_frame->GetLanguage().name == eLanguageNameSwift) {
230+
if (responsible_frame->GetLanguage().name == llvm::dwarf::DW_LNAME_Swift) {
231231
std::string swiftApiName =
232232
TranslateObjCNameToSwiftName(className, selector, responsible_frame);
233233
if (swiftApiName != "")

lldb/source/Target/ThreadPlanCallFunction.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "lldb/Target/ThreadPlanCallFunction.h"
10-
#include "lldb/API/SBLanguages.h"
1110
#include "lldb/Breakpoint/Breakpoint.h"
1211
#include "lldb/Breakpoint/BreakpointLocation.h"
1312
#include "lldb/Core/Address.h"
@@ -31,7 +30,8 @@
3130
#ifdef LLDB_ENABLE_SWIFT
3231
#include "Plugins/LanguageRuntime/Swift/SwiftLanguageRuntime.h"
3332
#include "Plugins/ExpressionParser/Swift/SwiftPersistentExpressionState.h"
34-
#endif //LLDB_ENABLE_SWIFT
33+
#include "llvm/BinaryFormat/Dwarf.h"
34+
#endif // LLDB_ENABLE_SWIFT
3535

3636
using namespace lldb;
3737
using namespace lldb_private;
@@ -428,7 +428,7 @@ void ThreadPlanCallFunction::SetBreakpoints() {
428428
}
429429
}
430430
#ifdef LLDB_ENABLE_SWIFT
431-
if (GetExpressionLanguage().name == eLanguageNameSwift) {
431+
if (GetExpressionLanguage().name == llvm::dwarf::DW_LNAME_Swift) {
432432
auto *swift_runtime
433433
= SwiftLanguageRuntime::Get(m_process.shared_from_this());
434434
if (swift_runtime) {

lldb/source/Target/ThreadPlanStepOut.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "lldb/Target/ThreadPlanStepOut.h"
10-
#include "lldb/API/SBLanguages.h"
1110
#include "lldb/Breakpoint/Breakpoint.h"
1211
#include "lldb/Core/Value.h"
1312
#include "lldb/Core/ValueObjectConstResult.h"
@@ -31,6 +30,7 @@
3130

3231
#ifdef LLDB_ENABLE_SWIFT
3332
#include "Plugins/LanguageRuntime/Swift/SwiftLanguageRuntime.h"
33+
#include "llvm/BinaryFormat/Dwarf.h"
3434
#endif // LLDB_ENABLE_SWIFT
3535

3636
using namespace lldb;
@@ -180,7 +180,7 @@ ThreadPlanStepOut::ThreadPlanStepOut(
180180
if (frame_idx == 0) {
181181
StackFrameSP frame_sp = GetThread().GetStackFrameAtIndex(0);
182182
#ifdef LLDB_ENABLE_SWIFT
183-
if (frame_sp->GuessLanguage().name == eLanguageNameSwift) {
183+
if (frame_sp->GuessLanguage().name == llvm::dwarf::DW_LNAME_Swift) {
184184
auto *swift_runtime
185185
= SwiftLanguageRuntime::Get(m_process.shared_from_this());
186186
if (swift_runtime) {

0 commit comments

Comments
 (0)