[flang] Refactor ModFileReader to use parser::Parsing
authorTim Keith <tkeith@nvidia.com>
Thu, 26 Jul 2018 17:57:51 +0000 (10:57 -0700)
committerTim Keith <tkeith@nvidia.com>
Thu, 26 Jul 2018 17:57:51 +0000 (10:57 -0700)
commit9e483043746586b8f8214640de62a5f29e098cb8
tree75546733d246124fc465fe091d8b2f16b8e2d05e
parentfb8950ee93bdaec2b71cc7285e5342350f7a090c
[flang] Refactor ModFileReader to use parser::Parsing

parser::Parsing does most of the work needed to prescan and parse a file.
The only problem is that for module files we need to take ownership of
the cooked character stream so that it lives as long as the module scope
does.

To achieve this, change Parsing::cooked_ to be a unique_ptr and add a
member function to allow the caller to take ownership of it.

Original-commit: flang-compiler/f18@9088891ab29d91a51c55edb031b5a974cc8254b9
Reviewed-on: https://github.com/flang-compiler/f18/pull/149
Tree-same-pre-rewrite: false
flang/lib/parser/parsing.cc
flang/lib/parser/parsing.h
flang/lib/semantics/mod-file.cc