[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 07:48:29 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:

```suggestion
bool BaseBoxType::isVolatile() const {
  return fir::isa_volatile_type(*this);
}
```

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


More information about the flang-commits mailing list