[all-commits] [llvm/llvm-project] 1844ab: [ASTImporter] Add support for importing GenericSel...

Tom Roeder via All-commits all-commits at lists.llvm.org
Wed Dec 16 15:41:18 PST 2020


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1844ab770cb9380a1896d83b1863b93766ffdf22
      https://github.com/llvm/llvm-project/commit/1844ab770cb9380a1896d83b1863b93766ffdf22
  Author: Tom Roeder <tmroeder at google.com>
  Date:   2020-12-16 (Wed, 16 Dec 2020)

  Changed paths:
    M clang/docs/LibASTMatchersReference.html
    M clang/include/clang/ASTMatchers/ASTMatchers.h
    M clang/lib/AST/ASTImporter.cpp
    M clang/lib/AST/ASTStructuralEquivalence.cpp
    M clang/lib/ASTMatchers/ASTMatchersInternal.cpp
    M clang/lib/ASTMatchers/Dynamic/Registry.cpp
    M clang/lib/Analysis/ExprMutationAnalyzer.cpp
    A clang/test/ASTMerge/generic-selection-expr/Inputs/generic.c
    A clang/test/ASTMerge/generic-selection-expr/Inputs/generic.cpp
    A clang/test/ASTMerge/generic-selection-expr/test.c
    A clang/test/ASTMerge/generic-selection-expr/test.cpp
    M clang/unittests/AST/ASTImporterTest.cpp
    M clang/unittests/AST/StructuralEquivalenceTest.cpp
    M clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp

  Log Message:
  -----------
  [ASTImporter] Add support for importing GenericSelectionExpr AST nodes.

This allows ASTs to be merged when they contain GenericSelectionExpr
nodes (this is _Generic from C11). This is needed, for example, for
CTU analysis of C code that makes use of _Generic, like the Linux
kernel.

The node is already supported in the AST, but it didn't have a matcher
in ASTMatchers. So, this change adds the matcher and adds support to
ASTImporter. Additionally, this change adds support for structural
equivalence of _Generic in the AST.

Reviewed By: martong, aaron.ballman

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




More information about the All-commits mailing list