[flang] Change WhyNotModifiable to return optional
authorTim Keith <tkeith@nvidia.com>
Thu, 5 Mar 2020 20:56:30 +0000 (12:56 -0800)
committerTim Keith <tkeith@nvidia.com>
Tue, 10 Mar 2020 00:25:12 +0000 (17:25 -0700)
commit2cc21cecf2478eb71f9ab25f6b7fee7161c3b87b
treee24d51c7f07140ce5acf378551d20bd5784cfd41
parent0b130278a0eb1250e66d57e3c74253d4f0080106
[flang] Change WhyNotModifiable to return optional

One overload of WhyNotModifiable returned an optional message while the
other returns a unique_ptr. Change the latter to be consistent with the
former and other message-returning functions in this file.

Also, reorder the if clauses to reduce the level of indentation.

Original-commit: flang-compiler/f18@864e9cfc7ee98e3646052fdc757943011d641691
Reviewed-on: https://github.com/flang-compiler/f18/pull/1050
Tree-same-pre-rewrite: false
flang/include/flang/Semantics/tools.h
flang/lib/Semantics/check-call.cpp
flang/lib/Semantics/tools.cpp