[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.
This commit is contained in:
Peter Klausler
2024-12-18 07:02:37 -08:00
committed by GitHub
parent 6f0e9c4a56
commit fc97d2e68b
98 changed files with 3293 additions and 746 deletions

View File

@@ -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,