[flang-commits] [flang] 325f512 - [flang] Set polymorphic entity lowering option on by default (#83308)

via flang-commits flang-commits at lists.llvm.org
Thu Feb 29 00:47:10 PST 2024


Author: jeanPerier
Date: 2024-02-29T09:47:06+01:00
New Revision: 325f51237252e6dab8e4e1ea1fa7acbb4faee1cd

URL: https://github.com/llvm/llvm-project/commit/325f51237252e6dab8e4e1ea1fa7acbb4faee1cd
DIFF: https://github.com/llvm/llvm-project/commit/325f51237252e6dab8e4e1ea1fa7acbb4faee1cd.diff

LOG: [flang] Set polymorphic entity lowering option on by default (#83308)

Preliminary patch for https://github.com/llvm/llvm-project/pull/83285 to
turn polymorphism on by default.

Will give a few days warning for people to remove the flag from their
workflow using flang-new.

Also easier to revert if issues with the gfortran test suites.

Added: 
    

Modified: 
    flang/include/flang/Lower/LoweringOptions.def
    flang/test/Driver/flang-experimental-polymorphism-flag.f90

Removed: 
    


################################################################################
diff  --git a/flang/include/flang/Lower/LoweringOptions.def b/flang/include/flang/Lower/LoweringOptions.def
index 503acdac869c7a..9de69ac5c80f52 100644
--- a/flang/include/flang/Lower/LoweringOptions.def
+++ b/flang/include/flang/Lower/LoweringOptions.def
@@ -24,8 +24,8 @@ LOWERINGOPT(Name, Bits, Default)
 /// If true, lower transpose without a runtime call.
 ENUM_LOWERINGOPT(OptimizeTranspose, unsigned, 1, 1)
 
-/// If true, enable polymorphic type lowering feature. Off by default.
-ENUM_LOWERINGOPT(PolymorphicTypeImpl, unsigned, 1, 0)
+/// If true, enable polymorphic type lowering feature. On by default.
+ENUM_LOWERINGOPT(PolymorphicTypeImpl, unsigned, 1, 1)
 
 /// If true, lower to High level FIR before lowering to FIR. On by default.
 ENUM_LOWERINGOPT(LowerToHighLevelFIR, unsigned, 1, 1)

diff  --git a/flang/test/Driver/flang-experimental-polymorphism-flag.f90 b/flang/test/Driver/flang-experimental-polymorphism-flag.f90
index 106e898149a18f..095c1cc929e67b 100644
--- a/flang/test/Driver/flang-experimental-polymorphism-flag.f90
+++ b/flang/test/Driver/flang-experimental-polymorphism-flag.f90
@@ -1,10 +1,10 @@
 ! Test -flang-experimental-hlfir flag
 ! RUN: %flang_fc1 -flang-experimental-polymorphism -emit-fir -o - %s | FileCheck %s
-! RUN: not %flang_fc1 -emit-fir -o - %s 2>&1 | FileCheck %s --check-prefix NO-POLYMORPHISM
+! RUN: %flang_fc1 -emit-fir -o - %s 2>&1 | FileCheck %s --check-prefix NO-POLYMORPHISM
 
 ! CHECK: func.func @_QPtest(%{{.*}}: !fir.class<none> {fir.bindc_name = "poly"})
 subroutine test(poly)
   class(*) :: poly
 end subroutine test
 
-! NO-POLYMORPHISM: not yet implemented: support for polymorphic types
+! NO-POLYMORPHISM: func.func @_QPtest


        


More information about the flang-commits mailing list