[all-commits] [llvm/llvm-project] 73cf01: [flang] harden TypeAndShape for assumed-ranks (#96...

jeanPerier via All-commits all-commits at lists.llvm.org
Mon Jun 24 01:21:25 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 73cf014223fed1947f725f7debcf19b8f54448b5
      https://github.com/llvm/llvm-project/commit/73cf014223fed1947f725f7debcf19b8f54448b5
  Author: jeanPerier <jperier at nvidia.com>
  Date:   2024-06-24 (Mon, 24 Jun 2024)

  Changed paths:
    M flang/include/flang/Evaluate/characteristics.h
    M flang/include/flang/Evaluate/shape.h
    M flang/lib/Evaluate/characteristics.cpp
    M flang/lib/Evaluate/check-expression.cpp
    M flang/lib/Evaluate/shape.cpp
    M flang/lib/Lower/CallInterface.cpp
    M flang/lib/Semantics/check-call.cpp
    M flang/lib/Semantics/check-declarations.cpp
    M flang/lib/Semantics/pointer-assignment.cpp
    M flang/lib/Semantics/runtime-type-info.cpp
    M flang/test/Evaluate/rewrite06.f90

  Log Message:
  -----------
  [flang] harden TypeAndShape for assumed-ranks (#96234)

SIZEOF and C_SIZEOF were broken for assumed-ranks because
`TypeAndShape::MeasureSizeInBytes` behaved as a scalar because the
`TypeAndShape::shape_` member was the same for scalar and assumed-ranks.

The easy fix would have been to add special handling in
`MeasureSizeInBytes` for assumed-ranks using the TypeAndShape
attributes, but I think this solution would leave `TypeAndShape::shape_`
manipulation fragile to future developers. Hence, I went for the
solution that turn shape_ into a `std::optional<Shape>`.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list