From fc97d2e68b03bc2979395e84b645e5b3ba35aecd Mon Sep 17 00:00:00 2001 From: Peter Klausler Date: Wed, 18 Dec 2024 07:02:37 -0800 Subject: [flang] Add UNSIGNED (#113504) Implement the UNSIGNED extension type and operations under control of a language feature flag (-funsigned). This is nearly identical to the UNSIGNED feature that has been available in Sun Fortran for years, and now implemented in GNU Fortran for gfortran 15, and proposed for ISO standardization in J3/24-116.txt. See the new documentation for details; but in short, this is C's unsigned type, with guaranteed modular arithmetic for +, -, and *, and the related transformational intrinsic functions SUM & al. --- flang/lib/Frontend/CompilerInvocation.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'flang/lib/Frontend/CompilerInvocation.cpp') diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index 6ef4ee8..79386c9 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -749,6 +749,12 @@ static bool parseFrontendArgs(FrontendOptions &opts, llvm::opt::ArgList &args, clang::driver::options::OPT_fno_logical_abbreviations, false)); + // -f{no-}unsigned + opts.features.Enable(Fortran::common::LanguageFeature::Unsigned, + args.hasFlag(clang::driver::options::OPT_funsigned, + clang::driver::options::OPT_fno_unsigned, + false)); + // -f{no-}xor-operator opts.features.Enable( Fortran::common::LanguageFeature::XOROperator, -- cgit v1.1