Skip to content

Commit 679e038

Browse files
committed
[lldb-dap] Gardening in lldb-dap.cpp (NFC)
- Remove more unused includes - Limit anonymous namespace to llvm::opt - Fix code style
1 parent 317461e commit 679e038

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

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

Lines changed: 5 additions & 17 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"
@@ -23,7 +20,6 @@
2320
#include "lldb/lldb-forward.h"
2421
#include "llvm/ADT/ArrayRef.h"
2522
#include "llvm/ADT/ScopeExit.h"
26-
#include "llvm/ADT/StringExtras.h"
2723
#include "llvm/ADT/StringRef.h"
2824
#include "llvm/Option/Arg.h"
2925
#include "llvm/Option/ArgList.h"
@@ -37,22 +33,15 @@
3733
#include "llvm/Support/Signals.h"
3834
#include "llvm/Support/Threading.h"
3935
#include "llvm/Support/raw_ostream.h"
40-
#include <algorithm>
4136
#include <condition_variable>
42-
#include <cstdint>
4337
#include <cstdio>
4438
#include <cstdlib>
45-
#include <cstring>
4639
#include <fcntl.h>
4740
#include <fstream>
4841
#include <map>
4942
#include <memory>
5043
#include <mutex>
51-
#include <optional>
52-
#include <ostream>
5344
#include <string>
54-
#include <sys/stat.h>
55-
#include <sys/types.h>
5645
#include <thread>
5746
#include <utility>
5847
#include <vector>
@@ -113,8 +102,9 @@ class LLDBDAPOptTable : public llvm::opt::GenericOptTable {
113102
: llvm::opt::GenericOptTable(OptionStrTable, OptionPrefixesTable,
114103
InfoTable, true) {}
115104
};
105+
} // anonymous namespace
116106

117-
void RegisterRequestCallbacks(DAP &dap) {
107+
static void RegisterRequestCallbacks(DAP &dap) {
118108
dap.RegisterRequest<AttachRequestHandler>();
119109
dap.RegisterRequest<BreakpointLocationsRequestHandler>();
120110
dap.RegisterRequest<CompletionsRequestHandler>();
@@ -155,9 +145,7 @@ void RegisterRequestCallbacks(DAP &dap) {
155145
dap.RegisterRequest<TestGetTargetBreakpointsRequestHandler>();
156146
}
157147

158-
} // anonymous namespace
159-
160-
static void printHelp(LLDBDAPOptTable &table, llvm::StringRef tool_name) {
148+
static void PrintHelp(LLDBDAPOptTable &table, llvm::StringRef tool_name) {
161149
std::string usage_str = tool_name.str() + " options";
162150
table.printHelp(llvm::outs(), usage_str.c_str(), "LLDB DAP", false);
163151

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

435423
if (input_args.hasArg(OPT_help)) {
436-
printHelp(T, llvm::sys::path::filename(argv[0]));
424+
PrintHelp(T, llvm::sys::path::filename(argv[0]));
437425
return EXIT_SUCCESS;
438426
}
439427

0 commit comments

Comments
 (0)