[flang-commits] [flang] [flang] GETPID runtime and lower intrinsic implementation (PR #70442)

Yi Wu via flang-commits flang-commits at lists.llvm.org
Tue Oct 31 05:38:34 PDT 2023


PAX-12-WU wrote:

> `getpid` needs to be defined as an intrinsic function in order to get its result type correct.

How can I define it as intrinsic function to get a correct result type? I have tried renaming `iargc` to `argc` in `extension.cpp`, it will be called as `call contract float @argc_()`. 
I've defined `getpid` in `flang/lib/intrinsics.cpp` and `flang/lib/optimizer/builder/intrinsicsCall.cpp`. However, if it's defined in `extension.cpp`, which only calls a runtime function in `flang/runtime/command.cpp`, how does the intrinsic function affect the return type in `extension.cpp`?




https://github.com/llvm/llvm-project/pull/70442


More information about the flang-commits mailing list