[all-commits] [llvm/llvm-project] eda662: [flang] Add support for the IARGC and GETARG legac...

Tuhil via All-commits all-commits at lists.llvm.org
Sun Jun 14 10:13:52 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: eda662faf49d1a0cb81e724993d2fdc123b4b693
      https://github.com/llvm/llvm-project/commit/eda662faf49d1a0cb81e724993d2fdc123b4b693
  Author: Tuhil <63782260+Tuhil926 at users.noreply.github.com>
  Date:   2026-06-14 (Sun, 14 Jun 2026)

  Changed paths:
    M flang/docs/Intrinsics.md
    M flang/include/flang/Optimizer/Builder/IntrinsicCall.h
    M flang/lib/Evaluate/intrinsics.cpp
    M flang/lib/Optimizer/Builder/IntrinsicCall.cpp
    A flang/test/Lower/Intrinsics/getarg.f90
    A flang/test/Lower/Intrinsics/iargc.f90
    A flang/test/Semantics/test-iargc-getarg.f90

  Log Message:
  -----------
  [flang] Add support for the IARGC and GETARG legacy intrinsics (#196425)

Adds semantic checking and lowering, along with semantic and lowering
tests for the legacy GNU intrinsics 'IARGC()' and 'GETARG(POS, VALUE)'.

Although these could just be added as aliases to the standard
COMMAND_ARGUMENT_COUNT and GET_COMMAND_ARGUMENT intrinsics, they were
implemented as separate intrinsics because of some semantic differences
between them:

* IARGC always returns INTEGER(4), whereas COMMAND_ARGUMENT_COUNT
returns a default INTEGER, which could have a different kind.
* GETARG has only two arguments, both of which are required.
* GETARG's POS argument accepts any integer type of width less than or
equal to the default integer kind, while GET_COMMAND_ARGUMENT only
accepts default integers.

Fixes #158438



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list