Author: Jonas Devlieghere Date: 2025-02-27T12:42:54-06:00 New Revision: 8f8529c137b1f659595e1064f5c8806eeb628b36
URL: https://github.com/llvm/llvm-project/commit/8f8529c137b1f659595e1064f5c8806eeb628b36 DIFF: https://github.com/llvm/llvm-project/commit/8f8529c137b1f659595e1064f5c8806eeb628b36.diff LOG: [lldb-dap] Gardening in lldb-dap.cpp (NFC) (#128949) - Remove more unused includes - Limit anonymous namespace to llvm::opt - Fix code style Added: Modified: lldb/tools/lldb-dap/lldb-dap.cpp Removed: ################################################################################ diff --git a/lldb/tools/lldb-dap/lldb-dap.cpp b/lldb/tools/lldb-dap/lldb-dap.cpp index e6a28919694bc..6dff960daede9 100644 --- a/lldb/tools/lldb-dap/lldb-dap.cpp +++ b/lldb/tools/lldb-dap/lldb-dap.cpp @@ -1,4 +1,4 @@ -//===-- lldb-dap.cpp -----------------------------------------*- C++ -*-===// +//===-- lldb-dap.cpp ------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -8,10 +8,7 @@ #include "DAP.h" #include "EventHelper.h" -#include "FifoFiles.h" #include "Handler/RequestHandler.h" -#include "JSONUtils.h" -#include "LLDBUtils.h" #include "RunInTerminal.h" #include "lldb/API/SBStream.h" #include "lldb/Host/Config.h" @@ -38,22 +35,15 @@ #include "llvm/Support/Signals.h" #include "llvm/Support/Threading.h" #include "llvm/Support/raw_ostream.h" -#include <algorithm> #include <condition_variable> -#include <cstdint> #include <cstdio> #include <cstdlib> -#include <cstring> #include <fcntl.h> #include <fstream> #include <map> #include <memory> #include <mutex> -#include <optional> -#include <ostream> #include <string> -#include <sys/stat.h> -#include <sys/types.h> #include <thread> #include <utility> #include <vector> @@ -118,8 +108,9 @@ class LLDBDAPOptTable : public llvm::opt::GenericOptTable { : llvm::opt::GenericOptTable(OptionStrTable, OptionPrefixesTable, InfoTable, true) {} }; +} // anonymous namespace -void RegisterRequestCallbacks(DAP &dap) { +static void RegisterRequestCallbacks(DAP &dap) { dap.RegisterRequest<AttachRequestHandler>(); dap.RegisterRequest<BreakpointLocationsRequestHandler>(); dap.RegisterRequest<CompletionsRequestHandler>(); @@ -160,9 +151,7 @@ void RegisterRequestCallbacks(DAP &dap) { dap.RegisterRequest<TestGetTargetBreakpointsRequestHandler>(); } -} // anonymous namespace - -static void printHelp(LLDBDAPOptTable &table, llvm::StringRef tool_name) { +static void PrintHelp(LLDBDAPOptTable &table, llvm::StringRef tool_name) { std::string usage_str = tool_name.str() + " options"; table.printHelp(llvm::outs(), usage_str.c_str(), "LLDB DAP", false); @@ -433,7 +422,7 @@ int main(int argc, char *argv[]) { llvm::opt::InputArgList input_args = T.ParseArgs(ArgsArr, MAI, MAC); if (input_args.hasArg(OPT_help)) { - printHelp(T, llvm::sys::path::filename(argv[0])); + PrintHelp(T, llvm::sys::path::filename(argv[0])); return EXIT_SUCCESS; } _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits