[clang] d03ee70 - [Tooling] Avoid StandardLibrary.h including Decl. NFC

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 25 10:12:53 PDT 2022


Author: Sam McCall
Date: 2022-10-25T19:12:45+02:00
New Revision: d03ee70de156d638ebb820cd6f578c19b14c6d2b

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

LOG: [Tooling] Avoid StandardLibrary.h including Decl. NFC

So you can use the enum in a header without pulling in half the AST.

Added: 
    

Modified: 
    clang/include/clang/Tooling/Inclusions/StandardLibrary.h
    clang/lib/Tooling/Inclusions/Stdlib/StandardLibrary.cpp

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Tooling/Inclusions/StandardLibrary.h b/clang/include/clang/Tooling/Inclusions/StandardLibrary.h
index c6ce2780dae6c..4b5ddbb704e37 100644
--- a/clang/include/clang/Tooling/Inclusions/StandardLibrary.h
+++ b/clang/include/clang/Tooling/Inclusions/StandardLibrary.h
@@ -15,13 +15,16 @@
 #ifndef LLVM_CLANG_TOOLING_INCLUSIONS_STANDARDLIBRARY_H
 #define LLVM_CLANG_TOOLING_INCLUSIONS_STANDARDLIBRARY_H
 
-#include "clang/AST/Decl.h"
+#include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/Optional.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/raw_ostream.h"
 #include <string>
 
 namespace clang {
+class Decl;
+class NamespaceDecl;
+class DeclContext;
 namespace tooling {
 namespace stdlib {
 

diff  --git a/clang/lib/Tooling/Inclusions/Stdlib/StandardLibrary.cpp b/clang/lib/Tooling/Inclusions/Stdlib/StandardLibrary.cpp
index 8fb0c8474e640..f131ab663fc45 100644
--- a/clang/lib/Tooling/Inclusions/Stdlib/StandardLibrary.cpp
+++ b/clang/lib/Tooling/Inclusions/Stdlib/StandardLibrary.cpp
@@ -7,6 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "clang/Tooling/Inclusions/StandardLibrary.h"
+#include "clang/AST/Decl.h"
 #include "llvm/ADT/Optional.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Casting.h"


        


More information about the cfe-commits mailing list