[flang] Support GNU extensions IARGC and GETARG in runtime
authorPeixin-Qiao <qiaopeixin@huawei.com>
Tue, 11 Oct 2022 02:29:23 +0000 (10:29 +0800)
committerPeixin-Qiao <qiaopeixin@huawei.com>
Tue, 11 Oct 2022 02:29:23 +0000 (10:29 +0800)
commit1d4238be528acdd8a521465e93ed6a6238a2cd4e
tree8618adbf879040e9d8880efa5a5a2cb218d7cd24
parent053e894106beb534ec27010b960ee58031a2fdb8
[flang] Support GNU extensions IARGC and GETARG in runtime

The GNU extension intrinsic IARGC is equivalent to
COMMAND_ARGUMENT_COUNT, and the GETARG is similar to
GET_COMMAND_ARGUMENT, but with less arguments. Reuse the runtime of
COMMAND_ARGUMENT_COUNT and GET_COMMAND_ARGUMENT for IARGC and GETARG.

Reviewed By: klausler

Differential Revision: https://reviews.llvm.org/D133558
flang/include/flang/Runtime/extensions.h
flang/runtime/extensions.cpp