[PATCH] D39611: [CodeGen] change const-ness of complex calls

Sanjay Patel via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 7 12:05:46 PST 2017


spatel updated this revision to Diff 121949.
spatel retitled this revision from "[CodeGen] make cbrt and fma constant (never set errno); document complex calls as always constant" to "[CodeGen] change const-ness of complex calls".
spatel edited the summary of this revision.
spatel added a comment.

Patch updated:
I don't know if we have agreement on the behavior that we want yet, but I'm updating the patch/description/title to only deal with <complex> in this patch and taking a shot at one interpretation, so we can see what that might look like.

There are really 2 changes here:

1. We had all of <complex> marked constant all the time ('c'). I think there's agreement that can't be true by default (a platform could set errno on any of these calls based on the language in the C standard).
2. We make an exception for a GNU environment - here, the calls are always constant because the standard allows - and POSIX constrains - the errno setting behavior. This is despite the fact that glibc is known to set errno in some cases.


https://reviews.llvm.org/D39611

Files:
  include/clang/Basic/Builtins.def
  include/clang/Basic/Builtins.h
  lib/Sema/SemaDecl.cpp
  test/CodeGen/complex-builtins.c
  test/CodeGen/complex-libcalls.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39611.121949.patch
Type: text/x-patch
Size: 48027 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171107/d81fa87a/attachment-0001.bin>


More information about the cfe-commits mailing list