diff options
author | jeanPerier <jperier@nvidia.com> | 2023-11-10 11:54:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-10 11:54:10 +0100 |
commit | 9f265c38718ca5c6b2b2ba6a237db1ba5e2cac55 (patch) | |
tree | 4ab58e7e82c4dabf07ddd0015180561c10de2635 /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | 7b1a0580216796045b880251e031a1e5e0ecad74 (diff) | |
download | llvm-9f265c38718ca5c6b2b2ba6a237db1ba5e2cac55.zip llvm-9f265c38718ca5c6b2b2ba6a237db1ba5e2cac55.tar.gz llvm-9f265c38718ca5c6b2b2ba6a237db1ba5e2cac55.tar.bz2 |
[flang][driver] add -flang-deprecated-no-hlfir hidden option (#71820)
Patch 1/3 of the transition to use the HLFIR step by default in lowering
as described in
https://discourse.llvm.org/t/rfc-enabling-the-hlfir-lowering-by-default/72778/7
This option will allow to lower code without the HLFIR step during a
grace period as described in the RFC. It is not meant to be a long term
switch for flang.
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | flang/lib/Frontend/CompilerInvocation.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index ba2ecab..3fef377 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -1073,6 +1073,19 @@ bool CompilerInvocation::createFromArgs( res.loweringOpts.setLowerToHighLevelFIR(true); } + // -flang-deprecated-no-hlfir + if (args.hasArg(clang::driver::options::OPT_flang_deprecated_no_hlfir) && + !args.hasArg(clang::driver::options::OPT_emit_hlfir)) { + if (args.hasArg(clang::driver::options::OPT_flang_experimental_hlfir)) { + const unsigned diagID = diags.getCustomDiagID( + clang::DiagnosticsEngine::Error, + "Options '-flang-experimental-hlfir' and " + "'-flang-deprecated-no-hlfir' cannot be both specified"); + diags.Report(diagID); + } + res.loweringOpts.setLowerToHighLevelFIR(false); + } + if (args.hasArg(clang::driver::options::OPT_flang_experimental_polymorphism)) { res.loweringOpts.setPolymorphicTypeImpl(true); } |