[all-commits] [llvm/llvm-project] 149d3e: [flang] Disambiguate F(X)=Y case where F is a func...

Peter Klausler via All-commits all-commits at lists.llvm.org
Mon Apr 25 09:25:24 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 149d3e4365325fdb9b79a4d0e3f88a2c84e0baaf
      https://github.com/llvm/llvm-project/commit/149d3e4365325fdb9b79a4d0e3f88a2c84e0baaf
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2022-04-25 (Mon, 25 Apr 2022)

  Changed paths:
    M flang/lib/Parser/parse-tree.cpp
    M flang/lib/Semantics/rewrite-parse-tree.cpp

  Log Message:
  -----------
  [flang] Disambiguate F(X)=Y case where F is a function returning a pointer

F(X)=Y may be initially parsed as a statement function definition; an
existing pass will detect statement functions that should be rewritten
into assignment statemets with array element references as their
left-hand side variables.  However, F() may also be a reference to a
function that returns a data pointer, and f18 did not handle this
case correctly.

The right fix is to rewrite the parse tree for F(X)=Y into an assignment
to a function reference result.  The cases that are actually assignments
to array elements -- including all of the cases previously handled --
will have their left-hand sides converted to array element references
later by another existing rewriting step.

Differential Revision: https://reviews.llvm.org/D124299




More information about the All-commits mailing list