[clang] [Lex] Remove unused includes (NFC) (PR #141523)

via cfe-commits cfe-commits at lists.llvm.org
Mon May 26 13:05:04 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>

These are identified by misc-include-cleaner.  I've filtered out those
that break builds.  Also, I'm staying away from llvm-config.h,
config.h, and Compiler.h, which likely cause platform- or
compiler-specific build failures.


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


3 Files Affected:

- (modified) clang/lib/Lex/HeaderMap.cpp (-1) 
- (modified) clang/lib/Lex/ModuleMap.cpp (-2) 
- (modified) clang/lib/Lex/ModuleMapFile.cpp (-2) 


``````````diff
diff --git a/clang/lib/Lex/HeaderMap.cpp b/clang/lib/Lex/HeaderMap.cpp
index 588b32ee9ca8e..a7b670f00ac6e 100644
--- a/clang/lib/Lex/HeaderMap.cpp
+++ b/clang/lib/Lex/HeaderMap.cpp
@@ -18,7 +18,6 @@
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Support/MemoryBuffer.h"
-#include "llvm/Support/SystemZ/zOSSupport.h"
 #include <cstring>
 #include <memory>
 #include <optional>
diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp
index e899e0cbc6f35..c088e4eecb3fb 100644
--- a/clang/lib/Lex/ModuleMap.cpp
+++ b/clang/lib/Lex/ModuleMap.cpp
@@ -37,9 +37,7 @@
 #include "llvm/Support/Path.h"
 #include "llvm/Support/VirtualFileSystem.h"
 #include "llvm/Support/raw_ostream.h"
-#include <algorithm>
 #include <cassert>
-#include <cstdint>
 #include <cstring>
 #include <optional>
 #include <string>
diff --git a/clang/lib/Lex/ModuleMapFile.cpp b/clang/lib/Lex/ModuleMapFile.cpp
index f457de85243cc..183e919d14c22 100644
--- a/clang/lib/Lex/ModuleMapFile.cpp
+++ b/clang/lib/Lex/ModuleMapFile.cpp
@@ -20,8 +20,6 @@
 #include "clang/Lex/Lexer.h"
 #include "clang/Lex/ModuleMap.h"
 #include "llvm/ADT/STLExtras.h"
-#include "llvm/Support/Error.h"
-#include "llvm/Support/Format.h"
 #include <optional>
 
 using namespace clang;

``````````

</details>


https://github.com/llvm/llvm-project/pull/141523


More information about the cfe-commits mailing list