[all-commits] [llvm/llvm-project] b36c19: [AST] Remove DeclCXX.h dep on ASTContext.h

Reid Kleckner via All-commits all-commits at lists.llvm.org
Mon Apr 6 10:12:27 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: b36c19bc4f2110a8e33f8d93751ef28b6dcd0292
      https://github.com/llvm/llvm-project/commit/b36c19bc4f2110a8e33f8d93751ef28b6dcd0292
  Author: Reid Kleckner <rnk at google.com>
  Date:   2020-04-06 (Mon, 06 Apr 2020)

  Changed paths:
    M clang/include/clang/AST/DeclBase.h
    M clang/include/clang/AST/DeclCXX.h
    M clang/include/clang/AST/GlobalDecl.h
    M clang/include/clang/Serialization/ASTRecordReader.h
    M clang/lib/AST/CommentSema.cpp
    M clang/lib/AST/ComparisonCategories.cpp
    M clang/lib/AST/DeclBase.cpp
    M clang/lib/Analysis/PathDiagnostic.cpp
    M clang/lib/Analysis/ProgramPoint.cpp
    M clang/lib/CodeGen/CGDebugInfo.h
    M clang/lib/Tooling/Core/Lookup.cpp

  Log Message:
  -----------
  [AST] Remove DeclCXX.h dep on ASTContext.h

Saves only 36 includes of ASTContext.h and related headers.

There are two deps on ASTContext.h:
- C++ method overrides iterator types (TinyPtrVector)
- getting LangOptions

For #1, duplicate the iterator type, which is
TinyPtrVector<>::const_iterator.

For #2, add an out-of-line accessor to get the language options. Getting
the ASTContext from a Decl is already an out of line method that loops
over the parent DeclContexts, so if it is ever performance critical, the
proper fix is to pass the context (or LangOpts) into the predicate in
question.

Other changes are just header fixups.




More information about the All-commits mailing list