[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: aaron.ballman, JonasToth, ioeric. Herald added subscribers: cfe-commits, xazax.hun, mgorny. Adds a new check readability-const-value-return, which checks for functions with a ``const``-qualified return type and recommends removal of the `cons

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 168856. ymandel added a comment. Minor changes addressing comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53025 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/ConstValueReturnCheck.cpp clang-tidy/readabil

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 168857. ymandel marked 2 inline comments as done. ymandel added a comment. Dropped unneeded clang qualifier. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53025 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/ConstV

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 168858. ymandel added a comment. Add missing const. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53025 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/ConstValueReturnCheck.cpp clang-tidy/readability/ConstValueRe

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 3 inline comments as done. ymandel added a comment. Thanks for the review. I've addressed the comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53025 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[PATCH] D52971: [clang-tidy] Customize FileCheck prefix in check_clang-tidy.py to support multiple prefixes

2018-10-11 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Hi, It looks like this change has disabled FileCheck for all clang-tidy lit tests that don't use check-prefixes. So, they all trivially pass even if their CHECK... lines are wrong. An easy repro is just to randomly modify any CHECK line in a lit file (e.g. llvm/tool

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-11 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 169277. ymandel added a comment. Adusted code in respone to comments. Major differences are: - more warning in situations where a FixIt can't be suggested. - more tests. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53025 Files: clang-

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-11 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 169280. ymandel added a comment. comment tweak Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53025 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/ConstValueReturnCheck.cpp clang-tidy/readability/ConstValueReturnC

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-11 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 169282. ymandel added a comment. Spacing fix. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53025 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/ConstValueReturnCheck.cpp clang-tidy/readability/ConstValueReturnCh

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-11 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 169290. ymandel marked 11 inline comments as done. ymandel added a comment. Comment fix. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53025 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/ConstValueReturnCheck.cpp

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-11 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Thank you for the detailed comments! They were quite helpful, especially as this is my first llvm/clang review. Comment at: clang-tidy/readability/ConstValueReturnCheck.cpp:25 + +// Finds the location of the relevant "const" token in `Def`. +llvm::Opt

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-12 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 169461. ymandel marked 3 inline comments as done. ymandel added a comment. Adjusted reporting of warnings. Also, addressed other comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53025 Files: clang-tidy/readability/CMakeLists.txt

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-12 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang-tidy/readability/ConstValueReturnCheck.cpp:25 + +// Finds the location of the relevant "const" token in `Def`. +llvm::Optional findConstToRemove( JonasToth wrote: > ymandel wrote: > > JonasToth wrote: > > > s/"cons

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-12 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 5 inline comments as done. ymandel added inline comments. Comment at: clang-tidy/readability/ConstValueReturnCheck.cpp:60 +diag(Def->getInnerLocStart(), + "return type is 'const'-qualifed (possibly behind a type alias), " + "which hinders compil

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-12 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang-tidy/readability/ConstValueReturnCheck.cpp:64 + + // Fix the definition. + llvm::Optional Loc = findConstToRemove(Def, Result); JonasToth wrote: > ymandel wrote: > > JonasToth wrote: > > > I feel that this commen

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang-tidy/readability/ConstValueReturnCheck.cpp:64 + + // Fix the definition. + llvm::Optional Loc = findConstToRemove(Def, Result); JonasToth wrote: > ymandel wrote: > > JonasToth wrote: > > > ymandel wrote: > > > >

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 169938. ymandel marked 5 inline comments as done. ymandel added a comment. Refactors generation of clang-tidy fixits and notes. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53025 Files: clang-tidy/readability/CMakeLists.txt clang-tidy

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 169941. ymandel added a comment. Changed check result into struct (was pair). Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53025 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/ConstValueReturnCheck.cpp clang-tid

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang-tidy/readability/ConstValueReturnCheck.cpp:93 +Diagnostics << FixItHint::CreateRemoval( +CharSourceRange::getTokenRange(*PrevLoc, *PrevLoc)); + } else { JonasToth wrote: > ymandel wrote: >

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 170418. ymandel added a comment. Expanded test cases. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53025 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/ConstValueReturnCheck.cpp clang-tidy/readability/ConstValue

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked an inline comment as done. ymandel added inline comments. Comment at: test/clang-tidy/readability-const-value-return.cpp:174 +int **const * n_multiple_ptr(); +int *const & n_pointer_ref(); aaron.ballman wrote: > I'd like to see some more complex ex

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 170423. ymandel marked an inline comment as done. ymandel added a comment. Fix some message comments in tests. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53025 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/Cons

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Correction: the code *catches* the trailing return cases, I just couldn't find a way to *fix* them; specifically, I was not able to get the necessary source ranges to re-lex the trailing return type. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53025

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 171103. ymandel added a comment. Fix bug in const-token finding and add tests. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53025 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/ConstValueReturnCheck.cpp clang-ti

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 171105. ymandel added a comment. Formatting & comment tweaks. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53025 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/ConstValueReturnCheck.cpp clang-tidy/readability/Co

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In https://reviews.llvm.org/D53025#1271367, @JonasToth wrote: > In https://reviews.llvm.org/D53025#1270784, @ymandel wrote: > > > Correction: the code *catches* the trailing return cases, I just couldn't > > find a way to *fix* them; specifically, I was not able to get t

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-26 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Thanks! What's the next step in the process? Does someone need to approve this change? Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53025 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://li

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-26 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 171293. ymandel marked 4 inline comments as done. ymandel added a comment. Reword comment on the check, for clarity. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53025 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readabilit

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-26 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang-tidy/readability/ConstValueReturnCheck.cpp:107 +diag(Def->getInnerLocStart(), "return type %0 is 'const'-qualified " + "hindering compiler optimizations") +<< Def->getReturnType(

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-26 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 2 inline comments as done. ymandel added inline comments. Comment at: clang-tidy/readability/ConstValueReturnCheck.cpp:107 +diag(Def->getInnerLocStart(), "return type %0 is 'const'-qualified " + "hindering compiler optim

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 2 inline comments as done. ymandel added inline comments. Comment at: clang-tidy/readability/ConstValueReturnCheck.cpp:107 +diag(Def->getInnerLocStart(), "return type %0 is 'const'-qualified " + "hindering compiler optim

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 171700. ymandel added a comment. Reworded diagnostic message and corresponding documentation. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53025 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/ConstValueReturnCheck

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 3 inline comments as done. ymandel added inline comments. Comment at: clang-tidy/readability/ConstValueReturnCheck.cpp:107 +diag(Def->getInnerLocStart(), "return type %0 is 'const'-qualified " + "hindering compiler optim

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 171764. ymandel marked an inline comment as done. ymandel added a comment. Modify dialog printing to highlight const token. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53025 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/rea

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 171765. ymandel marked 2 inline comments as done. ymandel added a comment. Add comment to field. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53025 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/ConstValueReturnCh

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang-tidy/readability/ConstValueReturnCheck.cpp:107 +diag(Def->getInnerLocStart(), "return type %0 is 'const'-qualified " + "hindering compiler optimizations") +<< Def->getReturnType(

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-31 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 171897. ymandel marked 2 inline comments as done. ymandel added a comment. Small tweaks in response to comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53025 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/Co

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-31 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In https://reviews.llvm.org/D53025#1281097, @aaron.ballman wrote: > I think this is getting really close! One question: would it make more sense > to name this `readability-const-type-return` or > `readability-const-return-type` instead? It's not that the functions retu

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-31 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 171900. ymandel added a comment. Rename readability-const-value-return to readability-const-return-type Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53025 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/ConstReturn

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-31 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. I've renamed the check. I noticed that the script did not rename the header guard macro, though. Please let me know if/where to file a bug. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53025 ___ cfe-comm

[PATCH] D56786: Changes to `CXXMemberExpr` matchers.

2019-01-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. Herald added a subscriber: cfe-commits. Assorted changes to matchers for `CXXMemberExpr`: - fixes the comments on `hasObjectExpression`, - clarifies comments on `thisPointerType` and `on`, - adds comments to `onImplicitObjectArgument` - adds new matcher `invokedAtTy

[PATCH] D56786: Changes to `CXXMemberExpr` matchers.

2019-01-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D56786#1359879 , @steveire wrote: > Can you break this up into multiple commits? Sure, but any suggestions on granularity? E.g. i can split into two: the fixes/clarifications in one and the new matcher in another; or i could

[PATCH] D56786: [ASTMatchers] Changes to `CXXMemberExpr` matchers.

2019-01-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 2 inline comments as done. ymandel added a comment. In D56786#1359920 , @lebedev.ri wrote: > In D56786#1359903 , @ymandel wrote: > > > In D56786#1359879 , @ste

[PATCH] D56786: [ASTMatchers] Changes to `CXXMemberExpr` matchers.

2019-01-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D56786#1360706 , @steveire wrote: > It seems that you update docs for existing matchers without changing those > matchers. You could put all of that in one patch. > > Then, you seem to add some tests for existing matches. You c

[PATCH] D56850: [ASTMatchers][NFC] Add tests for assorted `CXXMemberCallExpr` matchers.

2019-01-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D56850#1361436 , @lebedev.ri wrote: > Please always subscribe lists. > The reviews that happen without lists are null and void. Thanks for updating my diffs with the relevant list. Noted for next time. > Is this testing pre-

[PATCH] D56850: [ASTMatchers][NFC] Add tests for assorted `CXXMemberCallExpr` matchers.

2019-01-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 182295. ymandel added a comment. Extended test for matcher `on`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56850/new/ https://reviews.llvm.org/D56850 Files: clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp Index: clang/unittests/ASTM

[PATCH] D56850: [ASTMatchers][NFC] Add tests for assorted `CXXMemberCallExpr` matchers.

2019-01-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 2 inline comments as done. ymandel added inline comments. Comment at: clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp:475 + auto MatchesType = cxxMemberCallExpr(on(hasType(cxxRecordDecl(hasName("X"); + EXPECT_TRUE(matches( + R"cc( -

[PATCH] D56849: [ASTMatchers][NFC] Update comments on assorted `CXXMemberCallExpr` matchers.

2019-01-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 182299. ymandel added a comment. Respond to comments; fix mistake (revealed by test). CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56849/new/ https://reviews.llvm.org/D56849 Files: clang/docs/LibASTMatchersReference.html clang/include/clang/AS

[PATCH] D56849: [ASTMatchers][NFC] Update comments on assorted `CXXMemberCallExpr` matchers.

2019-01-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 182301. ymandel marked 2 inline comments as done. ymandel added a comment. Update HTML docs. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56849/new/ https://reviews.llvm.org/D56849 Files: clang/docs/LibASTMatchersReference.html clang/include/c

[PATCH] D56849: [ASTMatchers][NFC] Update comments on assorted `CXXMemberCallExpr` matchers.

2019-01-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 4 inline comments as done. ymandel added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:2905 +/// cxxMemberCallExpr(on(callExpr())) +/// matches `(g()).m()` /// aaron.ballman wrote: > Missing a full stop. also fixed m

[PATCH] D56933: [Tooling][RFC] Introduce Stencil library to simplify source code generation in refactorings.

2019-01-18 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. Herald added subscribers: cfe-commits, jfb. REQUEST FOR COMMENT: this is not intended (yet) as a proper revision. It complements the design document for Transformer: https://docs.google.com/document/d/1ppw0RhjwsrbBcHYhI85pe6ISDbA6r5d00ot3N8cQWeQ/edit?usp=sharing Th

[PATCH] D56849: [ASTMatchers][NFC] Update comments on assorted `CXXMemberCallExpr` matchers.

2019-01-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 182918. ymandel marked an inline comment as done. ymandel added a comment. Use backticks instead of quotes for quoted code. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56849/new/ https://reviews.llvm.org/D56849 Files: clang/docs/LibASTMatchersR

[PATCH] D56850: [ASTMatchers][NFC] Add tests for assorted `CXXMemberCallExpr` matchers.

2019-01-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 182919. ymandel marked an inline comment as done. ymandel added a comment. Remove unnecessary expectation. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56850/new/ https://reviews.llvm.org/D56850 Files: clang/unittests/ASTMatchers/ASTMatchersTrav

[PATCH] D56850: [ASTMatchers][NFC] Add tests for assorted `CXXMemberCallExpr` matchers.

2019-01-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 182933. ymandel marked 3 inline comments as done. ymandel added a comment. Extended test of `hasObjectExpression`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56850/new/ https://reviews.llvm.org/D56850 Files: clang/unittests/ASTMatchers/ASTMatc

[PATCH] D56850: [ASTMatchers][NFC] Add tests for assorted `CXXMemberCallExpr` matchers.

2019-01-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp:558 + int m; + int f(X x) { return m; } +}; steveire wrote: > Are we missing a matcher that would reach the type of X in this case? > `h

[PATCH] D56851: [ASTMatchers] Adds `CXXMemberCallExpr` matcher `invokedAtType`.

2019-01-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 2 inline comments as done. ymandel added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:3300 +/// matches `x.m()` and `p->m()`. +AST_MATCHER_P_OVERLOAD(clang::CXXMemberCallExpr, invokedAtType, + clang::ast_matcher

[PATCH] D56851: [ASTMatchers] Adds `CXXMemberCallExpr` matcher `invokedAtType`.

2019-01-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 183582. ymandel added a comment. Remove unneeded qualifiers and clarify constrast with `thisPointerType`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56851/new/ https://reviews.llvm.org/D56851 Files: clang/docs/LibASTMatchersReference.html cl

[PATCH] D56851: [ASTMatchers] Adds `CXXMemberCallExpr` matcher `invokedAtType`.

2019-01-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 3 inline comments as done. ymandel added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:3300 +/// matches `x.m()` and `p->m()`. +AST_MATCHER_P_OVERLOAD(clang::CXXMemberCallExpr, invokedAtType, + clang::ast_matcher

[PATCH] D56851: [ASTMatchers] Adds `CXXMemberCallExpr` matcher `invokedAtType`.

2019-01-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 183591. ymandel added a comment. Contrast to thisPointerType with explicit examples. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56851/new/ https://reviews.llvm.org/D56851 Files: clang/docs/LibASTMatchersReference.html clang/include/clang/AST

[PATCH] D56851: [ASTMatchers] Adds `CXXMemberCallExpr` matcher `invokedAtType`.

2019-01-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 3 inline comments as done. ymandel added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:3300 +/// matches `x.m()` and `p->m()`. +AST_MATCHER_P_OVERLOAD(clang::CXXMemberCallExpr, invokedAtType, + clang::ast_matcher

[PATCH] D56851: [ASTMatchers] Adds `CXXMemberCallExpr` matcher `invokedAtType`.

2019-01-28 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 2 inline comments as done. ymandel added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:3300 +/// matches `x.m()` and `p->m()`. +AST_MATCHER_P_OVERLOAD(clang::CXXMemberCallExpr, invokedAtType, + clang::ast_matcher

[PATCH] D56851: [ASTMatchers] Adds `CXXMemberCallExpr` matcher `invokedAtType`.

2019-01-28 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 2 inline comments as done. ymandel added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:3300 +/// matches `x.m()` and `p->m()`. +AST_MATCHER_P_OVERLOAD(clang::CXXMemberCallExpr, invokedAtType, + clang::ast_matcher

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-31 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 4 inline comments as done. ymandel added a comment. Aaron, Jonas, Thank you both so much for being fantastic reviewers! This was my first experience contributing to clang (upstream) and it has been extremely positive. In https://reviews.llvm.org/D53025#1282194, @aaron.ballman wr

[PATCH] D53025: [clang-tidy] implement new check for const return types.

2018-10-31 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 171985. ymandel marked an inline comment as done. ymandel added a comment. Rebased patch onto trunk. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53025 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/ConstReturnTyp

[PATCH] D58556: [LibTooling] Add "smart" retrieval of AST-node source to FixIt library

2019-02-26 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 4 inline comments as done. ymandel added inline comments. Comment at: clang/include/clang/Tooling/FixIt.h:60 +// future to include more associated text (like comments). +CharSourceRange getSourceRangeAuto(const Stmt &S, ASTContext &Context); + ilya

[PATCH] D58556: [LibTooling] Add "smart" retrieval of AST-node source to FixIt library

2019-03-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 5 inline comments as done. ymandel added inline comments. Comment at: clang/include/clang/Tooling/FixIt.h:73 +// context. In contrast with \p getText(), this function selects a source range +// "automatically", extracting text that a reader might intuitively associ

[PATCH] D58556: [LibTooling] Add "smart" retrieval of AST-node source to FixIt library

2019-03-10 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 190037. ymandel marked an inline comment as done. ymandel edited the summary of this revision. ymandel added a comment. This update significantly simplifies the change. It removes any "smarts", instead allowing the user to request the extension of the source

[PATCH] D58556: [LibTooling] Add "smart" retrieval of AST-node source to FixIt library

2019-03-10 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 7 inline comments as done. ymandel added inline comments. Comment at: clang/include/clang/Tooling/FixIt.h:73 +// context. In contrast with \p getText(), this function selects a source range +// "automatically", extracting text that a reader might intuitively associ

[PATCH] D56851: [ASTMatchers] Adds `CXXMemberCallExpr` matcher `invokedAtType`.

2019-03-10 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 190038. ymandel added a comment. Herald added a project: clang. Removed unneeded includes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56851/new/ https://reviews.llvm.org/D56851 Files: clang/include/clang/

[PATCH] D58556: [LibTooling] Add "smart" retrieval of AST-node source to FixIt library

2019-03-10 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 190039. ymandel marked an inline comment as done. ymandel edited the summary of this revision. ymandel added a comment. Remove unneeded includes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58556/new/ https:/

[PATCH] D58556: [LibTooling] Add retrieval of extended AST-node source to FixIt library

2019-03-13 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL356095: [LibTooling] Add retrieval of extended AST-node source to FixIt library (authored by ymandel, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior t

[PATCH] D59329: [LibTooling] Add NodeId, a strong type for AST-matcher node identifiers.

2019-03-13 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: ilya-biryukov. ymandel added a project: clang. Herald added subscribers: jfb, mgorny. The standard matcher API uses StringRefs to identify bound nodes. This patch introduces a strong type thats allows distinguishing ids from arbitrary text

[PATCH] D59371: [LibTooling] Add Stencil library for format-string style codegen.

2019-03-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: ilya-biryukov. ymandel added a project: clang. Herald added subscribers: jdoerfert, jfb, mgorny. This file defines the *Stencil* abstraction: a code-generating object, parameterized by named references to (bound) AST nodes. Given a match r

[PATCH] D59329: [LibTooling] Add NodeId, a strong type for AST-matcher node identifiers.

2019-03-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 190675. ymandel added a comment. Herald added a subscriber: jdoerfert. Build-related fixes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59329/new/ https://reviews.llvm.org/D59329 Files: clang/include/clang

[PATCH] D59329: [LibTooling] Add NodeId, a strong type for AST-matcher node identifiers.

2019-03-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 190679. ymandel added a comment. "Revert" to original diff. This undoes the previous diff, which associated with the wrong revision. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59329/new/ https://reviews.ll

[PATCH] D59371: [LibTooling] Add Stencil library for format-string style codegen.

2019-03-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 190683. ymandel added a comment. Build fixes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59371/new/ https://reviews.llvm.org/D59371 Files: clang/include/clang/Tooling/Refactoring/Stencil.h clang/lib/Too

[PATCH] D59376: [LibTooling] Add Transformer, a library for source-to-source transformations.

2019-03-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: ilya-biryukov. Herald added subscribers: cfe-commits, jdoerfert, jfb, mgorny. Herald added a project: clang. ymandel added a parent revision: D59329: [LibTooling] Add NodeId, a strong type for AST-matcher node identifiers.. Adds a basic ver

[PATCH] D59376: [LibTooling] Add Transformer, a library for source-to-source transformations.

2019-03-19 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 4 inline comments as done. ymandel added inline comments. Comment at: clang/include/clang/Tooling/Refactoring/Transformer.h:54 +/// boolean expression language for constructing filters. +class MatchFilter { +public: ilya-biryukov wrote: > Intuitive

[PATCH] D59376: [LibTooling] Add Transformer, a library for source-to-source transformations.

2019-03-20 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 4 inline comments as done. ymandel added inline comments. Comment at: clang/include/clang/Tooling/Refactoring/Transformer.h:135 +// \endcode +class RewriteRule { +public: ilya-biryukov wrote: > ymandel wrote: > > ilya-biryukov wrote: > > > Maybe co

[PATCH] D59376: [LibTooling] Add Transformer, a library for source-to-source transformations.

2019-03-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked an inline comment as done. ymandel added a comment. Working on the new version now. Will note with "PTAL" once that's ready. Sorry that wasn't clear in earlier responses. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59376/new/ http

[PATCH] D59376: [LibTooling] Add Transformer, a library for source-to-source transformations.

2019-03-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 192172. ymandel marked an inline comment as done. ymandel added a comment. Split RewriteRule into two classes, remove support for where clause, support multi-token targets, and add corresponding tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LA

[PATCH] D59376: [LibTooling] Add Transformer, a library for source-to-source transformations.

2019-03-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 10 inline comments as done. ymandel added a comment. Addressed the most major comments. Still working on some smaller ones. PTAL. Thanks! Comment at: clang/include/clang/Tooling/Refactoring/Transformer.h:54 +/// boolean expression language for constructing filt

[PATCH] D59329: [LibTooling] Add NodeId, a strong type for AST-matcher node identifiers.

2019-03-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. gentle ping... Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59329/new/ https://reviews.llvm.org/D59329 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.ll

[PATCH] D59371: [LibTooling] Add Stencil library for format-string style codegen.

2019-03-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. gentle ping... Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59371/new/ https://reviews.llvm.org/D59371 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.ll

[PATCH] D59376: [LibTooling] Add Transformer, a library for source-to-source transformations.

2019-03-26 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 192267. ymandel marked 5 inline comments as done. ymandel added a comment. - Remove lvalue-ref overloads in builder - add StringRef overloads for TextGenerator-taking methods - constrain Name targeting for ctor initializers to explicitly written initializers.

[PATCH] D59376: [LibTooling] Add Transformer, a library for source-to-source transformations.

2019-03-26 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked an inline comment as done. ymandel added inline comments. Comment at: clang/include/clang/Tooling/Refactoring/Transformer.h:89 + /// relevant name, not including qualifiers. + Name, +}; ilya-biryukov wrote: > ymandel wrote: > > ilya-biryukov wrot

[PATCH] D59376: [LibTooling] Add Transformer, a library for source-to-source transformations.

2019-03-28 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 192619. ymandel marked 2 inline comments as done. ymandel added a comment. Simplified TextGenerator, changed namespace handling, collapsed verifyTarget() into getTarget(), and other changes in response to comments. Repository: rG LLVM Github Monorepo CHA

[PATCH] D59376: [LibTooling] Add Transformer, a library for source-to-source transformations.

2019-03-28 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 192623. ymandel marked 26 inline comments as done. ymandel added a comment. Adjusted test to cover case discussed in comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59376/new/ https://reviews.llvm.org/D

[PATCH] D59376: [LibTooling] Add Transformer, a library for source-to-source transformations.

2019-03-28 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Thanks for the detailed review and really helpful comments! Comment at: clang/include/clang/Tooling/Refactoring/Transformer.h:38 +/// @{ +using ast_matchers::CXXCtorInitializerMatcher; +using ast_matchers::DeclarationMatcher; ilya-biryu

[PATCH] D59376: [LibTooling] Add Transformer, a library for source-to-source transformations.

2019-03-29 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 192889. ymandel marked an inline comment as done. ymandel added a comment. - Assorted changes in response to comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59376/new/ https://reviews.llvm.org/D59376 F

[PATCH] D59376: [LibTooling] Add Transformer, a library for source-to-source transformations.

2019-03-29 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 19 inline comments as done. ymandel added a comment. Thanks for (more) helpful comments. I think the code is a lot better now than it started out. :) Also, converted `RewriteRule` to a simple struct as per our discussion. Comment at: clang/include/clang/Toolin

[PATCH] D59376: [LibTooling] Add Transformer, a library for source-to-source transformations.

2019-04-01 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 193219. ymandel marked 28 inline comments as done. ymandel added a comment. Assorted changes in response to comments. Most notably, dropped constructor from RewriteRule, in favor of putting meaningful initialization in the builder. Repository: rG LLVM Gi

[PATCH] D59376: [LibTooling] Add Transformer, a library for source-to-source transformations.

2019-04-01 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/include/clang/Tooling/Refactoring/Transformer.h:70 +// +// * Explanation: explanation of the rewrite. +// ilya-biryukov wrote: > ymandel wrote: > > ilya-biryukov wrote: > > > NIT: maybe mention what it should be us

[PATCH] D59376: [LibTooling] Add Transformer, a library for source-to-source transformations.

2019-04-02 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 193260. ymandel marked 3 inline comments as done. ymandel added a comment. Small tweaks in response to comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59376/new/ https://reviews.llvm.org/D59376 Files:

[PATCH] D59376: [LibTooling] Add Transformer, a library for source-to-source transformations.

2019-04-02 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Thank you for the extremely helpful and detailed review!! Comment at: clang/include/clang/Tooling/Refactoring/Transformer.h:110 + // constructed with the builder class. + static constexpr char RootId[] = "___root___"; +}; ilya-biryuko

[PATCH] D59376: [LibTooling] Add Transformer, a library for source-to-source transformations.

2019-04-02 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 193306. ymandel added a comment. Remove dependency on NodeIds. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59376/new/ https://reviews.llvm.org/D59376 Files: clang/include/clang/Tooling/Refactoring/Transfor

[PATCH] D59376: [LibTooling] Add Transformer, a library for source-to-source transformations.

2019-04-02 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. I've removed the dependency on NodeIds given our (off thread) discussions regarding their overall value and appropriateness in clang::tooling vs clang::ast_matchers. PTAL. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D5937

[PATCH] D59376: [LibTooling] Add Transformer, a library for source-to-source transformations.

2019-04-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC357576: [LibTooling] Add Transformer, a library for source-to-source transformations. (authored by ymandel, committed by ). Changed prior to commit: https://reviews.llvm.org/D59376?vs=193306&id=193480#t

[PATCH] D59371: [LibTooling] Add Stencil library for format-string style codegen.

2019-04-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 193496. ymandel added a comment. Sever dependency on NodeId and some general cleanup. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59371/new/ https://reviews.llvm.org/D59371 Files: clang/include/clang/Tooli

[PATCH] D59371: [LibTooling] Add Stencil library for format-string style codegen.

2019-04-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 193498. ymandel added a comment. Remove noisy default-defined constructors/operators Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59371/new/ https://reviews.llvm.org/D59371 Files: clang/include/clang/Toolin

  1   2   3   4   5   6   7   8   9   10   >