[all-commits] [llvm/llvm-project] c353eb: [flang] Compute sizes and offsets for symbols

Tim Keith via All-commits all-commits at lists.llvm.org
Thu Apr 23 14:56:21 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c353ebbfa4cb30a823fd850de97cb1ef559a05cc
      https://github.com/llvm/llvm-project/commit/c353ebbfa4cb30a823fd850de97cb1ef559a05cc
  Author: Tim Keith <tkeith at nvidia.com>
  Date:   2020-04-23 (Thu, 23 Apr 2020)

  Changed paths:
    M flang/include/flang/Semantics/scope.h
    M flang/include/flang/Semantics/symbol.h
    M flang/include/flang/Semantics/type.h
    M flang/lib/Evaluate/type.cpp
    M flang/lib/Semantics/CMakeLists.txt
    A flang/lib/Semantics/compute-offsets.cpp
    A flang/lib/Semantics/compute-offsets.h
    M flang/lib/Semantics/mod-file.cpp
    M flang/lib/Semantics/scope.cpp
    M flang/lib/Semantics/semantics.cpp
    M flang/lib/Semantics/symbol.cpp
    M flang/lib/Semantics/type.cpp
    A flang/test/Semantics/offsets01.f90
    A flang/test/Semantics/offsets02.f90

  Log Message:
  -----------
  [flang] Compute sizes and offsets for symbols

Summary:
Add size and offset properties to symbols, representing their byte size
and offset within their enclosing scope.

Add size and align properties to scopes so that they are available for
scopes representing derived types.

Add ComputeOffsets pass over the symbol table to fill in those fields.

Compute descriptor size based on rank and length parameters. Extract
DerivedTypeSpec::NumLengthParameters from DynamicType::RequiresDescriptor
to share the code.

Add Scope::GetSymbols to get symbols in canonical order.
compute-offsets.cpp and mod-file.cpp both need to process symbols in the
order in which they are declared. Move the collecting of those symbols
into Scope so that it can be shared.

Add symbol size and offset to output of `-fdebug-dump-symbols` and use
that in some tests.

Still to do:
- make size and alignment rules configurable based on target
- use offsets to check EQUIVALENCE statements

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




More information about the All-commits mailing list