#
047168da |
| 26-Aug-2024 |
Peter Klausler <35819229+klausler@users.noreply.github.com> |
[flang] Fix parser crash (#105875)
The production for a bare file unit number in an I/O statement checks
that the scalar integer expression isn't followed by "=", in order to
disambiguate FLUSHN f
[flang] Fix parser crash (#105875)
The production for a bare file unit number in an I/O statement checks
that the scalar integer expression isn't followed by "=", in order to
disambiguate FLUSHN from FLUSHN=1, and to not treat a control specifier
keyword as an integer expression. The implementation of this check used
!"="_tok, which has the side effect of producing no error message; this
can lead to a parsing crash later when a failed parse of an erroneous
program is found to have produced no errors. Rewrite as a lookAhead call
for those characters that acually can follow a bare unit number.
Fixes https://github.com/llvm/llvm-project/issues/105779.
show more ...
|
#
cfa032ce |
| 20-Jul-2023 |
Peter Klausler <pklausler@nvidia.com> |
[flang] Emit just one warning for a bad format edit descriptor
An attempt to use an edit descriptor (other than A or L) in a FORMAT statement without arequired 'w' width will elicit warnings from bo
[flang] Emit just one warning for a bad format edit descriptor
An attempt to use an edit descriptor (other than A or L) in a FORMAT statement without arequired 'w' width will elicit warnings from both the parser and the I/O checker in semantics. Remove the warning from the parser.
Differential Revision: https://reviews.llvm.org/D155977
show more ...
|
#
4ad72793 |
| 06-May-2023 |
Peter Klausler <pklausler@nvidia.com> |
[flang] CUDA Fortran - part 1/5: parsing
Begin upstreaming of CUDA Fortran support in LLVM Flang.
This first patch implements parsing for CUDA Fortran syntax, including: - a new LanguageFeature en
[flang] CUDA Fortran - part 1/5: parsing
Begin upstreaming of CUDA Fortran support in LLVM Flang.
This first patch implements parsing for CUDA Fortran syntax, including: - a new LanguageFeature enum value for CUDA Fortran - driver change to enable that feature for *.cuf and *.CUF source files - parse tree representation of CUDA Fortran syntax - dumping and unparsing of the parse tree - the actual parsers for CUDA Fortran syntax - prescanning support for !@CUF and !$CUF - basic sanity testing via unparsing and parse tree dumps
... along with any minimized changes elsewhere to make these work, mostly no-op cases in common::visitors instances in semantics and lowering to allow them to compile in the face of new types in variant<> instances in the parse tree.
Because CUDA Fortran allows the kernel launch chevron syntax ("call foo<<<blocks, threads>>>()") only on CALL statements and not on function references, the parse tree nodes for CallStmt, FunctionReference, and their shared Call were rearranged a bit; this caused a fair amount of one-line changes in many files.
More patches will follow that implement CUDA Fortran in the symbol table and name resolution, and then semantic checking.
Differential Revision: https://reviews.llvm.org/D150159
show more ...
|
#
619b5bfc |
| 10-Oct-2022 |
Peter Klausler <pklausler@nvidia.com> |
[flang] Improve error recovery for bad/missing construct END statements
When a multi-statement construct should end with a particular END statement like "END SELECT", and that construct's END statem
[flang] Improve error recovery for bad/missing construct END statements
When a multi-statement construct should end with a particular END statement like "END SELECT", and that construct's END statement is missing or unrecognizable, the error recovery productions should not misinterpret a program unit END statement that follows and consume it as a misspelled construct END statement. Doing so leads to cascading errors or a failed parse.
Differential Revision: https://reviews.llvm.org/D136896
show more ...
|
#
ac776499 |
| 01-Jul-2022 |
Peter Klausler <pklausler@nvidia.com> |
[flang] Avoid spurious warnings in pedantic mode from FORMAT items
In free form source, pedantic mode will elicit portability warnings about missing spaces when a token string ends with a character
[flang] Avoid spurious warnings in pedantic mode from FORMAT items
In free form source, pedantic mode will elicit portability warnings about missing spaces when a token string ends with a character that can be in an identifier and there is no space between that last token character and a following character that can also be part of an identifier.
This behavior doesn't really work well for the token strings that are parsed for edit descriptors in FORMAT statements. For example, the 'F' in FORMAT(F7.3) is followed by a digit, but obviously no space is necessary. Free form or not, FORMATs are their own odd little world.
This patch adds trailing blanks to these FORMAT edit descriptor token parsers to disable the missing space check, and extends the documentation for token string parsing to explain why this technique works.
Differential Revision: https://reviews.llvm.org/D129023
show more ...
|
#
2d8b6a47 |
| 14-Mar-2022 |
Peter Klausler <pklausler@nvidia.com> |
[flang] Add explanatory messages to grammar for language extensions
Extend "extension<LanguageFeature>()" to incorporate an explanatory message better than the current generic "nonstandard usage:".
[flang] Add explanatory messages to grammar for language extensions
Extend "extension<LanguageFeature>()" to incorporate an explanatory message better than the current generic "nonstandard usage:".
Differential Revision: https://reviews.llvm.org/D122035
show more ...
|
#
f0ffc690 |
| 30-Jan-2021 |
peter klausler <pklausler@nvidia.com> |
[flang] Fix parsing of WRITE(I+J) with more accurate look-ahead
The parsing of I/O units uses look-ahead to discriminate between keywords, variables and expressions as part of distinguishing interna
[flang] Fix parsing of WRITE(I+J) with more accurate look-ahead
The parsing of I/O units uses look-ahead to discriminate between keywords, variables and expressions as part of distinguishing internal from external I/O. The look-ahead was inaccurate for variables that appear as the initial parts of expressions.
Differential Revision: https://reviews.llvm.org/D95743
show more ...
|
#
6c516cda |
| 12-Nov-2020 |
peter klausler <pklausler@nvidia.com> |
[flang] Recognize END FILE as ENDFILE in free form source
The ENDFILE statement may be spelled as two words.
Differential revision: https://reviews.llvm.org/D91377
|
#
4acd8f7f |
| 30-Oct-2020 |
peter klausler <pklausler@nvidia.com> |
[flang] Detect and rewrite ambiguous READ(CVAR)[,item-list]
READ(CVAR)[,item-list] with a character variable CVAR could be parsed as an unformatted READ from an internal unit or as a formatted READ
[flang] Detect and rewrite ambiguous READ(CVAR)[,item-list]
READ(CVAR)[,item-list] with a character variable CVAR could be parsed as an unformatted READ from an internal unit or as a formatted READ from the default external unit with a needlessly parenthesized variable format. We parse it as the former, but Fortran doesn't have unformatted internal I/O.
Differential revision: https://reviews.llvm.org/D90493
show more ...
|
#
c9637577 |
| 02-Sep-2020 |
peter klausler <pklausler@nvidia.com> |
[flang] Implement nonstandard OPEN statement CARRIAGECONTROL specifier
Differential Revision: https://reviews.llvm.org/D87052
|
#
455ed8de |
| 03-Apr-2020 |
peter klausler <pklausler@nvidia.com> |
[flang] Process names in ASSIGN and assigned GOTO
Allow ASSIGNed integer variables as formats
Address review comment
Original-commit: flang-compiler/f18@361a151508b4a1940fc0669dead180be67964d8d Re
[flang] Process names in ASSIGN and assigned GOTO
Allow ASSIGNed integer variables as formats
Address review comment
Original-commit: flang-compiler/f18@361a151508b4a1940fc0669dead180be67964d8d Reviewed-on: https://github.com/flang-compiler/f18/pull/1099
show more ...
|
#
1f879005 |
| 29-Mar-2020 |
Tim Keith <tkeith@nvidia.com> |
[flang] Reformat with latest clang-format and .clang-format
Original-commit: flang-compiler/f18@9fe84f45d7fd685051004678d6b5775dcc4c6f8f Reviewed-on: https://github.com/flang-compiler/f18/pull/1094
|
#
64ab3302 |
| 25-Feb-2020 |
CarolineConcatto <51754594+CarolineConcatto@users.noreply.github.com> |
[flang] [LLVMify F18] Compiler module folders should have capitalised names (flang-compiler/f18#980)
This patch renames the modules in f18 to use a capital letter in the
module name
Signed-off-b
[flang] [LLVMify F18] Compiler module folders should have capitalised names (flang-compiler/f18#980)
This patch renames the modules in f18 to use a capital letter in the
module name
Signed-off-by: Caroline Concatto <caroline.concatto@arm.com>
Original-commit: flang-compiler/f18@d2eb7a1c443d1539ef12b6f027074a0eb15b1ea0 Reviewed-on: https://github.com/flang-compiler/f18/pull/980
show more ...
|