forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flang][debug] Don't generate debug for compiler-generated variables (l…
…lvm#112423) Flang generates many globals to handle derived types. There was a check in debug info to filter them based on the information that their names start with a period. This changed since PR#104859 where 'X' is being used instead of '.'. This PR fixes this issue by also adding 'X' in that list. As user variables gets lower cased by the NameUniquer, there is no risk that those will be filtered out. I added a test for that to be sure.
- Loading branch information
Showing
6 changed files
with
49 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
! RUN: %flang_fc1 -emit-llvm -debug-info-kind=standalone %s -o - | FileCheck %s | ||
|
||
module m | ||
integer XcX | ||
end | ||
|
||
! Test that global starting with 'X' don't get filtered. | ||
! CHECK: !DIGlobalVariable(name: "xcx", linkageName: "_QMmExcx"{{.*}}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
! RUN: %flang_fc1 -emit-llvm -debug-info-kind=standalone %s -o - | FileCheck %s | ||
|
||
program test | ||
type t1 | ||
integer :: XcX | ||
integer :: xdtx | ||
end type | ||
type(t1) :: var | ||
var%XcX = 2 | ||
var%xdtx = 3 | ||
end | ||
|
||
! Test that there is no debug info for compiler generated globals. | ||
! CHECK-NOT: DIGlobalVariable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// RUN: fir-opt --add-debug-info --mlir-print-debuginfo %s | FileCheck %s | ||
|
||
module attributes {dlti.dl_spec = #dlti.dl_spec<>} { | ||
fir.global linkonce_odr @_QFEXnXxcx constant target : !fir.char<1,3> { | ||
%0 = fir.string_lit "xcx"(3) : !fir.char<1,3> | ||
fir.has_value %0 : !fir.char<1,3> | ||
} loc(#loc1) | ||
fir.global linkonce_odr @_QFEXnXxdtx constant target : !fir.char<1,4> { | ||
%0 = fir.string_lit "xdtx"(4) : !fir.char<1,4> | ||
fir.has_value %0 : !fir.char<1,4> | ||
} loc(#loc1) | ||
} | ||
#loc1 = loc("derived.f90":24:1) | ||
|
||
// Test that no di_global_variable gets created for these compile generated | ||
// globals. | ||
|
||
// CHECK-NOT: #di_global_variable |