[all-commits] [llvm/llvm-project] 63200a: [flang] Sort symbols by creation order

Pete Steinfeld via All-commits all-commits at lists.llvm.org
Tue Mar 9 12:36:05 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 63200a058e6d5f275204154a16723e8f169a317a
      https://github.com/llvm/llvm-project/commit/63200a058e6d5f275204154a16723e8f169a317a
  Author: Peter Steinfeld <psteinfeld at nvidia.com>
  Date:   2021-03-09 (Tue, 09 Mar 2021)

  Changed paths:
    M flang/include/flang/Semantics/symbol.h
    M flang/test/Semantics/data05.f90
    M flang/test/Semantics/resolve102.f90
    M flang/test/Semantics/typeinfo01.f90

  Log Message:
  -----------
  [flang] Sort symbols by creation order

We have a "<" operator defined on the type semantics::Symbol that's based on
the symbols' locations in the cooked character stream.  This is potentially
problematic when comparing symbols from .mod files when the cooked character
streams themselves might be allocated to varying memory locations.

This change fixes that by using the order in which symbols are created as the
basis for the "<" operator.  Thanks to Tim and Peter for consultation on the
necessity of doing this and the idea for what to use as the basis of the sort.

This change in the "<" operator changed the expected results for three of the
tests.  I manually inspected the new results, and they look OK to me.  The
differences in data05.f90 and typeinfo01.f90 are entirely the order, offsets,
and sizes of the derived type components.  The changes in resolve102.f90 are
due to the new, different "<" operator used for sorting.

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




More information about the All-commits mailing list