This is an archive of the discontinued LLVM Phabricator instance.

[OpenCL] Print builtin function prototypes if ambiguous
Needs ReviewPublic

Authored by Pierre on Jul 8 2019, 3:44 AM.

Details

Reviewers
Anastasia
svenvh
Summary

When hitting an ambigous call to a builtin function with the
-fdeclare-opencl-builtins option, diagnostics don't print the prototypes
that clash.
When not using the option above, they are displayed.
This patch prints them.

This is changing this diagnostic:

test.cl:86:11: error: call to 'acos' is ambiguous
  int a = acos(p);
          ^~~~
test.cl:86:11: note: candidate function
test.cl:86:11: note: candidate function
[not printing everything ...]
test.cl:86:11: note: candidate function
1 error generated.

To this:

test.cl:86:11: error: call to 'acos' is ambiguous
  int a = acos(p);
          ^~~~
test.cl:86:11: note: candidate function
float acos(float)
test.cl:86:11: note: candidate function
double acos(double)
[not printing everything ...]
test.cl:86:11: note: candidate function
__fp16 __attribute__((ext_vector_type(16))) acos(__fp16 __attribute__((ext_vector_type(16))))
1 error generated.

Diff Detail

Event Timeline

Pierre created this revision.Jul 8 2019, 3:44 AM