[PATCH] D92491: [flang][NFC] Add GetTopLevelUnitContaining functions

Tim Keith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 2 09:15:03 PST 2020


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

`GetTopLevelUnitContaining` returns the Scope nested in the global scope
that contains the given Scope or Symbol.

Use "Get" rather than "Find" in the name because "Find" implies it might
not be found, which can't happen. Following that logic, rename
`FindProgramUnitContaining` to `GetProgramUnitContaining` and have it
also return a reference rather that a pointer.

Note that the use of "ProgramUnit" is slightly confusing. In the Fortran
standard, "program-unit" refers to what is called a "TopLevelUnit" here.
What we are calling a "ProgramUnit" (here and in `ProgramTree`) includes
internal subprograms while "TopLevelUnit" does not.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92491

Files:
  flang/include/flang/Semantics/tools.h
  flang/lib/Semantics/check-return.cpp
  flang/lib/Semantics/resolve-names.cpp
  flang/lib/Semantics/tools.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92491.308992.patch
Type: text/x-patch
Size: 5333 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201202/6ab06d60/attachment.bin>


More information about the llvm-commits mailing list