[flang] Clean up; fix assert and crashes
authorTim Keith <tkeith@nvidia.com>
Thu, 17 May 2018 20:06:38 +0000 (13:06 -0700)
committerTim Keith <tkeith@nvidia.com>
Thu, 17 May 2018 20:06:38 +0000 (13:06 -0700)
commit2fb1c16e942c2faf3709780d47a32b9ca49587a0
tree1d57c68d65673e2f67c31316f5d49eafc519cfd0
parent25bde93144b51af4d87e5f2cee0d1477d5ba79ad
[flang] Clean up; fix assert and crashes

This is the result of running `f18 -fdebug-resolve-names` on a bunch of
Fortran source and fixing the resulting assertion errors and segmentation
faults.

Most of the problems were with encountering attributes, array specs, or
declaration type specs when we weren't prepared to handle them. Those
were fixed by adding calls to {Begin,End}DeclTypeSpec and {Begin,End}Decl
when encountering certain nodes, though the real work for those nodes is
still to be done.

Extract some common functionality into PostAttrSpec and CheckUseError.

Add missing XOR to GenericSpec.

Original-commit: flang-compiler/f18@3c0ff7ded4b3f5512a03e994edd8a0d5074e1149
Reviewed-on: https://github.com/flang-compiler/f18/pull/93
Tree-same-pre-rewrite: false
flang/lib/semantics/resolve-names.cc
flang/lib/semantics/symbol.cc
flang/lib/semantics/type.cc
flang/lib/semantics/type.h