[PATCH] D56723: [CodeComplete] Propagate preferred types through parser in more cases

2019-01-31 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC352788: [CodeComplete] Propagate preferred types through parser in more cases (authored by ibiryukov, committed by ). Changed prior to commit: https://reviews.llvm.org/D56723?vs=184038=184568#toc

[PATCH] D56723: [CodeComplete] Propagate preferred types through parser in more cases

2019-01-29 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet accepted this revision. kadircet added a comment. This revision is now accepted and ready to land. LGTM from my side CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56723/new/ https://reviews.llvm.org/D56723 ___ cfe-commits mailing

[PATCH] D56723: [CodeComplete] Propagate preferred types through parser in more cases

2019-01-29 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 184038. ilya-biryukov marked an inline comment as done. ilya-biryukov added a comment. - Get rid of the RAII object CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56723/new/ https://reviews.llvm.org/D56723 Files:

[PATCH] D56723: [CodeComplete] Propagate preferred types through parser in more cases

2019-01-29 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov marked 2 inline comments as done. ilya-biryukov added inline comments. Comment at: clang/include/clang/Sema/Sema.h:319-346 +class PreferredTypeBuilder::RestoreRAII { +public: + RestoreRAII(RestoreRAII const &) = delete; + RestoreRAII =(RestoreRAII const &) =

[PATCH] D56723: [CodeComplete] Propagate preferred types through parser in more cases

2019-01-28 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/include/clang/Sema/Sema.h:319-346 +class PreferredTypeBuilder::RestoreRAII { +public: + RestoreRAII(RestoreRAII const &) = delete; + RestoreRAII =(RestoreRAII const &) = delete; + + explicit RestoreRAII(PreferredTypeBuilder ) +

[PATCH] D56723: [CodeComplete] Propagate preferred types through parser in more cases

2019-01-28 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 183937. ilya-biryukov added a comment. - Use 'else if' to simplify the code CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56723/new/ https://reviews.llvm.org/D56723 Files: clang/include/clang/Parse/Parser.h

[PATCH] D56723: [CodeComplete] Propagate preferred types through parser in more cases

2019-01-28 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov marked an inline comment as done. ilya-biryukov added inline comments. Comment at: lib/Sema/SemaCodeComplete.cpp:373 +} +Type = QualType(); + }); ilya-biryukov wrote: > kadircet wrote: > > nit: maybe move this into top and get rid of the

[PATCH] D56723: [CodeComplete] Propagate preferred types through parser in more cases

2019-01-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 183303. ilya-biryukov added a comment. - Improve a comment CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56723/new/ https://reviews.llvm.org/D56723 Files: clang/include/clang/Parse/Parser.h clang/include/clang/Sema/CodeCompleteConsumer.h

[PATCH] D56723: [CodeComplete] Propagate preferred types through parser in more cases

2019-01-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. In D56723#1366885 , @rsmith wrote: > `ConsumeToken` is a fairly hot function; if you can avoid changes there > that'd be preferable. Done, there are no `enterUnknown` calls anymore and to avoid updating on each call to

[PATCH] D56723: [CodeComplete] Propagate preferred types through parser in more cases

2019-01-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov marked 3 inline comments as done. ilya-biryukov added inline comments. Comment at: lib/Sema/SemaCodeComplete.cpp:373 +} +Type = QualType(); + }); kadircet wrote: > nit: maybe move this into top and get rid of the return statements inside

[PATCH] D56723: [CodeComplete] Propagate preferred types through parser in more cases

2019-01-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 183297. ilya-biryukov added a comment. - Remove enterUnknown(), keep token location instead. - Inline update() and remove it CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56723/new/ https://reviews.llvm.org/D56723 Files:

[PATCH] D56723: [CodeComplete] Propagate preferred types through parser in more cases

2019-01-22 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. In D56723#1366529 , @ilya-biryukov wrote: > I'll try playing around with your idea, my initial plan is to store preferred > type alongside the current token as a member of the `Parser` class and update > it when advancing to

[PATCH] D56723: [CodeComplete] Propagate preferred types through parser in more cases

2019-01-22 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Thanks for the suggestion, this should definitely work! I did struggle to figure out a way to do this without annotating every path with `enterUnknown` and failed. I'll try playing around with your idea, my initial plan is to store preferred type alongside the

[PATCH] D56723: [CodeComplete] Propagate preferred types through parser in more cases

2019-01-21 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. This seems to be introducing a requirement that `enterUnknown` is called on all paths through the parser where we recurse to parse a subexpression and don't have specific type information. That seems like an unfortunate requirement to me from a maintenance perspective;

[PATCH] D56723: [CodeComplete] Propagate preferred types through parser in more cases

2019-01-17 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Thanks for a quick response, @kadircet! Leaving some first comments, will address the rest later. In D56723#1361366 , @kadircet wrote: > One general comment: I am not really sure if the handling done in >

[PATCH] D56723: [CodeComplete] Propagate preferred types through parser in more cases

2019-01-17 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added a comment. That really looks awesome, thanks! One general comment: I am not really sure if the handling done in `ParseCastExpression` is extensive enough. But IIUC, this should not cause any regressions, rather should result in missing preferred types just as before this patch

[PATCH] D56723: [CodeComplete] Propagate preferred types through parser in more cases

2019-01-15 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. @kadircet for preferred-type related bits. @rsmith for parser-related bits. More specifically, (1) should we be worried that this might affect parser performance on the hot path and (2) whether there are better alternatives to do something like this. Repository:

[PATCH] D56723: [CodeComplete] Propagate preferred types through parser in more cases

2019-01-15 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov created this revision. ilya-biryukov added reviewers: kadircet, rsmith. Preferred types are used by code completion for ranking. This commit considerably increases the number of points in code where those types are propagated. In order to avoid complicating signatures of Parser's