[PATCH] D99208: [flang] Save binding labels as strings

Tim Keith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 23 12:49:53 PDT 2021


tskeith created this revision.
tskeith added reviewers: klausler, jeanPerier.
tskeith added a project: Flang.
Herald added subscribers: jdoerfert, mgorny.
tskeith requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D99208

Files:
  flang/include/flang/Evaluate/type.h
  flang/include/flang/Semantics/symbol.h
  flang/lib/Semantics/CMakeLists.txt
  flang/lib/Semantics/check-declarations.cpp
  flang/lib/Semantics/check-io.h
  flang/lib/Semantics/mod-file.cpp
  flang/lib/Semantics/resolve-names.cpp
  flang/lib/Semantics/symbol.cpp
  flang/test/Semantics/modfile04.f90
  flang/test/Semantics/modfile21.f90
  flang/test/Semantics/separate-mp02.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99208.332762.patch
Type: text/x-patch
Size: 15601 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210323/866459ab/attachment.bin>


More information about the llvm-commits mailing list