forked from KhronosGroup/SPIRV-Tools
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add DebugValue for function param regardless of scope (KhronosGroup#3923
) `DebugInfoManager::AddDebugValueIfVarDeclIsVisible()` adds OpenCL.DebugInfo.100 DebugValue from DebugDeclare only when the DebugDeclare is visible to the give scope. It helps us correctly handle a reference variable e.g., { // scope #1. int foo = /* init */; { // scope #2. int& bar = foo; ... in the above code, we must not propagate DebugValue of `int& bar` for store instructions in the scope #1 because it is alive only in the scope #2. We have an exception: If the given DebugDeclare is used for a function parameter, `DebugInfoManager::AddDebugValueIfVarDeclIsVisible()` has to always add DebugValue instruction regardless of the scope. It is because the initializer (store instruction) for the function parameter can be out of the function parameter's scope (the function) in particular when the function was inlined. Without this change, the function parameter value information always disappears whenever we run the function inlining pass and `DebugInfoManager::AddDebugValueIfVarDeclIsVisible()`.
- Loading branch information
Showing
3 changed files
with
116 additions
and
12 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