From b81c5070d5451af127b2c9c2ae362ba1b0a96c01 Mon Sep 17 00:00:00 2001 From: David Truby Date: Thu, 22 Jun 2023 13:52:37 +0100 Subject: [flang] add -flang-experimental-polymorphism flag to flang-new This flag enables Fortran 2003 polymorphism. It is marked experimental and not included in --help. Reviewed By: tblah, awarzynski Differential Revision: https://reviews.llvm.org/D153281 --- flang/lib/Frontend/CompilerInvocation.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'flang/lib/Frontend/CompilerInvocation.cpp') diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index 610f60c..f8a075c 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -920,6 +920,10 @@ bool CompilerInvocation::createFromArgs( res.loweringOpts.setLowerToHighLevelFIR(true); } + if (args.hasArg(clang::driver::options::OPT_flang_experimental_polymorphism)) { + res.loweringOpts.setPolymorphicTypeImpl(true); + } + success &= parseFrontendArgs(res.getFrontendOpts(), args, diags); parseTargetArgs(res.getTargetOpts(), args); parsePreprocessorArgs(res.getPreprocessorOpts(), args); -- cgit v1.1