[Tooling] Avoid StandardLibrary.h including Decl. NFC
authorSam McCall <sam.mccall@gmail.com>
Tue, 25 Oct 2022 17:11:51 +0000 (19:11 +0200)
committerSam McCall <sam.mccall@gmail.com>
Tue, 25 Oct 2022 17:12:45 +0000 (19:12 +0200)
So you can use the enum in a header without pulling in half the AST.

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

index c6ce278..4b5ddbb 100644 (file)
 #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 {
 
index 8fb0c84..f131ab6 100644 (file)
@@ -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"