[PATCH] D65139: [clangd] Support extraction of binary "subexpressions" like a + [[b + c]].

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 23 04:33:12 PDT 2019


sammccall created this revision.
sammccall added a reviewer: SureYeaah.
Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov.
Herald added a project: clang.

These aren't formally subexpressions in C++, in this case + is left-associative.
However informally +, *, etc are usually (mathematically) associative and users
consider these subexpressions.

We detect these and in simple cases support extracting the partial expression.
As well as builtin associative operators, we assume that overloads of them
are associative and support those too.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D65139

Files:
  clang-tools-extra/clangd/Selection.cpp
  clang-tools-extra/clangd/Selection.h
  clang-tools-extra/clangd/refactor/tweaks/ExtractVariable.cpp
  clang-tools-extra/clangd/unittests/SelectionTests.cpp
  clang-tools-extra/clangd/unittests/TweakTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65139.211276.patch
Type: text/x-patch
Size: 14872 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190723/747358de/attachment-0001.bin>


More information about the cfe-commits mailing list