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

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 28 12:01:43 PST 2019


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 return statements inside `if`s(also by changing them to `else if`s)
> FWIW I find ifs with return to be more readable than a bunch of if+else statements. The reason is that return clearly states function is done, while trailing `else` suggests it will go further.
> 
> But this particular function is short, so it's not a strong argument, can change it if you insist.
On a second thought, I think my approach makes it uglier. The function is small, so the added "return R" everywhere only make it uglier.

Changed the code per your suggestions, thanks!


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56723/new/

https://reviews.llvm.org/D56723





More information about the cfe-commits mailing list