[Lldb-commits] [PATCH] D75279: Avoid SourceManager.h include in RawCommentList.h, add missing incs

Reid Kleckner via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 27 11:35:27 PST 2020


rnk created this revision.
rnk added reviewers: aaron.ballman, hans.
Herald added a reviewer: teemperor.
Herald added subscribers: lldb-commits, arphaman.
Herald added projects: clang, LLDB.

SourceManager.h includes FileManager.h, which is expensive due to
dependencies on LLVM FS headers.

Remove dead BeforeThanCompare specialization.

Sink ASTContext::addComment to cpp file.

This reduces the time to compile a file that does nothing but include
ASTContext.h from ~3.4s to ~2.8s for me.

Saves these includes:

  219 -    ../clang/include/clang/Basic/SourceManager.h
  204 -    ../clang/include/clang/Basic/FileSystemOptions.h
  204 -    ../clang/include/clang/Basic/FileManager.h
  165 -    ../llvm/include/llvm/Support/VirtualFileSystem.h
  164 -    ../llvm/include/llvm/Support/SourceMgr.h
  164 -    ../llvm/include/llvm/Support/SMLoc.h
  161 -    ../llvm/include/llvm/Support/Path.h
  141 -    ../llvm/include/llvm/ADT/BitVector.h
  128 -    ../llvm/include/llvm/Support/MemoryBuffer.h
  124 -    ../llvm/include/llvm/Support/FileSystem.h
  124 -    ../llvm/include/llvm/Support/Chrono.h
  124 -    .../MSVCSTL/include/stack
  122 -    ../llvm/include/llvm-c/Types.h
  122 -    ../llvm/include/llvm/Support/NativeFormatting.h
  122 -    ../llvm/include/llvm/Support/FormatProviders.h
  122 -    ../llvm/include/llvm/Support/CBindingWrapping.h
  122 -    .../MSVCSTL/include/xtimec.h
  122 -    .../MSVCSTL/include/ratio
  122 -    .../MSVCSTL/include/chrono
  121 -    ../llvm/include/llvm/Support/FormatVariadicDetails.h
  118 -    ../llvm/include/llvm/Support/MD5.h
  109 -    .../MSVCSTL/include/deque
  105 -    ../llvm/include/llvm/Support/Host.h
  105 -    ../llvm/include/llvm/Support/Endian.h


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75279

Files:
  clang-tools-extra/clang-tidy/utils/LexerUtils.cpp
  clang/include/clang/AST/ASTContext.h
  clang/include/clang/AST/ASTDumper.h
  clang/include/clang/AST/RawCommentList.h
  clang/lib/ARCMigrate/TransProtectedScope.cpp
  clang/lib/AST/ASTContext.cpp
  clang/lib/AST/DataCollection.cpp
  clang/lib/AST/ExternalASTSource.cpp
  clang/lib/AST/JSONNodeDumper.cpp
  clang/lib/AST/MicrosoftMangle.cpp
  clang/lib/AST/RawCommentList.cpp
  clang/lib/AST/TextNodeDumper.cpp
  clang/lib/Analysis/CloneDetection.cpp
  clang/lib/CodeGen/CGExpr.cpp
  clang/lib/CodeGen/CGOpenMPRuntime.cpp
  clang/lib/CodeGen/CGStmt.cpp
  clang/lib/CodeGen/SanitizerMetadata.cpp
  clang/lib/Index/CommentToXML.cpp
  clang/lib/Index/FileIndexRecord.cpp
  clang/lib/Sema/DeclSpec.cpp
  clang/lib/Sema/Sema.cpp
  clang/lib/Sema/SemaInit.cpp
  clang/lib/Sema/SemaOverload.cpp
  clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
  clang/lib/Tooling/ASTDiff/ASTDiff.cpp
  clang/lib/Tooling/Core/Lookup.cpp
  clang/lib/Tooling/Refactoring/Rename/USRFinder.cpp
  clang/lib/Tooling/Transformer/SourceCode.cpp
  lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75279.247043.patch
Type: text/x-patch
Size: 15079 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200227/970166dd/attachment-0001.bin>


More information about the lldb-commits mailing list