-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
[HWASAN] NFC? Remove DW_OP_LLVM_tag_offset from DIExpression::isImplicit #79816
Conversation
@llvm/pr-subscribers-debuginfo @llvm/pr-subscribers-llvm-ir Author: Orlando Cazalet-Hyams (OCHyams) ChangesAccording to its doc-comment There's a brief entry for From what I can tell it doesn't look like I'm not 100% confident as I'm not very familiar with This was tripping an assertion (code) in the latest application of the fix to #76545, #78606, where an expression containing a Full diff: https://github.com/llvm/llvm-project/pull/79816.diff 1 Files Affected:
diff --git a/llvm/lib/IR/DebugInfoMetadata.cpp b/llvm/lib/IR/DebugInfoMetadata.cpp
index 51950fc937f0ab..28f96653d815b5 100644
--- a/llvm/lib/IR/DebugInfoMetadata.cpp
+++ b/llvm/lib/IR/DebugInfoMetadata.cpp
@@ -1512,7 +1512,6 @@ bool DIExpression::isImplicit() const {
default:
break;
case dwarf::DW_OP_stack_value:
- case dwarf::DW_OP_LLVM_tag_offset:
return true;
}
}
|
@@ -1512,7 +1512,6 @@ bool DIExpression::isImplicit() const { | |||
default: | |||
break; | |||
case dwarf::DW_OP_stack_value: | |||
case dwarf::DW_OP_LLVM_tag_offset: |
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.
Would this make all expressions with DW_OP_LLVM_tag_offset non implicit?
I don't know implications of this.
Thanks for the review. I'm replying in the main comments so that GitHub doesn't swallow my reply:
Yeah it would. I don't think the presence of a DW_OP_LLVM_tag_offset should qualify an expression as implicit (basically I am thinking the current code is a "bug"). As for the implications, looking at current behaviour at the callsites of In In In Finally, the assert in I think in all these cases it is a mistake to treat an expression containing only a IMO the implication of the function name |
I agree with your analysis above. |
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.
Thanks for the explanation!
isImplicit is meant to return true if the expression is an implicit location description.
Thanks for the reviews. (The force push was just a fix for a typo in my email address in the patch.) |
…lvm#79816) According to its doc-comment `isImplicit` is meant to return true if the expression is an implicit location description (describes an object or part of an object which has no location by computing the value from available program state). There's a brief entry for `DW_OP_LLVM_tag_offset` in the LangRef and there's some info in the original commit fb9ce10. From what I can tell it doesn't look like `DW_OP_LLVM_tag_offset` affects whether or not the location is implicit; the opcode doesn't get included in the final location description but instead is added as an attribute to the variable. This was tripping an assertion in the latest application of the fix to llvm#76545, llvm#78606, where an expression containing a `DW_OP_LLVM_tag_offset` is split into a fragment (i.e., describe a part of the whole variable).
…lvm#79816) According to its doc-comment `isImplicit` is meant to return true if the expression is an implicit location description (describes an object or part of an object which has no location by computing the value from available program state). There's a brief entry for `DW_OP_LLVM_tag_offset` in the LangRef and there's some info in the original commit fb9ce10. From what I can tell it doesn't look like `DW_OP_LLVM_tag_offset` affects whether or not the location is implicit; the opcode doesn't get included in the final location description but instead is added as an attribute to the variable. This was tripping an assertion in the latest application of the fix to llvm#76545, llvm#78606, where an expression containing a `DW_OP_LLVM_tag_offset` is split into a fragment (i.e., describe a part of the whole variable).
According to its doc-comment
isImplicit
is meant to return true if the expression is an implicit location description (describes an object or part of an object which has no location by computing the value from available program state).There's a brief entry for
DW_OP_LLVM_tag_offset
in the LangRef and there's some info in the original commit fb9ce100d19be130d004d03088ccd4af295f3435.From what I can tell it doesn't look like
DW_OP_LLVM_tag_offset
affects whether or not the location is implicit; the opcode doesn't get included in the final location description but instead is added as a attribute to the variable.I'm not 100% confident as I'm not very familiar with
DW_OP_LLVM_tag_offset
. However, applying this change builds (with assertions enabled) an identical clang self hosted binary built with -O2 -g and hwasan, which adds confidence.This was tripping an assertion (code) in the latest application of the fix to #76545, #78606, where an expression containing a
DW_OP_LLVM_tag_offset
is split into a fragment (i.e., describe a part of the whole variable).