[all-commits] [llvm/llvm-project] cd6251: Remove clang::ast_type_traits namespace in favor o...

Reid Kleckner via All-commits all-commits at lists.llvm.org
Thu Feb 13 10:47:15 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: cd62511496938e33c061c90796dd23a5288ff843
      https://github.com/llvm/llvm-project/commit/cd62511496938e33c061c90796dd23a5288ff843
  Author: Reid Kleckner <rnk at google.com>
  Date:   2020-02-13 (Thu, 13 Feb 2020)

  Changed paths:
    M clang/docs/LibASTMatchersReference.html
    M clang/include/clang/AST/ASTContext.h
    M clang/include/clang/AST/ASTNodeTraverser.h
    M clang/include/clang/AST/ASTTypeTraits.h
    M clang/include/clang/AST/ParentMapContext.h
    M clang/include/clang/ASTMatchers/ASTMatchFinder.h
    M clang/include/clang/ASTMatchers/ASTMatchers.h
    M clang/include/clang/ASTMatchers/ASTMatchersInternal.h
    M clang/include/clang/ASTMatchers/Dynamic/VariantValue.h
    M clang/include/clang/Tooling/ASTDiff/ASTDiff.h
    M clang/include/clang/Tooling/ASTDiff/ASTDiffInternal.h
    M clang/include/clang/Tooling/Refactoring/ASTSelection.h
    M clang/lib/AST/ASTTypeTraits.cpp
    M clang/lib/AST/ParentMapContext.cpp
    M clang/lib/ASTMatchers/ASTMatchFinder.cpp
    M clang/lib/ASTMatchers/ASTMatchersInternal.cpp
    M clang/lib/ASTMatchers/Dynamic/Marshallers.h
    M clang/lib/ASTMatchers/Dynamic/VariantValue.cpp
    M clang/lib/Tooling/ASTDiff/ASTDiff.cpp
    M clang/lib/Tooling/Refactoring/ASTSelection.cpp
    M clang/lib/Tooling/Refactoring/Rename/USRLocFinder.cpp
    M clang/lib/Tooling/Transformer/RangeSelector.cpp
    M clang/lib/Tooling/Transformer/RewriteRule.cpp
    M clang/lib/Tooling/Transformer/Stencil.cpp
    M clang/unittests/AST/ASTContextParentMapTest.cpp
    M clang/unittests/AST/ASTTraverserTest.cpp
    M clang/unittests/AST/MatchVerifier.h
    M clang/unittests/ASTMatchers/ASTMatchersInternalTest.cpp
    M clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp

  Log Message:
  -----------
  Remove clang::ast_type_traits namespace in favor of clang

DynTypedNode and ASTNodeKind are implemented as part of the clang AST
library, which uses the main clang namespace. There doesn't seem to be a
need for this extra level of namespacing.

I left behind aliases in the ast_type_traits namespace for out of tree
clients of these APIs. To provide aliases for the enumerators, I used
this pattern:
  namespace ast_type_traits {
  constexpr TraversalKind TK_AsIs = ::clang::TK_AsIs;
  }
I think the typedefs will be useful for migration, but we might be able
to drop these enumerator aliases.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D74499




More information about the All-commits mailing list