This is an archive of the discontinued LLVM Phabricator instance.

__builtin_fpclassify missing one int parameter
ClosedPublic

Authored by taniabarg on Oct 11 2016, 10:35 AM.

Details

Summary

BIF fpclassify has the wrong number of integer parameters specified in Builtins.def. There should be 5 int parameters (each representing the values FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL and FP_ZERO) but Builtins.def previously specified 4.

Diff Detail

Repository
rL LLVM

Event Timeline

taniabarg updated this revision to Diff 74271.Oct 11 2016, 10:35 AM
taniabarg retitled this revision from to __builtin_fpclassify missing one int parameter.
taniabarg updated this object.
taniabarg added a subscriber: cfe-commits.

A test should probably be added as well.

__builtin_fpclassify takes five int arguments followed by one last argument that is of floating point type. Do you know if there is a way to specify the last one argument is a floating point rather than using '.'?

__builtin_fpclassify takes five int arguments followed by one last argument that is of floating point type. Do you know if there is a way to specify the last one argument is a floating point rather than using '.'?

There is already code in clang/lib/Sema/SemaChecking.cpp to generate diag::err_typecheck_call_invalid_unary_fp.

taniabarg updated this revision to Diff 74377.Oct 12 2016, 7:53 AM
taniabarg edited edge metadata.

Added test to test/Sema/builtin-unary-fp.c that will fail without the proposed change (without the change, the test will -not- attempt to implicitly cast the 5th parameter to int).

davidsh accepted this revision.Oct 13 2016, 10:41 AM
davidsh edited edge metadata.
This revision is now accepted and ready to land.Oct 13 2016, 10:41 AM
This revision was automatically updated to reflect the committed changes.