[flang-commits] [flang] [flang] Enhance location information (PR #95862)

Valentin Clement バレンタイン クレメン via flang-commits flang-commits at lists.llvm.org
Fri Jul 19 09:33:20 PDT 2024


Valentin Clement =?utf-8?b?KOODkOODrOODsw=?=,Valentin Clement
 <clementval at gmail.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/95862 at github.com>


================
@@ -0,0 +1,13 @@
+! RUN: bbc -emit-hlfir --mlir-print-debuginfo %s -o - | FileCheck %s
+
+program test
+include 'location0.inc'
+
+end 
+
+! CHECK-LABEL: func.func @_QQmain() attributes {fir.bindc_name = "test"} {
+! CHECK: fir.call @_FortranAioOutputAscii(%{{.*}}, %{{.*}}, %{{.*}}) fastmath<contract> : (!fir.ref<i8>, !fir.ref<i8>, i64) -> i1 loc(fused<#fir<loc_kind_array[ base,  inclusion,  inclusion]>>["{{.*}}flang/test/Lower/location1.inc":1:10, "{{.*}}flang/test/Lower/location0.inc":1:1, "{{.*}}flang/test/Lower/location.f90":4:1])
+! CHECK: return loc("{{.*}}flang/test/Lower/location.f90":6:1)
+! CHECK: } loc("{{.*}}flang/test/Lower/location.f90":3:1)
----------------
clementval wrote:

```suggestion
! CHECK: fir.call @_FortranAioOutputAscii(%{{.*}}, %{{.*}}, %{{.*}}) fastmath<contract> : (!fir.ref<i8>, !fir.ref<i8>, i64) -> i1 loc(fused<#fir<loc_kind_array[ base,  inclusion,  inclusion]>>["{{.*}}location1.inc":1:10, "{{.*}}location0.inc":1:1, "{{.*}}flang/test/Lower/location.f90":4:1])
! CHECK: return loc("{{.*}}location.f90":6:1)
! CHECK: } loc("{{.*}}location.f90":3:1)
```

https://github.com/llvm/llvm-project/pull/95862


More information about the flang-commits mailing list