[flang] Fix bug converting actual argument to Fortran
authorTim Keith <tkeith@nvidia.com>
Fri, 7 Dec 2018 15:41:49 +0000 (07:41 -0800)
committerTim Keith <tkeith@nvidia.com>
Fri, 7 Dec 2018 15:41:49 +0000 (07:41 -0800)
commita3b09ef72a8fb855caa556354634157a6d84abd0
treebbe26785d13b65f3e2f7ca598df708197e598035
parent738c47bf9b66c9c4430e1f5b5d38e8a91d76b369
[flang] Fix bug converting actual argument to Fortran

This fixes a problem with converting the ubound call in the example
below back to Fortran (in this case, for writing to the .mod file).
One of the ActualArguments encountered in ProcedureRef::AsFortran is
a `std::nullopt`, so we need to handle that case.

```
module m
  real :: x(10)
  real :: y(ubound(x, dim=1))
end module
```

Original-commit: flang-compiler/f18@c5ace6b8241cd1ef86f0649941bf38386d99bdc4
Reviewed-on: https://github.com/flang-compiler/f18/pull/240
flang/lib/evaluate/call.cc