Skip to content

Commit 09c258e

Browse files
authored
[NFC][lldb-dap] Clean-up includes (#113839)
This commit cleans up the includes in the `lldb-dap` subfolder. The main motivation was that I got annoyed by `clangd` always complaining about unused includes while working on lldb-dap.
1 parent f78610a commit 09c258e

20 files changed

+24
-53
lines changed

lldb/tools/lldb-dap/Breakpoint.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "Breakpoint.h"
1010
#include "DAP.h"
1111
#include "JSONUtils.h"
12+
#include "lldb/API/SBBreakpointLocation.h"
1213
#include "llvm/ADT/StringExtras.h"
1314

1415
using namespace lldb_dap;

lldb/tools/lldb-dap/Breakpoint.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define LLDB_TOOLS_LLDB_DAP_BREAKPOINT_H
1111

1212
#include "BreakpointBase.h"
13+
#include "lldb/API/SBBreakpoint.h"
1314

1415
namespace lldb_dap {
1516

lldb/tools/lldb-dap/BreakpointBase.cpp

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

99
#include "BreakpointBase.h"
10-
#include "DAP.h"
11-
#include "llvm/ADT/StringExtras.h"
10+
#include "JSONUtils.h"
1211

1312
using namespace lldb_dap;
1413

lldb/tools/lldb-dap/BreakpointBase.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@
99
#ifndef LLDB_TOOLS_LLDB_DAP_BREAKPOINTBASE_H
1010
#define LLDB_TOOLS_LLDB_DAP_BREAKPOINTBASE_H
1111

12-
#include "lldb/API/SBBreakpoint.h"
1312
#include "llvm/Support/JSON.h"
1413
#include <string>
15-
#include <vector>
1614

1715
namespace lldb_dap {
1816

lldb/tools/lldb-dap/DAP.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@
1010
#include <cstdarg>
1111
#include <fstream>
1212
#include <mutex>
13-
#include <sstream>
1413

1514
#include "DAP.h"
15+
#include "JSONUtils.h"
1616
#include "LLDBUtils.h"
1717
#include "lldb/API/SBCommandInterpreter.h"
18+
#include "lldb/API/SBLanguageRuntime.h"
19+
#include "lldb/API/SBListener.h"
20+
#include "lldb/API/SBStream.h"
1821
#include "llvm/ADT/StringExtras.h"
1922
#include "llvm/Support/FormatVariadic.h"
2023

lldb/tools/lldb-dap/DAP.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,10 @@
99
#ifndef LLDB_TOOLS_LLDB_DAP_DAP_H
1010
#define LLDB_TOOLS_LLDB_DAP_DAP_H
1111

12-
#include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX
13-
14-
#include <atomic>
15-
#include <condition_variable>
1612
#include <cstdio>
17-
#include <future>
1813
#include <iosfwd>
1914
#include <map>
2015
#include <optional>
21-
#include <set>
2216
#include <thread>
2317

2418
#include "llvm/ADT/DenseMap.h"
@@ -30,24 +24,12 @@
3024
#include "llvm/Support/raw_ostream.h"
3125

3226
#include "lldb/API/SBAttachInfo.h"
33-
#include "lldb/API/SBBreakpoint.h"
34-
#include "lldb/API/SBBreakpointLocation.h"
3527
#include "lldb/API/SBCommandInterpreter.h"
3628
#include "lldb/API/SBCommandReturnObject.h"
37-
#include "lldb/API/SBCommunication.h"
3829
#include "lldb/API/SBDebugger.h"
3930
#include "lldb/API/SBEvent.h"
4031
#include "lldb/API/SBFormat.h"
41-
#include "lldb/API/SBHostOS.h"
42-
#include "lldb/API/SBInstruction.h"
43-
#include "lldb/API/SBInstructionList.h"
44-
#include "lldb/API/SBLanguageRuntime.h"
4532
#include "lldb/API/SBLaunchInfo.h"
46-
#include "lldb/API/SBLineEntry.h"
47-
#include "lldb/API/SBListener.h"
48-
#include "lldb/API/SBProcess.h"
49-
#include "lldb/API/SBStream.h"
50-
#include "lldb/API/SBStringList.h"
5133
#include "lldb/API/SBTarget.h"
5234
#include "lldb/API/SBThread.h"
5335

@@ -56,7 +38,6 @@
5638
#include "IOStream.h"
5739
#include "InstructionBreakpoint.h"
5840
#include "ProgressEvent.h"
59-
#include "RunInTerminal.h"
6041
#include "SourceBreakpoint.h"
6142

6243
#define VARREF_LOCALS (int64_t)1

lldb/tools/lldb-dap/FifoFiles.cpp

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

99
#include "FifoFiles.h"
10+
#include "JSONUtils.h"
1011

1112
#if !defined(_WIN32)
1213
#include <sys/stat.h>
@@ -18,11 +19,6 @@
1819
#include <fstream>
1920
#include <future>
2021
#include <optional>
21-
#include <thread>
22-
23-
#include "llvm/Support/FileSystem.h"
24-
25-
#include "lldb/lldb-defines.h"
2622

2723
using namespace llvm;
2824

lldb/tools/lldb-dap/FifoFiles.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@
99
#ifndef LLDB_TOOLS_LLDB_DAP_FIFOFILES_H
1010
#define LLDB_TOOLS_LLDB_DAP_FIFOFILES_H
1111

12-
#include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX
1312
#include "llvm/Support/Error.h"
14-
15-
#include "JSONUtils.h"
13+
#include "llvm/Support/JSON.h"
1614

1715
#include <chrono>
1816

lldb/tools/lldb-dap/FunctionBreakpoint.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include "FunctionBreakpoint.h"
1010
#include "DAP.h"
11+
#include "JSONUtils.h"
1112

1213
namespace lldb_dap {
1314

lldb/tools/lldb-dap/IOStream.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
#include <fstream>
2020
#include <string>
21-
#include <vector>
2221

2322
using namespace lldb_dap;
2423

lldb/tools/lldb-dap/IOStream.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
#ifndef LLDB_TOOLS_LLDB_DAP_IOSTREAM_H
1010
#define LLDB_TOOLS_LLDB_DAP_IOSTREAM_H
1111

12-
#include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX
13-
1412
#if defined(_WIN32)
1513
// We need to #define NOMINMAX in order to skip `min()` and `max()` macro
1614
// definitions that conflict with other system headers.

lldb/tools/lldb-dap/InstructionBreakpoint.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include "InstructionBreakpoint.h"
1111
#include "DAP.h"
12+
#include "JSONUtils.h"
1213

1314
namespace lldb_dap {
1415

lldb/tools/lldb-dap/InstructionBreakpoint.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#define LLDB_TOOLS_LLDB_DAP_INSTRUCTIONBREAKPOINT_H
1212

1313
#include "Breakpoint.h"
14-
#include "llvm/ADT/StringRef.h"
1514

1615
namespace lldb_dap {
1716

lldb/tools/lldb-dap/JSONUtils.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,21 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include <algorithm>
109
#include <iomanip>
1110
#include <optional>
1211
#include <sstream>
1312
#include <string.h>
1413

1514
#include "llvm/ADT/StringRef.h"
16-
#include "llvm/Support/FormatAdapters.h"
1715
#include "llvm/Support/FormatVariadic.h"
1816
#include "llvm/Support/Path.h"
1917
#include "llvm/Support/ScopedPrinter.h"
2018

21-
#include "lldb/API/SBBreakpoint.h"
22-
#include "lldb/API/SBBreakpointLocation.h"
2319
#include "lldb/API/SBDeclaration.h"
20+
#include "lldb/API/SBStream.h"
2421
#include "lldb/API/SBStringList.h"
2522
#include "lldb/API/SBStructuredData.h"
2623
#include "lldb/API/SBValue.h"
27-
#include "lldb/Host/PosixApi.h"
2824

2925
#include "DAP.h"
3026
#include "ExceptionBreakpoint.h"

lldb/tools/lldb-dap/LLDBUtils.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#include "LLDBUtils.h"
1010
#include "DAP.h"
11+
#include "JSONUtils.h"
12+
#include "lldb/API/SBStringList.h"
1113

1214
#include <mutex>
1315

lldb/tools/lldb-dap/OutputRedirector.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
#ifndef LLDB_TOOLS_LLDB_DAP_OUTPUT_REDIRECTOR_H
1010
#define LLDB_TOOLS_LLDB_DAP_OUTPUT_REDIRECTOR_H
1111

12-
#include <thread>
13-
1412
#include "llvm/ADT/StringRef.h"
1513
#include "llvm/Support/Error.h"
1614

lldb/tools/lldb-dap/RunInTerminal.cpp

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

99
#include "RunInTerminal.h"
10+
#include "JSONUtils.h"
1011

1112
#if !defined(_WIN32)
1213
#include <sys/stat.h>
@@ -15,14 +16,10 @@
1516
#endif
1617

1718
#include <chrono>
18-
#include <fstream>
1919
#include <future>
20-
#include <thread>
2120

2221
#include "llvm/Support/FileSystem.h"
2322

24-
#include "lldb/lldb-defines.h"
25-
2623
using namespace llvm;
2724

2825
namespace lldb_dap {

lldb/tools/lldb-dap/RunInTerminal.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010
#define LLDB_TOOLS_LLDB_DAP_RUNINTERMINAL_H
1111

1212
#include "FifoFiles.h"
13+
#include "lldb/API/SBError.h"
1314

1415
#include <future>
15-
#include <thread>
16+
#include <memory>
17+
#include <string>
1618

1719
namespace lldb_dap {
1820

lldb/tools/lldb-dap/SourceBreakpoint.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include "SourceBreakpoint.h"
1010
#include "DAP.h"
11+
#include "JSONUtils.h"
1112

1213
namespace lldb_dap {
1314

lldb/tools/lldb-dap/lldb-dap.cpp

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

99
#include "DAP.h"
10+
#include "FifoFiles.h"
11+
#include "RunInTerminal.h"
1012
#include "Watchpoint.h"
1113
#include "lldb/API/SBDeclaration.h"
14+
#include "lldb/API/SBInstruction.h"
15+
#include "lldb/API/SBListener.h"
1216
#include "lldb/API/SBMemoryRegionInfo.h"
17+
#include "lldb/API/SBStringList.h"
1318
#include "llvm/Support/Base64.h"
1419

1520
#include <cassert>
@@ -43,17 +48,12 @@
4348

4449
#include <algorithm>
4550
#include <array>
46-
#include <chrono>
47-
#include <fstream>
4851
#include <map>
4952
#include <memory>
50-
#include <mutex>
5153
#include <set>
52-
#include <sstream>
5354
#include <thread>
5455
#include <vector>
5556

56-
#include "lldb/API/SBEnvironment.h"
5757
#include "lldb/API/SBStream.h"
5858
#include "lldb/Host/Config.h"
5959
#include "llvm/ADT/ArrayRef.h"

0 commit comments

Comments
 (0)