[FPEnv] Extended FPOptions with new attributes
This change added two new attributes, rounding mode and exception
behavior to the structure FPOptions. These attributes allow more
flexible treatment of specific floating point environment than it is
provided by #pragma STDC FENV_ACCESS.
Differential Revision: https://reviews.llvm.org/D65994
diff --git a/clang/lib/Sema/SemaAttr.cpp b/clang/lib/Sema/SemaAttr.cpp
index cd2a652..9b8dc148 100644
--- a/clang/lib/Sema/SemaAttr.cpp
+++ b/clang/lib/Sema/SemaAttr.cpp
@@ -940,6 +940,14 @@
}
}
+void Sema::setRoundingMode(LangOptions::FPRoundingModeKind FPR) {
+ FPFeatures.setRoundingMode(FPR);
+}
+
+void Sema::setExceptionMode(LangOptions::FPExceptionModeKind FPE) {
+ FPFeatures.setExceptionMode(FPE);
+}
+
void Sema::ActOnPragmaFEnvAccess(LangOptions::FEnvAccessModeKind FPC) {
switch (FPC) {
case LangOptions::FEA_On: