[PATCH] D52839: Inform AST's UnaryOperator of FENV_ACCESS

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 12 12:01:21 PDT 2018


rsmith added a comment.

In https://reviews.llvm.org/D52839#1262449, @kpn wrote:

> I forgot to address the template question. I've spend the past 18 years doing SystemZ backend work on multiple {,JIT} compilers. I'm not really in a position to answer your question about how to handle getting these FP bits down into C++ templates. I hope that won't hold up getting FENV_ACCESS working for C compilations.


Actually, I think it should. If your approach doesn't extend to C++, then you have the wrong approach, and we should redesign it now rather than spend more time on it. (Also, we use TreeTransforms in C sometimes, too, so this actually isn't even a C++-specific design problem.)

I think there are two possible approaches to take here:

1. Treat the FP environment flags as a part of the global Sema state. Whenever Clang switches its current context, figure out the right FP environment for the new context, and switch the FP environment too. This'd necessitate storing the FP environment data on DeclContexts, which would likely otherwise be unnecessary.


https://reviews.llvm.org/D52839





More information about the cfe-commits mailing list