[flang] Support correct continuations for compiler directives
authorDaniil Dudkin <d.dudkin@partner.samsung.com>
Fri, 27 May 2022 10:45:15 +0000 (13:45 +0300)
committerDaniil Dudkin <d.dudkin@partner.samsung.com>
Fri, 27 May 2022 10:45:37 +0000 (13:45 +0300)
commit889c7c8e9260932dce5367df3f7ed7ecc32dbe8e
tree1b2d36b61b11e9c4ce8a783cc8f1d6ecc8e1ab80
parent3e450d9cbbc00b78eebe122cdbec70bd315167e3
[flang] Support correct continuations for compiler directives

If a line is over 72 characters long, flang's preprocessor cuts it there
and continues on the next line.
For this purpose it uses the standard way of continuing line with & on each line.
However, it doesn't work with long compiler directives, like OpenMP or OpenACC ones.
The line that continues the directive also has to
contain the corresponding sentinel at the beginning.

This change implements the described functionality.
Also, some code was refactored in order to simplify and reuse existing code.

Reviewed By: klausler

Differential Revision: https://reviews.llvm.org/D126301
flang/lib/Parser/parsing.cpp
flang/test/Preprocessing/pp132.f90 [new file with mode: 0644]
flang/test/Preprocessing/pp133.f90 [new file with mode: 0644]