[Lldb-commits] [lldb] [lldb][Posix] Remove unused includes in file system (PR #121913)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 7 02:47:45 PST 2025


https://github.com/DavidSpickett created https://github.com/llvm/llvm-project/pull/121913

You could remove unistd.h and it builds, but only because something else included it. So I've left it in in the spirit of "include what you use".

Tested on Linux and FreeBSD.

>From 770bad587e02f5aa2851b2c650b1012f4b756188 Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at linaro.org>
Date: Tue, 7 Jan 2025 10:44:58 +0000
Subject: [PATCH] [lldb][Posix] Remove unused includes in file system

You could remove unistd.h and it builds, but only because
something else included it. So I've left it in in the spirit
of "include what you use".
---
 lldb/source/Host/posix/FileSystemPosix.cpp | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/lldb/source/Host/posix/FileSystemPosix.cpp b/lldb/source/Host/posix/FileSystemPosix.cpp
index 945e2affc83715..d2e5b52917ac26 100644
--- a/lldb/source/Host/posix/FileSystemPosix.cpp
+++ b/lldb/source/Host/posix/FileSystemPosix.cpp
@@ -9,12 +9,7 @@
 #include "lldb/Host/FileSystem.h"
 
 // C includes
-#include <dirent.h>
 #include <fcntl.h>
-#include <sys/mount.h>
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <sys/types.h>
 #include <unistd.h>
 #if defined(__NetBSD__)
 #include <sys/statvfs.h>



More information about the lldb-commits mailing list