[flang-commits] [flang] [flang] Create TBAA subtree for COMMON block variables. (PR #156558)
Tom Eccles via flang-commits
flang-commits at lists.llvm.org
Wed Sep 3 04:20:37 PDT 2025
================
@@ -57,12 +62,131 @@ static llvm::cl::opt<unsigned> localAllocsThreshold(
namespace {
+// Return the size and alignment (in bytes) for the given type.
+// TODO: this must be combined with DebugTypeGenerator::getFieldSizeAndAlign().
+// We'd better move fir::LLVMTypeConverter out of the FIRCodeGen component.
+static std::pair<std::uint64_t, unsigned short>
+getTypeSizeAndAlignment(mlir::Type type,
+ fir::LLVMTypeConverter &llvmTypeConverter) {
+ mlir::Type llvmTy;
+ if (auto boxTy = mlir::dyn_cast_if_present<fir::BaseBoxType>(type))
+ llvmTy = llvmTypeConverter.convertBoxTypeAsStruct(boxTy, getBoxRank(boxTy));
+ else
+ llvmTy = llvmTypeConverter.convertType(type);
----------------
tblah wrote:
A pointer does seem to be what it is lowered to from what I can tell. So I think that should be okay. It would be good to get Jean's thoughts before merging though.
https://github.com/llvm/llvm-project/pull/156558
More information about the flang-commits
mailing list