[all-commits] [llvm/llvm-project] 476a49: Add clang_CXXMethod_isCopyAssignmentOperator to li...

Luca Di sera via All-commits all-commits at lists.llvm.org
Wed Oct 26 21:55:37 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 476a497f729a408ba436f75fc50a41254ce65bc8
      https://github.com/llvm/llvm-project/commit/476a497f729a408ba436f75fc50a41254ce65bc8
  Author: Luca Di Sera <disera.luca at gmail.com>
  Date:   2022-10-27 (Thu, 27 Oct 2022)

  Changed paths:
    M clang/bindings/python/clang/cindex.py
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang-c/Index.h
    A clang/test/Index/copy-assignment-operator.cpp
    M clang/test/Index/get-cursor.cpp
    M clang/tools/c-index-test/c-index-test.c
    M clang/tools/libclang/CIndex.cpp
    M clang/tools/libclang/libclang.map

  Log Message:
  -----------
  Add clang_CXXMethod_isCopyAssignmentOperator to libclang

The new method is a wrapper of `CXXMethodDecl::isCopyAssignmentOperator` and
can be used to recognized copy-assignment operators in libclang.

An export for the method, together with its documentation, was added to
"clang/include/clang-c/Index.h" with an implementation provided in
"clang/tools/libclang/CIndex.cpp". The implementation was based on
similar `clang_CXXMethod.*` implementations, following the same
structure but calling `CXXMethodDecl::isCopyAssignmentOperator` for its
main logic.

The new symbol was further added to "clang/tools/libclang/libclang.map"
to be exported, under the LLVM16 tag.

"clang/tools/c-index-test/c-index-test.c" was modified to print a
specific tag, "(copy-assignment operator)", for cursors that are
recognized by `clang_CXXMethod_isCopyAssignmentOperator`.
A new regression test file,
"clang/test/Index/copy-assignment-operator.cpp", was added to ensure
that the correct constructs were recognized or not by the new function.

The "clang/test/Index/get-cursor.cpp" regression test file was updated
as it was affected by the new "(copy-assignment operator)" tag.

A binding for the new function was added to libclang's python's
bindings, in "clang/bindings/python/clang/cindex.py", adding a new
method for `Cursor`, `is_copy_assignment_operator_method`.

The current release note, `clang/docs/ReleaseNotes.rst`, was modified to
report the new addition under the "libclang" section.

Reviewed By: aaron.ballman

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




More information about the All-commits mailing list