[PATCH] D53417: [Clang][PowerPC] Choose a better candidate in overload function call if there is a compatible vector conversion instead of ambiguous call error

Hubert Tong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 19 06:51:46 PDT 2018


hubert.reinterpretcast added inline comments.


================
Comment at: clang/lib/Sema/SemaOverload.cpp:3908
+                                                   QualType ToType) {
+    assert(FromType->isVectorType() && "FromType should be a vector type");
+    assert(ToType->isVectorType() && "ToType should be a vector type");
----------------
These `assert`s would be redundant if `castAs` is used instead of `getAs`.


================
Comment at: clang/lib/Sema/SemaOverload.cpp:3911
+
+    if (FromType->getAs<VectorType>()->getVectorKind() ==
+            VectorType::AltiVecVector ||
----------------
Use `castAs` here and below.


================
Comment at: clang/lib/Sema/SemaOverload.cpp:3930
+  // }
+  // Here, we'd like to choose f(vector float) but not
+  // report an ambiguous call error
----------------
s/but/and/;


Repository:
  rC Clang

https://reviews.llvm.org/D53417





More information about the cfe-commits mailing list