[flang] Responses to previous review comments, specifically --
authorPeter Steinfeld <psteinfeld@nvidia.com>
Tue, 23 Jul 2019 23:34:55 +0000 (16:34 -0700)
committerPeter Steinfeld <psteinfeld@nvidia.com>
Thu, 25 Jul 2019 20:02:17 +0000 (13:02 -0700)
commit0904c4cfd111073e91ccb13523539c4d377811d4
tree4665b78d80b36dbeeaa86311e7d53308e2d604af
parent814b241b45a34fbd7c77f7d9358d554e7af17793
[flang] Responses to previous review comments, specifically --

 - expression.cc - fixed an error message.  This required changing the tests
 structconst0[3,4].f90
 - tools.[h,cc] - Added a new function called ```WhyNotModifiable()``` to see
 if a name can be modified.  This function returns a string that describes why
 the name cannot be modified.  I changed the existing function
 ```IsModifiable()``` to call ```WhyNotModifiable()```.  I fixed and
 restructured the code for ```GetAssociationRoot()```.  This involved creating
 the mutually recursive function ```GetAssociatedVariable()```.  I added a
 check  to see if a name is an INTENT(IN) dummy argument to the function
 ```IsVariableName()```.
 - resolve-names.cc - Wrote the function ```SayWithReason()``` that allows an
 arbitrary message to be added to an existing message.  I changed the code in
 ```PassesLocalityChecks()``` to call the new function ```WhyNotModifiable()```
 to get the specifics of why a variable name cannot be used in a variable
 modification context and then call the new function ```SayWithReason()``` to
 report the error.  I also cleaned up the code as per Jean's suggestion.

Original-commit: flang-compiler/f18@8a2f4bdfd24a568a87b3bcb9faa9bc87a68eee84
Reviewed-on: https://github.com/flang-compiler/f18/pull/596
Tree-same-pre-rewrite: false
flang/lib/semantics/expression.cc
flang/lib/semantics/resolve-names.cc
flang/lib/semantics/tools.cc
flang/lib/semantics/tools.h
flang/test/semantics/structconst03.f90
flang/test/semantics/structconst04.f90