Skip to content

[lldb-dap] Gardening in lldb-dap.cpp (NFC) #128949

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 27, 2025

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 Mar 10, 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 Mar 20, 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 Apr 2, 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 Apr 17, 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 Apr 30, 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 May 15, 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 May 29, 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