[flang-commits] [clang] [flang] [flang][Driver] Add support for -f[no-]wrapv and -f[no]-strict-overflow in the frontend (PR #110061)

Yusuke MINATO via flang-commits flang-commits at lists.llvm.org
Sun Oct 6 21:07:12 PDT 2024


================
@@ -27,6 +27,14 @@ namespace Fortran::common {
 class LangOptionsBase {
 
 public:
+  enum SignedOverflowBehaviorTy {
+    // -fno-wrapv (default behavior in Flang)
+    SOB_Undefined,
----------------
yus3710-fj wrote:

This is used as the default value of a LangOption `SignedOverflowBehavior`. If the behavior is not defined, `nsw` could be added to some operations such as `add`.
FWIW, this implementation is simliar to [that of Clang](https://github.com/llvm/llvm-project/blob/b672071ba51ef6b64651a62bcfaf78bdfdb7d3d4/clang/include/clang/Basic/LangOptions.h#L87-L96).

https://github.com/llvm/llvm-project/pull/110061


More information about the flang-commits mailing list