-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Support additional salvage debug info opportunities #39341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support additional salvage debug info opportunities #39341
Conversation
And calling `swift::salvageDebugInfo` in more places. NOTE: The latter change seems to break stdlib build.
This rule tries to prevent two DIVariables -- with different types -- conflicting with each other on the same argument number. If this rule fails, it's highly possible that we forgot to add 'inlinedAt' somewhere.
@swift-ci test |
358e420
to
863184b
Compare
@swift-ci test |
Build failed |
Build failed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you Adrian for wrapping up this patch!
Just want to make sure I understand correctly about this patch: If we're dealing with a debug_value that has a fragment, the debug variable size will essentially be zero. But then I'm wondering: Will LLVM be happy about a !DIVariable
that has zero size?
lib/SIL/Parser/ParseSIL.cpp
Outdated
} | ||
int64_t Val; | ||
// FIXME: Use the correct diagnostic | ||
if (parseInteger(Val, diag::sil_invalid_scope_slot)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you create a new diagnostic message for this? (something like "expecting an integer", or just reuse an existing one)
lib/IRGen/IRGenSIL.cpp
Outdated
if (auto Expr = VarInfo->DIExpr) | ||
if (auto n = Expr.getNumElements()) | ||
if (Expr.getElement(n - 1).getAsOperator() == | ||
SILDIExprOperator::Fragment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think SILDebugInfoExpression::hasFragment
can be used here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better!
lib/IRGen/IRGenSIL.cpp
Outdated
if (auto Expr = VarInfo->DIExpr) | ||
if (auto n = Expr.getNumElements()) | ||
if (Expr.getElement(n - 1).getAsOperator() == | ||
SILDIExprOperator::Fragment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto SILDebugInfoExpression::hasFragment
…he entire type in DebugTypeInfo.
863184b
to
da9af78
Compare
da9af78
to
dc50c93
Compare
@swift-ci test |
Build failed |
Build failed |
This picks up a PR from @mshockwave with some additional bugfixes on top.