[flang-commits] [PATCH] D122938: [flang] Fold instantiated PDT character component length when needed

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Fri Apr 1 13:50:03 PDT 2022


klausler accepted this revision.
klausler added inline comments.
This revision is now accepted and ready to land.


================
Comment at: flang/lib/Semantics/type.cpp:402
     if (const DeclTypeSpec * returnType{InstantiateType(newSymbol)}) {
-      ProcInterface &interface{procDetails->interface()};
+      ProcInterface &interface { procDetails->interface() };
       if (!interface.symbol()) {
----------------
Odd formatting without substantive change.


================
Comment at: flang/lib/Semantics/type.cpp:449
+  if (spec.category() != DeclTypeSpec::Character &&
+      evaluate::ToInt64(intrinsic.kind())) {
     return spec; // KIND is already a known constant
----------------
The newer `IsActuallyConstant()` predicate might be better here than `ToInt64()` since you're changing this line anyway.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122938/new/

https://reviews.llvm.org/D122938



More information about the flang-commits mailing list