[all-commits] [llvm/llvm-project] 5d3249: [flang] Save binding labels as strings

Tim Keith via All-commits all-commits at lists.llvm.org
Wed Mar 24 11:26:07 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5d3249e9af9086a29214312af18651ebb769eb71
      https://github.com/llvm/llvm-project/commit/5d3249e9af9086a29214312af18651ebb769eb71
  Author: Tim Keith <tkeith at nvidia.com>
  Date:   2021-03-24 (Wed, 24 Mar 2021)

  Changed paths:
    M flang/include/flang/Semantics/symbol.h
    M flang/lib/Semantics/CMakeLists.txt
    M flang/lib/Semantics/check-declarations.cpp
    M flang/lib/Semantics/mod-file.cpp
    M flang/lib/Semantics/resolve-names.cpp
    M flang/lib/Semantics/symbol.cpp
    M flang/test/Semantics/modfile04.f90
    M flang/test/Semantics/modfile21.f90
    M flang/test/Semantics/separate-mp02.f90

  Log Message:
  -----------
  [flang] Save binding labels as strings

Binding labels start as expressions but they have to evaluate to
constant character of default kind, so they can be represented as an
std::string. Leading and trailing blanks have to be removed, so the
folded expression isn't exactly right anyway.

So all BIND(C) symbols now have a string binding label, either the
default or user-supplied one. This is recorded in the .mod file.

Add WithBindName mix-in for details classes that can have a binding
label so that they are all consistent. Add GetBindName() and
SetBindName() member functions to Symbol.

Add tests that verifies that leading and trailing blanks are ignored
in binding labels and that the default label is folded to lower case.

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




More information about the All-commits mailing list