porglezomp added inline comments.

================
Comment at: clang/lib/Sema/SemaOverload.cpp:9041-9044
+      // (allowing splatting the scalar to a vector).
+      for (unsigned Candidate = 0; Candidate < 2; ++Candidate) {
+        for (QualType Vec1Ty : CandidateTypes[Candidate].vector_types()) {
+          for (QualType Vec2Ty : CandidateTypes[Candidate].vector_types()) {
----------------
aaron.ballman wrote:
> I'm a bit confused -- the comment says this is to allow splatting the scalar 
> to a vector, but... what is the scalar type in these loops?
Right, so my goal here is to generate the two vector-operand overload 
candidates so that overload resolution can pick one of those and then apply the 
implicit scalar->vector conversion with the splat. I //think// this is the 
correct approach (it's based on how the compound assignment operators already 
handle this) but I need to improve my comments here.

Also, how do we like the loop here for trying both sides, as opposed to 
duplicating the code? This is really acting as an `if left operand / else if 
right operand` to avoid duplicating the code but I was worried writing it that 
the loop obscures the intent. Maybe that's also just "make the comment better" 
or maybe that part is clear enough.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151060

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to