[flang-commits] [PATCH] D153910: [flang] Honor #line and related preprocessing directives

Dominik Adamski via Phabricator via flang-commits flang-commits at lists.llvm.org
Wed Jun 28 03:25:37 PDT 2023


domada added a comment.

LGTM.
Thank you for your patch. 
I tested it, and it solves all issues connected with -save-temps flag, which were mentioned on LLVM discourse <https://discourse.llvm.org/t/rfc-flang-improve-debug-information-user-error-messages-and-fix-openmp-function-mismatch-for-save-temps-flag/71417/16>.
Could you fix one check statement in flang/test/Parser/line-directive.f90 which fails on Windows?



================
Comment at: flang/include/flang/Parser/source.h:75
+  struct SourcePositionOrigin {
+    const std::string &path;
+    int line;
----------------
nit: llvm::StringRef?


================
Comment at: flang/test/Parser/line-directive.f90:2
+! RUN: %flang_fc1 -E %s 2>&1 | FileCheck %s
+!CHECK: #line "{{.*}}/line-directive.f90" 3
+subroutine s
----------------
This check fails on Windows.

```
Input was:
<<<<<<
           1: #line "C:\ws\w3\llvm-project\premerge-checks\flang\test\Parser\line-directive.f90" 3
check:2'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
check:2'1                                                             ?                             possible intended match
           2:  subroutine s
check:2'0     ~~~~~~~~~~~~~~
           3:  implicit none
check:2'0     ~~~~~~~~~~~~~~~
           4:  a = 1.
check:2'0     ~~~~~~~~
           5: #line 101
check:2'0     ~~~~~~~~~~
           6:  b = 2.
check:2'0     ~~~~~~~~
           .
           .
           .
>>>>>>
```
Source: https://buildkite.com/llvm-project/premerge-checks/builds/160946#0188fefb-5134-482b-bece-1e8c7632b903 log line: 6653


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153910/new/

https://reviews.llvm.org/D153910



More information about the flang-commits mailing list