Avoid including Module.h from ExternalASTSource.h
authorReid Kleckner <rnk@google.com>
Fri, 28 Feb 2020 02:13:54 +0000 (18:13 -0800)
committerReid Kleckner <rnk@google.com>
Wed, 11 Mar 2020 20:37:41 +0000 (13:37 -0700)
commitc915cb957dc37275ce1ca1a0b993239c82f12692
tree77ffdcc1ea4e7c968624e10ee6b55312a76e13b8
parenta0cacb60549f2346f7addf9205cd32720afc8fb4
Avoid including Module.h from ExternalASTSource.h

Module.h takes 86ms to parse, mostly parsing the class itself. Avoid it
if possible. ASTContext.h depends on ExternalASTSource.h.

A few NFC changes were needed to make this possible:

- Move ASTSourceDescriptor to Module.h. This needs Module to be
  complete, and seems more related to modules and AST files than
  external AST sources.
- Move "import complete" bit from Module* pointer int pair to
  NextLocalImport pointer. Required because PointerIntPair<Module*,...>
  requires Module to be complete, and now it may not be.

Reviewed By: aaron.ballman, hans

Differential Revision: https://reviews.llvm.org/D75784
17 files changed:
clang/include/clang/AST/ASTContext.h
clang/include/clang/AST/Decl.h
clang/include/clang/AST/ExternalASTSource.h
clang/include/clang/Basic/Module.h
clang/include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h
clang/lib/AST/ASTContext.cpp
clang/lib/AST/Decl.cpp
clang/lib/AST/ExternalASTSource.cpp
clang/lib/AST/ItaniumMangle.cpp
clang/lib/AST/TextNodeDumper.cpp
clang/lib/Basic/Module.cpp
clang/lib/CodeGen/CGDebugInfo.cpp
clang/lib/CodeGen/CGDebugInfo.h
clang/lib/Serialization/ASTReader.cpp
clang/lib/Serialization/ASTReaderDecl.cpp
lldb/source/Plugins/ExpressionParser/Clang/ASTUtils.h
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h