[flang-commits] [flang] [flang][debug] Support assumed shape arrays. (PR #94644)

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Mon Jun 10 02:33:11 PDT 2024


================
@@ -23,63 +23,45 @@
 
 namespace fir {
 
+/// Calculate offset of any field in the descriptor.
+template <int DescriptorField>
+std::uint64_t getComponentOffset(const mlir::DataLayout &dl,
+                                 mlir::MLIRContext *context,
+                                 mlir::Type llvmFieldType) {
+  assert(DescriptorField > 0 && DescriptorField < 10);
----------------
tblah wrote:

nit: I think this can be a `static_assert`

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


More information about the flang-commits mailing list