| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[flang][preprocessing] Handle #include after & line continuation (#93382) Some applications like to use a CPP-style #include directive to pull in a common list of arguments, dummy arguments, or COMMON block variables after a free-form & line continuation marker. This works naturally with compilers that run an actual cpp pass over the input before doing anything specific to Fortran, but it's a case that I missed with this integrated preprocessor. | 2 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang][preprocessor] Support \ as line continuation (#89970) When prescanning a Fortran source file with preprocessing enabled in free source form, interpret a line-ending backslash as a source line continuation marker as a C preprocessor would. This usage isn't completely portable, but it is supported by GNU Fortran and appears in the source for FPM package manager. | 2 年前 | |
[flang] Fix handling of identifier in column 1 of free form continuat… (#146430) …ion line An obsolete flag ("insertASpace_") is being used to signal some cases in the prescanner's implementation of continuation lines when a token should be broken when it straddles a line break. It turns out that it's sufficient to simply note these cases without ever actually inserting a space, so don't do that (fixing the motivating bug). This leaves some variables with obsolete names, so change them as well. This patch handles the third of the three bugs reported in https://github.com/llvm/llvm-project/issues/146362 . | 1 年前 | |
[flang] Don't create bogus tokens from token pasting (##) (#147596) When blank tokens arise from macro replacement in token sequences with token pasting (##), the preprocessor is producing some bogus tokens (e.g., "name(") that can lead to subtle bugs later when macro names are not recognized as such. The fix is to not paste tokens together when the result would not be a valid Fortran or C token in the preprocessing context. | 1 年前 | |
[flang] Fix continuation when line begins with empty macro expansion (#117407) A free form source line that begins with a macro should still be classified as a source line, and have its continuation lines work, even if the macro expands to an empty replacement. Fixes https://github.com/llvm/llvm-project/issues/117297. | 1 年前 | |
[flang] Preserve compiler directives in -E output (#133959) No longer require -fopenmp or -fopenacc with -E, unless specific version number options are also required for predefined macros. This means that most source can be preprocessed with -E and then later compiled with -fopenmp, -fopenacc, or neither. This means that OpenMP conditional compilation lines (!$) are also passed through to -E output. The tricky part of this patch was dealing with the fact that those conditional lines can also contain regular Fortran line continuation, and that now has to be deferred when !$ lines are interspersed. | 1 年前 | |
[flang] Fix Preprocessing/bug129131.F test on Darwin (#123094) On Darwin, the --isysroot flag must also be specified. This happens when either %flang or %flang_fc1 is expanded. As -fc1 must be the first argument, %flang_fc1 must be used in tests, instead of %flang -fc1. | 1 年前 | |
[flang] Don't insert spaces in -E output after line continuation (#135063) See test case. When Fortran line continuation has been used, don't insert spaces in -E formatted output to put things into the right column, as this can break up a token. Fixes https://github.com/llvm/llvm-project/issues/134986. | 1 年前 | |
[flang] Treat conditional comments as comments (#165881) An OpenMP, OpenACC, or CUDA conditional line should be treated as a comment when that's what its payload contains, not as a conditional source line that will confuse the parser when it is indeed just a comment. | 9 个月前 | |
[flang] Line continuation for !@acc and !@cuf conditional lines (#164475) Some Fortran source-level features that work for OpenMP !$ conditional lines, such as free form line continuation, don't work for OpenACC !@acc or CUDA !@cuf conditional lines. Make them less particular. Fixes https://github.com/llvm/llvm-project/issues/164470. | 9 个月前 | |
[flang] Let !@acc and !@cuf conditional lines be continuations (#164892) OpenMP conditional compilation lines (!$) work as continuation lines, but OpenACC and CUDA conditional lines do not. Fixes https://github.com/llvm/llvm-project/issues/164727 and https://github.com/llvm/llvm-project/issues/164708. | 9 个月前 | |
[flang] Tokenize all -D macro bodies, and do it better (#168116) The compiler presently tokenizes the bodies of only function-like macro definitions from the command line, and does so crudely. Tokenize keyword-like macros too, get character literals right, and handle numeric constants correctly. (Also delete two needless functions noticed in characters.h.) Fixes https://github.com/llvm/llvm-project/issues/168077. | 8 个月前 | |
[flang] Skip over fixed form spaces when prescanning exponents & kind… (#145347) … suffixes When performing conditional tokenization of exponents and numeric kind suffixes, be sure to skip over spaces in fixed form source. Fixes https://github.com/llvm/llvm-project/issues/145333. | 1 年前 | |
[flang] Fix crash from empty -DMACRO= (bug #64837) Some vector indexing code in the preprocessor fails with empty tokens or token sequences in predefined macros. Fixes https://github.com/llvm/llvm-project/issues/64837. Differential Revision: https://reviews.llvm.org/D158451 | 2 年前 | |
[flang] Fix prescanner bug w/ empty macros in line continuation (#141274) When processing free form source line continuation, the prescanner treats empty keyword macros as if they were spaces or tabs. After skipping over them, however, there's code that only works if the skipped characters ended with an actual space or tab. If the last skipped item was an empty keyword macro's name, the last character of that name would end up being the first character of the continuation line. Fix. | 1 年前 | |
[flang][driver] Update PP tests to use the new driver Update the preprocessor regression tests to use the new driver if the new driver is built (FLANG_BUILD_NEW_DRIVER=On), otherwise the tests will still run using f18. Summary of changes: - Introduce %flang to the regression tests, which points to the new driver if it is built or otherwise points to f18 - Update all tests in flang/test/Preprocessing/ to use %flang Differential Revision: https://reviews.llvm.org/D94805 | 5 年前 | |
[flang] Treat conditional comments as comments (#165881) An OpenMP, OpenACC, or CUDA conditional line should be treated as a comment when that's what its payload contains, not as a conditional source line that will confuse the parser when it is indeed just a comment. | 9 个月前 | |
[flang] Treat conditional comments as comments (#165881) An OpenMP, OpenACC, or CUDA conditional line should be treated as a comment when that's what its payload contains, not as a conditional source line that will confuse the parser when it is indeed just a comment. | 9 个月前 | |
[flang][preprocessing] Mix preprocessing directives with free form li… (#96244) …ne continuation Allow preprocessing directives to appear between a source line and its continuation, including conditional compilation directives (#if, #ifdef, &c.). Fixes https://github.com/llvm/llvm-project/issues/95476. | 2 年前 | |
[flang] Add __COUNTER__ preprocessor macro (#136827) This commit adds support for the __COUNTER__ preprocessor macro, which works the same as the one found in clang. It is useful to generate unique names at compile-time. | 1 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Handle "defined" in macro expansions (#114844) The preprocessor implements "defined(X)" and "defined X" in if/elif directive expressions in such a way that they only work at the top level, not when they appear in macro expansions. Fix that, which is a little tricky due to the need to detect the "defined" keyword before applying any macro expansion to its argument, and add a bunch of tests. Fixes https://github.com/llvm/llvm-project/issues/114064. | 1 年前 | |
[flang][driver] Update PP tests to use the new driver Update the preprocessor regression tests to use the new driver if the new driver is built (FLANG_BUILD_NEW_DRIVER=On), otherwise the tests will still run using f18. Summary of changes: - Introduce %flang to the regression tests, which points to the new driver if it is built or otherwise points to f18 - Update all tests in flang/test/Preprocessing/ to use %flang Differential Revision: https://reviews.llvm.org/D94805 | 5 年前 | |
[Flang][Driver] Predefine pic/pie macros based on configured level (#153449) Predefine the __pic__/__pie__/__PIC__/__PIE__ macros based on the configured relocation level. This logic mirrors that of the clang driver, where __pic__/__PIC__ are defined for both PIC and PIE modes, but __pie__/__PIE__ are only defined for PIE mode. Fixes https://github.com/llvm/llvm-project/issues/135275 | 11 个月前 | |
[flang][preprocessor] Directive continuation must skip empty macros (#134149) When a compiler directive continuation line starts with keyword macro names that have empty expansions, skip them. | 1 年前 | |
[flang][preprocessor] Finesse disabling of function-like macros (#71589) During function-like macro expansion in a standard C/C++ preprocessor, the macro being expanded is disabled from recursive macro expansion. The implementation in this compiler's preprocessor, however, was too broad; the macro expansion needs to be disabled for the "rescanning" phase only, not for actual argument expansion. (Also corrects an obsolete comment elsewhere that was noticed during reduction of an original test case.) | 2 年前 | |
[flang] Allow Fortran comments after #include path C-style /*comments*/ are removed during preprocessing directive tokenization, but Fortran !comments need to be specifically allowed. Fixes LLVM bugzilla 47466. Differential Revision: https://reviews.llvm.org/D87638 | 5 年前 | |
[flang] Don't perform macro replacement on exponents (#136176) See new test. I inadvertently broke this behavior with a recent fix for another problem, because the effects of the overloaded TokenSequence::Put() member function on token merging were confusing. Rename and document the various overloads. | 1 年前 | |
[flang][Driver] Add support of -fd-lines-as-comments and -fd-lines-as-code flags (#127605) -fd-lines-as-code and -fd-lines-as-comments enables treatment for lines beginning with d or D in fixed form sources. Using these options in free form has no effect. If the -fd-lines-as-code option is given they are treated as if the first column contained a blank. If the -fd-lines-as-comments option is given, they are treated as comment lines. | 1 年前 | |
[flang][preprocessor] Fixed-form continuation across preprocessing di… (#95332) …rective Implement fixed-form line continuation when the continuation line is the result of text produced by an #include or other preprocessing directive. This accommodates the somewhat common practice of putting dummy or actual arguments into a header file and #including it into several code sites. Fixes https://github.com/llvm/llvm-project/issues/78928. | 2 年前 | |
[flang][preprocessor] Fixed-form continuation across preprocessing di… (#95332) …rective Implement fixed-form line continuation when the continuation line is the result of text produced by an #include or other preprocessing directive. This accommodates the somewhat common practice of putting dummy or actual arguments into a header file and #including it into several code sites. Fixes https://github.com/llvm/llvm-project/issues/78928. | 2 年前 | |
[flang] Don't retain FIXED/FREE compiler directives (#160780) Some old code in the prescanner, antedating the current -E output mechanisms, retains the !DIR$ FIXED and !DIR$ FREE directives in the input, and will even generate them to append to the scanned source from source and include files to restore the fixed/free source form distinction. But these directives have not been needed since the -E output generator began generating source form insensitive output, and they can confuse the parser's error recovery when the appended directives follow the END statement. Change their handling so that they're read and respected by the prescanner but no longer retained in either the -E output or the cooked character stream passed on to the parser. Fixes a regression reported by @danielcchen after PR 159834. | 10 个月前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Support -D for function-like macros (#139812) Handle a command-line function-like macro definition like "-Dfoo(a)=...". TODO: error reporting for badly formed argument lists. | 1 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang][Preprocessor] Constrain a bit more implicit continuations D155499 fixed an issue with implicit continuations. The fixes included a nested parenthesis check during definition of a macro which is then carried over in the scanner state. This leads to the following corner case to fail: subroutine foo(a, d) implicit none integer :: a integer :: d ! An implicit continuation won't be considered unless ! the definition of "bar" above is removed/commented call sub(1, 2) end subroutine foo The definition of bar is indeed unbalanced but it is not even used in the code, so it should not impact whether we apply implicit continuation in the expansion of sub. This change aims at addressing this issue by removing the balance check and constraining a bit more when we consider implicit continuations: only when we see a left parenthesis after a function-like macro, not a object-like macro. In this case I think it is OK to (unconditionally) implicitly continue to the next line in search of the corresponding right parenthesis. This is, to my understanding, similar to what the C preprocessor would do according to the description in [1]. [1] https://www.spinellis.gr/blog/20060626/ Differential Revision: https://reviews.llvm.org/D157414 | 2 年前 | |
[flang] Stricter "implicit continuation" in preprocessing The prescanner performs implicit line continuation when it looks like the parenthesized arguments of a call to a function-like macro may span multiple lines. In an attempt to work more like a Fortran-oblivious C preprocessor, the prescanner will act as if the following lines had been continuations so that the function-like macro could be invoked. This still seems like a good idea, but a recent bug report on LLVM's GitHub issue tracker shows one way in which it could trigger inadvertently and mess up a program. So this patch makes the conditions for implicit line continuation much more strict. First, the leading parenthesis has to have been preceded by an identifier that's known to be a macro name. (It doesn't have to be a function-like macro, since it's possible for a keyword-like macro to expand to the name of a function-like macro.) Second, no macro definition can ever have had unbalanced parentheses in its replacement text. Also cleans up some parenthesis recognition code to fix some issues found in testing, so that a token with leading or trailing spaces can still be recognized as a parenthesis or comma. Fixes https://github.com/llvm/llvm-project/issues/63844. Differential Revision: https://reviews.llvm.org/D155499 | 2 年前 | |
[flang] Fix fixed-form continuations of !$ OpenMP conditional lines (#135852) I broke fixed-form line continuation (without !$) for OpenMP !$ conditional compilation lines. Fix it. | 1 年前 | |
[flang][Preprocessor] Constrain a bit more implicit continuations D155499 fixed an issue with implicit continuations. The fixes included a nested parenthesis check during definition of a macro which is then carried over in the scanner state. This leads to the following corner case to fail: subroutine foo(a, d) implicit none integer :: a integer :: d ! An implicit continuation won't be considered unless ! the definition of "bar" above is removed/commented call sub(1, 2) end subroutine foo The definition of bar is indeed unbalanced but it is not even used in the code, so it should not impact whether we apply implicit continuation in the expansion of sub. This change aims at addressing this issue by removing the balance check and constraining a bit more when we consider implicit continuations: only when we see a left parenthesis after a function-like macro, not a object-like macro. In this case I think it is OK to (unconditionally) implicitly continue to the next line in search of the corresponding right parenthesis. This is, to my understanding, similar to what the C preprocessor would do according to the description in [1]. [1] https://www.spinellis.gr/blog/20060626/ Differential Revision: https://reviews.llvm.org/D157414 | 2 年前 | |
[flang][preprocessing] Mix preprocessing directives with free form li… (#96244) …ne continuation Allow preprocessing directives to appear between a source line and its continuation, including conditional compilation directives (#if, #ifdef, &c.). Fixes https://github.com/llvm/llvm-project/issues/95476. | 2 年前 | |
[flang][preprocessing] Mix preprocessing directives with free form li… (#96244) …ne continuation Allow preprocessing directives to appear between a source line and its continuation, including conditional compilation directives (#if, #ifdef, &c.). Fixes https://github.com/llvm/llvm-project/issues/95476. | 2 年前 | |
[flang][preprocessing] Mix preprocessing directives with free form li… (#96244) …ne continuation Allow preprocessing directives to appear between a source line and its continuation, including conditional compilation directives (#if, #ifdef, &c.). Fixes https://github.com/llvm/llvm-project/issues/95476. | 2 年前 | |
[flang][preprocessing] Mix preprocessing directives with free form li… (#96244) …ne continuation Allow preprocessing directives to appear between a source line and its continuation, including conditional compilation directives (#if, #ifdef, &c.). Fixes https://github.com/llvm/llvm-project/issues/95476. | 2 年前 | |
[flang][preprocessing] Mix preprocessing directives with free form li… (#96244) …ne continuation Allow preprocessing directives to appear between a source line and its continuation, including conditional compilation directives (#if, #ifdef, &c.). Fixes https://github.com/llvm/llvm-project/issues/95476. | 2 年前 | |
[flang][preprocessing] Mix preprocessing directives with free form li… (#96244) …ne continuation Allow preprocessing directives to appear between a source line and its continuation, including conditional compilation directives (#if, #ifdef, &c.). Fixes https://github.com/llvm/llvm-project/issues/95476. | 2 年前 | |
[flang] Ensure all warning/portability messages are guarded by Should… (#90518) …Warn() Many warning messages were being emitted unconditionally. Ensure that all warnings are conditional on a true result from a call to common::LanguageFeatureControl::ShouldWarn() so that it is easy for a driver to disable them all, or, in the future, to provide per-warning control over them. | 2 年前 | |
[flang][preprocessor] Change handling of macros in text from Fortran … (#108113) …INCLUDE lines The compiler current treats an INCLUDE line as essentially a synonym for a preprocessing #include directive. The causes macros that have been defined at the point where the INCLUDE line is processed to be replaced within the text of the included file. This behavior is surprising to users who expect an INCLUDE line to be expanded into its contents *after* preprocessing has been applied to the original source file, with no further macro expansion. Change INCLUDE line processing to use a fresh instance of Preprocessor containing no macro definitions except _CUDA in CUDA Fortran compilations and, if the original file was being preprocessed, the standard definitions of __FILE__, __LINE__, and so forth. | 1 年前 | |
[flang][preprocessor] Change handling of macros in text from Fortran … (#108113) …INCLUDE lines The compiler current treats an INCLUDE line as essentially a synonym for a preprocessing #include directive. The causes macros that have been defined at the point where the INCLUDE line is processed to be replaced within the text of the included file. This behavior is surprising to users who expect an INCLUDE line to be expanded into its contents *after* preprocessing has been applied to the original source file, with no further macro expansion. Change INCLUDE line processing to use a fresh instance of Preprocessor containing no macro definitions except _CUDA in CUDA Fortran compilations and, if the original file was being preprocessed, the standard definitions of __FILE__, __LINE__, and so forth. | 1 年前 | |
[flang] Fix preprocessor regression (#134405) For numeric kind suffixes like 1_foo, the preprocessor should be able to perform macro replacement for macros named either "_foo" or "foo". Fixes https://github.com/llvm/llvm-project/issues/133399. | 1 年前 | |
[flang][preprocessor] Expand some keyword macros in quoted character … (#96987) …literals To help port codes from compilers using pre-ANSI C preprocessors, which didn't care much about context when replacing macros, support the replacement of keyword macros in quoted character literals when (and only when) the name of the keyword macro constitutes the entire significant portion of a free form continuation line. See the new test case for a motivating example. Fixes https://github.com/llvm/llvm-project/issues/96781. | 2 年前 | |
[flang] Preserve compiler directives in -E output (#133959) No longer require -fopenmp or -fopenacc with -E, unless specific version number options are also required for predefined macros. This means that most source can be preprocessed with -E and then later compiled with -fopenmp, -fopenacc, or neither. This means that OpenMP conditional compilation lines (!$) are also passed through to -E output. The tricky part of this patch was dealing with the fact that those conditional lines can also contain regular Fortran line continuation, and that now has to be deferred when !$ lines are interspersed. | 1 年前 | |
[flang][preprocessor] Replace macros in some #include directives (#80039) Ensure that #include FOO undergoes macro replacement. But, as is the case with C/C++, continue to not perform macro replacement in a #include directive with <angled brackets>. | 2 年前 | |
[flang] Fix crash due to overly broad assertion (#95809) Fix https://github.com/llvm/llvm-project/issues/95689 and add a regression test. | 2 年前 | |
[flang] Support #if defined when no definitions (#156080) The "defined" operator isn't working in #if/#elif expressions when there are no defined macros. Fix. | 11 个月前 | |
[flang] Don't tokenize an exponent that isn't one (#117061) The character 'e' or 'd' (either case) shouldn't be tokenized as part of a real literal during preprocessing if it is not followed by an optionally-signed digit string. Doing so prevents it from being recognized as a macro name, or as the start of one. Fixes https://github.com/llvm/llvm-project/issues/115676. | 1 年前 | |
[flang][OpenMP] Use OmpDirectiveSpecification in METADIRECTIVE (#159577) | 10 个月前 | |
[flang][nfc] Add a regression test for #50993 https://bugs.llvm.org/show_bug.cgi?id=50993 was effectively fixed in https://reviews.llvm.org/D106727. This patch adds a regression test specifically for the use case reported in 50993. Differential Revision: https://reviews.llvm.org/D107260 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Handle more use cases reported for issues/78797 (#79628) I implemented legacy "token pasting" via line continuation for call prefix& &MACRO& &suffix(1) in a recent patch; this patch addresses the related cases call prefix& &MACRO& &(1) and call & &MACRO& &suffix(1) Fixes the latest https://github.com/llvm/llvm-project/issues/79590. | 2 年前 | |
[flang] Handle more use cases reported for issues/78797 (#79628) I implemented legacy "token pasting" via line continuation for call prefix& &MACRO& &suffix(1) in a recent patch; this patch addresses the related cases call prefix& &MACRO& &(1) and call & &MACRO& &suffix(1) Fixes the latest https://github.com/llvm/llvm-project/issues/79590. | 2 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Retain spaces when preprocessing fixed-form source (#112417) When running fixed-form source through the compiler under -E, don't aggressively remove space characters, since the parser won't be parsing the result and some tools might need to see the spaces in the -E preprocessed output. Fixes https://github.com/llvm/llvm-project/issues/112279. | 1 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Retain spaces when preprocessing fixed-form source (#112417) When running fixed-form source through the compiler under -E, don't aggressively remove space characters, since the parser won't be parsing the result and some tools might need to see the spaces in the -E preprocessed output. Fixes https://github.com/llvm/llvm-project/issues/112279. | 1 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang][driver] Update PP tests to use the new driver Update the preprocessor regression tests to use the new driver if the new driver is built (FLANG_BUILD_NEW_DRIVER=On), otherwise the tests will still run using f18. Summary of changes: - Introduce %flang to the regression tests, which points to the new driver if it is built or otherwise points to f18 - Update all tests in flang/test/Preprocessing/ to use %flang Differential Revision: https://reviews.llvm.org/D94805 | 5 年前 | |
[flang] Retain spaces when preprocessing fixed-form source (#112417) When running fixed-form source through the compiler under -E, don't aggressively remove space characters, since the parser won't be parsing the result and some tools might need to see the spaces in the -E preprocessed output. Fixes https://github.com/llvm/llvm-project/issues/112279. | 1 年前 | |
[flang][driver] Update PP tests to use the new driver Update the preprocessor regression tests to use the new driver if the new driver is built (FLANG_BUILD_NEW_DRIVER=On), otherwise the tests will still run using f18. Summary of changes: - Introduce %flang to the regression tests, which points to the new driver if it is built or otherwise points to f18 - Update all tests in flang/test/Preprocessing/ to use %flang Differential Revision: https://reviews.llvm.org/D94805 | 5 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Diagnose fixed form statement that begins with continuation line A fixed form continuation line should not be the first line of a statement; emit a warning if it looks like one is so that the programmer can look for a missing card. Differential Revision: https://reviews.llvm.org/D142763 | 3 年前 | |
[flang] Fix handling of space between # and name in preprocessor stringification When preprocessing "# ARG" in function-like macro expansion, the preprocessor needs to pop the previously-pushed '#' token from the end of the resulting token sequence after detecting the argument name. The code to do this was just wrong in a couple of ways. Differential Revision: https://reviews.llvm.org/D117148 | 4 年前 | |
[flang] Don't check fixed form label field too early (#117040) When a fixed form source line begins with the name of a macro, don't emit the usual warning message about a non-decimal character in the label field. (The check for a macro was only being applied to free form source lines, and the label field checking was unconditional). Fixes https://github.com/llvm/llvm-project/issues/116914. | 1 年前 | |
[flang][preprocessor] Further macro replacement of continued identifiers (#134302) The preprocessor can perform macro replacement within identifiers when they are split up with Fortran line continuation, but is failing to do macro replacement on a continued identifier when none of its parts are replaced. | 1 年前 | |
[flang] Fix #else with trailing text (#138045) Fixed the issue, where the extra text on #else line (' Z' in the example below) caused the data from the "else" clause to be processed together with the data of "then" clause. #ifndef XYZ42 PARAMETER(A=2) #else Z PARAMETER(A=3) #endif end | 1 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang][driver] Update PP tests to use the new driver Update the preprocessor regression tests to use the new driver if the new driver is built (FLANG_BUILD_NEW_DRIVER=On), otherwise the tests will still run using f18. Summary of changes: - Introduce %flang to the regression tests, which points to the new driver if it is built or otherwise points to f18 - Update all tests in flang/test/Preprocessing/ to use %flang Differential Revision: https://reviews.llvm.org/D94805 | 5 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Handle more use cases reported for issues/78797 (#79628) I implemented legacy "token pasting" via line continuation for call prefix& &MACRO& &suffix(1) in a recent patch; this patch addresses the related cases call prefix& &MACRO& &(1) and call & &MACRO& &suffix(1) Fixes the latest https://github.com/llvm/llvm-project/issues/79590. | 2 年前 | |
[flang] Handle more use cases reported for issues/78797 (#79628) I implemented legacy "token pasting" via line continuation for call prefix& &MACRO& &suffix(1) in a recent patch; this patch addresses the related cases call prefix& &MACRO& &(1) and call & &MACRO& &suffix(1) Fixes the latest https://github.com/llvm/llvm-project/issues/79590. | 2 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang][driver] Update PP tests to use the new driver Update the preprocessor regression tests to use the new driver if the new driver is built (FLANG_BUILD_NEW_DRIVER=On), otherwise the tests will still run using f18. Summary of changes: - Introduce %flang to the regression tests, which points to the new driver if it is built or otherwise points to f18 - Update all tests in flang/test/Preprocessing/ to use %flang Differential Revision: https://reviews.llvm.org/D94805 | 5 年前 | |
[flang][driver] Update PP tests to use the new driver Update the preprocessor regression tests to use the new driver if the new driver is built (FLANG_BUILD_NEW_DRIVER=On), otherwise the tests will still run using f18. Summary of changes: - Introduce %flang to the regression tests, which points to the new driver if it is built or otherwise points to f18 - Update all tests in flang/test/Preprocessing/ to use %flang Differential Revision: https://reviews.llvm.org/D94805 | 5 年前 | |
[flang] Fix handling of identifier in column 1 of free form continuat… (#146430) …ion line An obsolete flag ("insertASpace_") is being used to signal some cases in the prescanner's implementation of continuation lines when a token should be broken when it straddles a line break. It turns out that it's sufficient to simply note these cases without ever actually inserting a space, so don't do that (fixing the motivating bug). This leaves some variables with obsolete names, so change them as well. This patch handles the third of the three bugs reported in https://github.com/llvm/llvm-project/issues/146362 . | 1 年前 | |
[flang] Fix handling of identifier in column 1 of free form continuat… (#146430) …ion line An obsolete flag ("insertASpace_") is being used to signal some cases in the prescanner's implementation of continuation lines when a token should be broken when it straddles a line break. It turns out that it's sufficient to simply note these cases without ever actually inserting a space, so don't do that (fixing the motivating bug). This leaves some variables with obsolete names, so change them as well. This patch handles the third of the three bugs reported in https://github.com/llvm/llvm-project/issues/146362 . | 1 年前 | |
[flang][driver] Update PP tests to use the new driver Update the preprocessor regression tests to use the new driver if the new driver is built (FLANG_BUILD_NEW_DRIVER=On), otherwise the tests will still run using f18. Summary of changes: - Introduce %flang to the regression tests, which points to the new driver if it is built or otherwise points to f18 - Update all tests in flang/test/Preprocessing/ to use %flang Differential Revision: https://reviews.llvm.org/D94805 | 5 年前 | |
[flang][driver] Update PP tests to use the new driver Update the preprocessor regression tests to use the new driver if the new driver is built (FLANG_BUILD_NEW_DRIVER=On), otherwise the tests will still run using f18. Summary of changes: - Introduce %flang to the regression tests, which points to the new driver if it is built or otherwise points to f18 - Update all tests in flang/test/Preprocessing/ to use %flang Differential Revision: https://reviews.llvm.org/D94805 | 5 年前 | |
[flang] Fix handling of identifier in column 1 of free form continuat… (#146430) …ion line An obsolete flag ("insertASpace_") is being used to signal some cases in the prescanner's implementation of continuation lines when a token should be broken when it straddles a line break. It turns out that it's sufficient to simply note these cases without ever actually inserting a space, so don't do that (fixing the motivating bug). This leaves some variables with obsolete names, so change them as well. This patch handles the third of the three bugs reported in https://github.com/llvm/llvm-project/issues/146362 . | 1 年前 | |
[flang] Fix handling of identifier in column 1 of free form continuat… (#146430) …ion line An obsolete flag ("insertASpace_") is being used to signal some cases in the prescanner's implementation of continuation lines when a token should be broken when it straddles a line break. It turns out that it's sufficient to simply note these cases without ever actually inserting a space, so don't do that (fixing the motivating bug). This leaves some variables with obsolete names, so change them as well. This patch handles the third of the three bugs reported in https://github.com/llvm/llvm-project/issues/146362 . | 1 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang][driver] Update PP tests to use the new driver Update the preprocessor regression tests to use the new driver if the new driver is built (FLANG_BUILD_NEW_DRIVER=On), otherwise the tests will still run using f18. Summary of changes: - Introduce %flang to the regression tests, which points to the new driver if it is built or otherwise points to f18 - Update all tests in flang/test/Preprocessing/ to use %flang Differential Revision: https://reviews.llvm.org/D94805 | 5 年前 | |
[flang][driver] Update PP tests to use the new driver Update the preprocessor regression tests to use the new driver if the new driver is built (FLANG_BUILD_NEW_DRIVER=On), otherwise the tests will still run using f18. Summary of changes: - Introduce %flang to the regression tests, which points to the new driver if it is built or otherwise points to f18 - Update all tests in flang/test/Preprocessing/ to use %flang Differential Revision: https://reviews.llvm.org/D94805 | 5 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang][driver] Update PP tests to use the new driver Update the preprocessor regression tests to use the new driver if the new driver is built (FLANG_BUILD_NEW_DRIVER=On), otherwise the tests will still run using f18. Summary of changes: - Introduce %flang to the regression tests, which points to the new driver if it is built or otherwise points to f18 - Update all tests in flang/test/Preprocessing/ to use %flang Differential Revision: https://reviews.llvm.org/D94805 | 5 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang] Stricter "implicit continuation" in preprocessing The prescanner performs implicit line continuation when it looks like the parenthesized arguments of a call to a function-like macro may span multiple lines. In an attempt to work more like a Fortran-oblivious C preprocessor, the prescanner will act as if the following lines had been continuations so that the function-like macro could be invoked. This still seems like a good idea, but a recent bug report on LLVM's GitHub issue tracker shows one way in which it could trigger inadvertently and mess up a program. So this patch makes the conditions for implicit line continuation much more strict. First, the leading parenthesis has to have been preceded by an identifier that's known to be a macro name. (It doesn't have to be a function-like macro, since it's possible for a keyword-like macro to expand to the name of a function-like macro.) Second, no macro definition can ever have had unbalanced parentheses in its replacement text. Also cleans up some parenthesis recognition code to fix some issues found in testing, so that a token with leading or trailing spaces can still be recognized as a parenthesis or comma. Fixes https://github.com/llvm/llvm-project/issues/63844. Differential Revision: https://reviews.llvm.org/D155499 | 2 年前 | |
[flang] Produce proper "preprocessor output" for -E option Rename the current -E option to "-E -Xflang -fno-reformat". Add a new Parsing::EmitPreprocessedSource() routine to convert the cooked character stream output of the prescanner back to something more closely resembling output from a traditional preprocessor; call this new routine when -E appears. The new -E output is suitable for use as fixed form Fortran source to compilation by (one hopes) any Fortran compiler. If the original top-level source file had been free form source, the output will be suitable for use as free form source as well; otherwise there may be diagnostics about missing spaces if they were indeed absent in the original fixed form source. Unless the -P option appears, #line directives are interspersed with the output (but be advised, f18 will ignore these if presented with them in a later compilation). An effort has been made to preserve original alphabetic character case and source indentation. Add -P and -fno-reformat to the new drivers. Tweak test options to avoid confusion with prior -E output; use -fno-reformat where needed, but prefer to keep -E, sometimes in concert with -P, on most, updating expected results accordingly. Differential Revision: https://reviews.llvm.org/D106727 | 4 年前 | |
[flang][driver] Update PP tests to use the new driver Update the preprocessor regression tests to use the new driver if the new driver is built (FLANG_BUILD_NEW_DRIVER=On), otherwise the tests will still run using f18. Summary of changes: - Introduce %flang to the regression tests, which points to the new driver if it is built or otherwise points to f18 - Update all tests in flang/test/Preprocessing/ to use %flang Differential Revision: https://reviews.llvm.org/D94805 | 5 年前 | |
[flang][preprocessor] Handle compiler directives with continuations a… (#70128) …fter macro expansion When compiler directives (!$omp) and/or their continuations (!$omp &) are produced by macro expansion, handle those continuations. Also allow a continuation marker (&) to appear in a macro actual argument. | 2 年前 | |
[flang] Fix handling of space between # and name in preprocessor stringification When preprocessing "# ARG" in function-like macro expansion, the preprocessor needs to pop the previously-pushed '#' token from the end of the resulting token sequence after detecting the argument name. The code to do this was just wrong in a couple of ways. Differential Revision: https://reviews.llvm.org/D117148 | 4 年前 | |
[flang] Preserve compiler directives in -E output (#133959) No longer require -fopenmp or -fopenacc with -E, unless specific version number options are also required for predefined macros. This means that most source can be preprocessed with -E and then later compiled with -fopenmp, -fopenacc, or neither. This means that OpenMP conditional compilation lines (!$) are also passed through to -E output. The tricky part of this patch was dealing with the fact that those conditional lines can also contain regular Fortran line continuation, and that now has to be deferred when !$ lines are interspersed. | 1 年前 | |
[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 | 4 年前 | |
[flang][preprocessor] Extend handling of line continuation replacements (#107010) Codes using traditional C preprocessors will sometimes put a keyword macro name in a free form continuation line in order to get macro replacement of part of an identifier, as in call subr_& &N& &(1.) where N is a keyword macro. f18 already handles this case, but not when there is white space between the macro name and the following continuation marker character '&'. Allow white space to appear. Fixes https://github.com/llvm/llvm-project/issues/106931. | 1 年前 | |
[flang][preprocessor] Further macro replacement of continued identifiers (#134302) The preprocessor can perform macro replacement within identifiers when they are split up with Fortran line continuation, but is failing to do macro replacement on a continued identifier when none of its parts are replaced. | 1 年前 | |
[flang] Preserve compiler directives in -E output (#133959) No longer require -fopenmp or -fopenacc with -E, unless specific version number options are also required for predefined macros. This means that most source can be preprocessed with -E and then later compiled with -fopenmp, -fopenacc, or neither. This means that OpenMP conditional compilation lines (!$) are also passed through to -E output. The tricky part of this patch was dealing with the fact that those conditional lines can also contain regular Fortran line continuation, and that now has to be deferred when !$ lines are interspersed. | 1 年前 | |
[flang] Remove macro replacement in angular bracket includes Addresses Github issue [[ https://github.com/llvm/llvm-project/issues/60317 | #60317 ]]. Reviewed By: klausler Differential Revision: https://reviews.llvm.org/D143469 | 3 年前 | |
[flang] Retain spaces when preprocessing fixed-form source (#112417) When running fixed-form source through the compiler under -E, don't aggressively remove space characters, since the parser won't be parsing the result and some tools might need to see the spaces in the -E preprocessed output. Fixes https://github.com/llvm/llvm-project/issues/112279. | 1 年前 | |
[flang] Accept a compiler directive sentinel after a semicolon (#96966) Don't treat !DIR$ or an active !$ACC, !$OMP, &c. as a comment when they appear after a semicolon, but instead treat them as a compiler directive sentinel. | 2 年前 | |
[flang][Frontend] Implement printing defined macros via -dM (#87627) This should work the same way as in clang. | 2 年前 | |
[flang][Frontend] Implement printing defined macros via -dM (#87627) This should work the same way as in clang. | 2 年前 | |
[flang][Frontend] Implement printing defined macros via -dM (#87627) This should work the same way as in clang. | 2 年前 | |
[flang][preprocessor] Support __TIMESTAMP__ (#98057) Support the predefined macro __TIMESTAMP__ as interpreted by GCC. It expands to a character literal with the time of last modification of the top-level source file in asctime(3) format, e.g. "Tue Jul 4 10:18:05 1776". | 2 年前 | |
[flang] Handle preprocessor macro expansion edge case (#73835) When a reference to a function-like macro begins during the rescanning of the expansion of another macro but is not completed by the end of that expansion, it is necessary to abort that rescanning of that expansion and try again when more tokens can be acquired. (See the new unclosed-FLM.F90 test case.) All other Fortran preprocessors to which I have access can handle this situation. | 2 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 2 年前 | ||
| 4 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 9 个月前 | ||
| 9 个月前 | ||
| 9 个月前 | ||
| 8 个月前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 5 年前 | ||
| 9 个月前 | ||
| 9 个月前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 4 年前 | ||
| 1 年前 | ||
| 5 年前 | ||
| 11 个月前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 5 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 10 个月前 | ||
| 4 年前 | ||
| 1 年前 | ||
| 4 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 11 个月前 | ||
| 1 年前 | ||
| 10 个月前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 1 年前 | ||
| 4 年前 | ||
| 1 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 5 年前 | ||
| 1 年前 | ||
| 5 年前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 5 年前 | ||
| 4 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 4 年前 | ||
| 5 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 2 年前 | ||
| 4 年前 | ||
| 5 年前 | ||
| 2 年前 | ||
| 4 年前 | ||
| 1 年前 | ||
| 4 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 3 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 |