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

Zixuan Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 19 00:15:18 PDT 2018


wuzish created this revision.
wuzish added reviewers: hfinkel, nemanjai, Douglasgido, hubert.reinterpretcast, fpichet.

There are 2 function variations with altivec type parameter. When we call them with argument of generic gcc vector type we would prefer to choose the variation with implicit argument conversion of compatible vector type.

  typedef float __v4sf __attribute__((__vector_size__(16)));
  void f(vector float);
  void f(vector signed int);
  
  int main {
     __v4sf a;
     f(a);
  }

Here, we'd like to choose f(vector float) but not report an ambiguous call error.


Repository:
  rC Clang

https://reviews.llvm.org/D53417

Files:
  clang/lib/Sema/SemaOverload.cpp
  clang/test/Sema/altivec-generic-overload.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53417.170147.patch
Type: text/x-patch
Size: 6089 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181019/e825cdf0/attachment-0001.bin>


More information about the cfe-commits mailing list