[flang-commits] [flang] [flang][hlfir] do not propagate polymorphic temporary as allocatables (PR #142609)

Asher Mancinelli via flang-commits flang-commits at lists.llvm.org
Tue Jun 3 14:06:32 PDT 2025


================
@@ -1492,6 +1499,12 @@ bool fir::BaseBoxType::isPointer() const {
   return llvm::isa<fir::PointerType>(getEleTy());
 }
 
+bool BaseBoxType::isVolatile() const {
+  return llvm::TypeSwitch<fir::BaseBoxType, bool>(*this)
+      .Case<fir::BoxType, fir::ClassType>(
+          [](auto type) { return type.isVolatile(); });
+}
+
----------------
ashermancinelli wrote:

Looks like some of the `ClassType::get()`s could also use a volatile check?

LGTM otherwise, thank you!

https://github.com/llvm/llvm-project/pull/142609


More information about the flang-commits mailing list