Skip to content

Commit 8f8529c

Browse files
authored
[lldb-dap] Gardening in lldb-dap.cpp (NFC) (#128949)
- Remove more unused includes - Limit anonymous namespace to llvm::opt - Fix code style
1 parent ead7b7b commit 8f8529c

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

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

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===-- lldb-dap.cpp -----------------------------------------*- C++ -*-===//
1+
//===-- lldb-dap.cpp ------------------------------------------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -8,10 +8,7 @@
88

99
#include "DAP.h"
1010
#include "EventHelper.h"
11-
#include "FifoFiles.h"
1211
#include "Handler/RequestHandler.h"
13-
#include "JSONUtils.h"
14-
#include "LLDBUtils.h"
1512
#include "RunInTerminal.h"
1613
#include "lldb/API/SBStream.h"
1714
#include "lldb/Host/Config.h"
@@ -38,22 +35,15 @@
3835
#include "llvm/Support/Signals.h"
3936
#include "llvm/Support/Threading.h"
4037
#include "llvm/Support/raw_ostream.h"
41-
#include <algorithm>
4238
#include <condition_variable>
43-
#include <cstdint>
4439
#include <cstdio>
4540
#include <cstdlib>
46-
#include <cstring>
4741
#include <fcntl.h>
4842
#include <fstream>
4943
#include <map>
5044
#include <memory>
5145
#include <mutex>
52-
#include <optional>
53-
#include <ostream>
5446
#include <string>
55-
#include <sys/stat.h>
56-
#include <sys/types.h>
5747
#include <thread>
5848
#include <utility>
5949
#include <vector>
@@ -118,8 +108,9 @@ class LLDBDAPOptTable : public llvm::opt::GenericOptTable {
118108
: llvm::opt::GenericOptTable(OptionStrTable, OptionPrefixesTable,
119109
InfoTable, true) {}
120110
};
111+
} // anonymous namespace
121112

122-
void RegisterRequestCallbacks(DAP &dap) {
113+
static void RegisterRequestCallbacks(DAP &dap) {
123114
dap.RegisterRequest<AttachRequestHandler>();
124115
dap.RegisterRequest<BreakpointLocationsRequestHandler>();
125116
dap.RegisterRequest<CompletionsRequestHandler>();
@@ -160,9 +151,7 @@ void RegisterRequestCallbacks(DAP &dap) {
160151
dap.RegisterRequest<TestGetTargetBreakpointsRequestHandler>();
161152
}
162153

163-
} // anonymous namespace
164-
165-
static void printHelp(LLDBDAPOptTable &table, llvm::StringRef tool_name) {
154+
static void PrintHelp(LLDBDAPOptTable &table, llvm::StringRef tool_name) {
166155
std::string usage_str = tool_name.str() + " options";
167156
table.printHelp(llvm::outs(), usage_str.c_str(), "LLDB DAP", false);
168157

@@ -433,7 +422,7 @@ int main(int argc, char *argv[]) {
433422
llvm::opt::InputArgList input_args = T.ParseArgs(ArgsArr, MAI, MAC);
434423

435424
if (input_args.hasArg(OPT_help)) {
436-
printHelp(T, llvm::sys::path::filename(argv[0]));
425+
PrintHelp(T, llvm::sys::path::filename(argv[0]));
437426
return EXIT_SUCCESS;
438427
}
439428

0 commit comments

Comments
 (0)