diff options
author | Peter Klausler <pklausler@nvidia.com> | 2024-12-18 07:02:37 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-18 07:02:37 -0800 |
commit | fc97d2e68b03bc2979395e84b645e5b3ba35aecd (patch) | |
tree | 53f2e0acdc4f83b4850321c0005596131470ec3e /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | 6f0e9c4a5611d21cbcac4bb4f16dc90674838e1e (diff) | |
download | llvm-fc97d2e68b03bc2979395e84b645e5b3ba35aecd.zip llvm-fc97d2e68b03bc2979395e84b645e5b3ba35aecd.tar.gz llvm-fc97d2e68b03bc2979395e84b645e5b3ba35aecd.tar.bz2 |
[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.
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | flang/lib/Frontend/CompilerInvocation.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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, |