[clang] 01138d3 - [AST] Remove unused includes (NFC) (#141417)

via cfe-commits cfe-commits at lists.llvm.org
Sun May 25 10:55:28 PDT 2025


Author: Kazu Hirata
Date: 2025-05-25T10:55:25-07:00
New Revision: 01138d3f6518c08fe14a527c21c54aefef0e6f57

URL: https://github.com/llvm/llvm-project/commit/01138d3f6518c08fe14a527c21c54aefef0e6f57
DIFF: https://github.com/llvm/llvm-project/commit/01138d3f6518c08fe14a527c21c54aefef0e6f57.diff

LOG: [AST] Remove unused includes (NFC) (#141417)

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.

Added: 
    

Modified: 
    clang/lib/AST/ByteCode/Disasm.cpp
    clang/lib/AST/ByteCode/Function.cpp
    clang/lib/AST/CXXInheritance.cpp
    clang/lib/AST/DeclTemplate.cpp
    clang/lib/AST/JSONNodeDumper.cpp
    clang/lib/AST/StmtPrinter.cpp
    clang/lib/AST/TemplateBase.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/ByteCode/Disasm.cpp b/clang/lib/AST/ByteCode/Disasm.cpp
index 46c5cb96fa9f4..846dc2fe92a70 100644
--- a/clang/lib/AST/ByteCode/Disasm.cpp
+++ b/clang/lib/AST/ByteCode/Disasm.cpp
@@ -28,7 +28,6 @@
 #include "clang/AST/DeclCXX.h"
 #include "clang/AST/ExprCXX.h"
 #include "llvm/Support/Compiler.h"
-#include "llvm/Support/Format.h"
 
 using namespace clang;
 using namespace clang::interp;

diff  --git a/clang/lib/AST/ByteCode/Function.cpp b/clang/lib/AST/ByteCode/Function.cpp
index d3e7e1ffc63d5..e421dad062817 100644
--- a/clang/lib/AST/ByteCode/Function.cpp
+++ b/clang/lib/AST/ByteCode/Function.cpp
@@ -10,7 +10,6 @@
 #include "Program.h"
 #include "clang/AST/Decl.h"
 #include "clang/AST/DeclCXX.h"
-#include "clang/Basic/Builtins.h"
 
 using namespace clang;
 using namespace clang::interp;

diff  --git a/clang/lib/AST/CXXInheritance.cpp b/clang/lib/AST/CXXInheritance.cpp
index ab862d57eae89..f0376168e43a2 100644
--- a/clang/lib/AST/CXXInheritance.cpp
+++ b/clang/lib/AST/CXXInheritance.cpp
@@ -27,7 +27,6 @@
 #include <algorithm>
 #include <cassert>
 #include <utility>
-#include <vector>
 
 using namespace clang;
 

diff  --git a/clang/lib/AST/DeclTemplate.cpp b/clang/lib/AST/DeclTemplate.cpp
index 0f4ae368ae90d..e1ef2188dbdbe 100644
--- a/clang/lib/AST/DeclTemplate.cpp
+++ b/clang/lib/AST/DeclTemplate.cpp
@@ -33,7 +33,6 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <cassert>
-#include <memory>
 #include <optional>
 #include <utility>
 

diff  --git a/clang/lib/AST/JSONNodeDumper.cpp b/clang/lib/AST/JSONNodeDumper.cpp
index 3c5e8d3de24d8..64ddb1e739347 100644
--- a/clang/lib/AST/JSONNodeDumper.cpp
+++ b/clang/lib/AST/JSONNodeDumper.cpp
@@ -4,7 +4,6 @@
 #include "clang/Basic/Specifiers.h"
 #include "clang/Lex/Lexer.h"
 #include "llvm/ADT/StringExtras.h"
-#include <optional>
 
 using namespace clang;
 

diff  --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp
index dc8af1586624b..13c3bc0387890 100644
--- a/clang/lib/AST/StmtPrinter.cpp
+++ b/clang/lib/AST/StmtPrinter.cpp
@@ -50,7 +50,6 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/ADT/StringRef.h"
-#include "llvm/Support/Casting.h"
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/raw_ostream.h"

diff  --git a/clang/lib/AST/TemplateBase.cpp b/clang/lib/AST/TemplateBase.cpp
index 17a4462dd5188..8ecd3c7aaca0d 100644
--- a/clang/lib/AST/TemplateBase.cpp
+++ b/clang/lib/AST/TemplateBase.cpp
@@ -37,7 +37,6 @@
 #include <cstddef>
 #include <cstdint>
 #include <cstring>
-#include <optional>
 
 using namespace clang;
 


        


More information about the cfe-commits mailing list