[all-commits] [llvm/llvm-project] c915cb: Avoid including Module.h from ExternalASTSource.h

Reid Kleckner via All-commits all-commits at lists.llvm.org
Wed Mar 11 13:37:45 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c915cb957dc37275ce1ca1a0b993239c82f12692
      https://github.com/llvm/llvm-project/commit/c915cb957dc37275ce1ca1a0b993239c82f12692
  Author: Reid Kleckner <rnk at google.com>
  Date:   2020-03-11 (Wed, 11 Mar 2020)

  Changed paths:
    M clang/include/clang/AST/ASTContext.h
    M clang/include/clang/AST/Decl.h
    M clang/include/clang/AST/ExternalASTSource.h
    M clang/include/clang/Basic/Module.h
    M clang/include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/AST/Decl.cpp
    M clang/lib/AST/ExternalASTSource.cpp
    M clang/lib/AST/ItaniumMangle.cpp
    M clang/lib/AST/TextNodeDumper.cpp
    M clang/lib/Basic/Module.cpp
    M clang/lib/CodeGen/CGDebugInfo.cpp
    M clang/lib/CodeGen/CGDebugInfo.h
    M clang/lib/Serialization/ASTReader.cpp
    M clang/lib/Serialization/ASTReaderDecl.cpp
    M lldb/source/Plugins/ExpressionParser/Clang/ASTUtils.h
    M lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h

  Log Message:
  -----------
  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




More information about the All-commits mailing list