[all-commits] [llvm/llvm-project] b091af: [ASTMatchers] Made isExpandedFromMacro Polymorphic

Nathan James via All-commits all-commits at lists.llvm.org
Tue Nov 3 06:37:12 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: b091af790f192c5532b59159fc029f9c368285c0
      https://github.com/llvm/llvm-project/commit/b091af790f192c5532b59159fc029f9c368285c0
  Author: Nathan James <n.james93 at hotmail.co.uk>
  Date:   2020-11-03 (Tue, 03 Nov 2020)

  Changed paths:
    M clang/docs/LibASTMatchersReference.html
    M clang/include/clang/ASTMatchers/ASTMatchers.h
    M clang/lib/ASTMatchers/GtestMatchers.cpp
    M clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp

  Log Message:
  -----------
  [ASTMatchers] Made isExpandedFromMacro Polymorphic

Made the isExpandedFromMacro matcher work on Stmt's, TypeLocs and Decls in line with the other macro expansion matchers.
Also tweaked it to take a `std::string` instead of a `StringRef`.
This prevents potential use-after-free bugs if the matcher is created with a string thats destroyed before the matcher finishes matching.

Reviewed By: aaron.ballman

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




More information about the All-commits mailing list