[flang-commits] [PATCH] D112698: [flang] Implement GET_ENVIRONMENT_VARIABLE(VALUE)

Diana Picus via Phabricator via flang-commits flang-commits at lists.llvm.org
Thu Oct 28 02:30:07 PDT 2021


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

Implement the second entry point for GET_ENVIRONMENT_VARIABLE. Reuse
existing bits and pieces wherever possible.

This patch also increases CFI_* error codes in order to avoid conflicts.
GET_ENVIRONMENT_VARIABLE is required to return a status of 1 if an
environment variable does not exist and 2 if environment variables are
not supported. However, if we add status codes for that they will
conflict with CFI_ERROR_BASE_ADDR_NULL and CFI_ERROR_BASE_ADDR_NOT_NULL,
which are also 1 and 2 at the moment. We therefore move all CFI error
codes up (an arbitrary) 10 spots to make room. Hopefully this isn't
a problem, since we weren't matching the CFI error codes that gfortran
uses anyway. It may still be an issue if any other runtime functions
will need to return a status of 1 or 2, but we should probably deal with
that when/if it occurs.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D112698

Files:
  flang/include/flang/ISO_Fortran_binding.h
  flang/include/flang/Runtime/command.h
  flang/include/flang/Runtime/magic-numbers.h
  flang/runtime/command.cpp
  flang/runtime/stat.cpp
  flang/runtime/stat.h
  flang/unittests/Runtime/CommandTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112698.382958.patch
Type: text/x-patch
Size: 14502 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20211028/20f77263/attachment-0001.bin>


More information about the flang-commits mailing list