Skip to content

Conversation

@JDevlieghere
Copy link
Member

  • Remove more unused includes
  • Limit anonymous namespace to llvm::opt
  • Fix code style

 - Remove more unused includes
 - Limit anonymous namespace to llvm::opt
 - Fix code style
@llvmbot
Copy link
Member

llvmbot commented Feb 26, 2025

@llvm/pr-subscribers-lldb

Author: Jonas Devlieghere (JDevlieghere)

Changes
  • Remove more unused includes
  • Limit anonymous namespace to llvm::opt
  • Fix code style

Full diff: https://github.com/llvm/llvm-project/pull/128949.diff

1 Files Affected:

  • (modified) lldb/tools/lldb-dap/lldb-dap.cpp (+5-17)
diff --git a/lldb/tools/lldb-dap/lldb-dap.cpp b/lldb/tools/lldb-dap/lldb-dap.cpp
index 1c6bd7e903409..d4ebd6430d0aa 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"
@@ -23,7 +20,6 @@
 #include "lldb/lldb-forward.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/ScopeExit.h"
-#include "llvm/ADT/StringExtras.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Option/Arg.h"
 #include "llvm/Option/ArgList.h"
@@ -37,22 +33,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>
@@ -113,8 +102,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>();
@@ -155,9 +145,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 +421,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;
   }
 

@JDevlieghere JDevlieghere merged commit 8f8529c into llvm:main Feb 27, 2025
10 checks passed
@JDevlieghere JDevlieghere deleted the lldb-dap-gardening branch February 27, 2025 18:42
SquallATF pushed a commit to SquallATF/llvm-project that referenced this pull request Jun 13, 2025
 - Remove more unused includes
 - Limit anonymous namespace to llvm::opt
 - Fix code style
SquallATF pushed a commit to SquallATF/llvm-project that referenced this pull request Jul 14, 2025
 - Remove more unused includes
 - Limit anonymous namespace to llvm::opt
 - Fix code style
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants