-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[DebugInfo] Make DIArgList inherit from Metadata and always unique #72147
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1265,9 +1265,8 @@ void SlotTracker::CreateFunctionSlot(const Value *V) { | |
void SlotTracker::CreateMetadataSlot(const MDNode *N) { | ||
assert(N && "Can't insert a null Value into SlotTracker!"); | ||
|
||
// Don't make slots for DIExpressions or DIArgLists. We just print them inline | ||
// everywhere. | ||
if (isa<DIExpression>(N) || isa<DIArgList>(N)) | ||
// Don't make slots for DIExpressions. We just print them inline everywhere. | ||
if (isa<DIExpression>(N)) | ||
Comment on lines
+1268
to
+1269
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To confirm my understanding: the mechanism of print DIArgLists isn't changing at all, but as they're no longer MDNodes, they don't get considered for a metadata-node-number slot so don't need to appear here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct, this function only gets called for MDNodes, so DIArgList doesn't need to care anymore. |
||
return; | ||
|
||
unsigned DestSlot = mdnNext; | ||
|
@@ -3516,8 +3515,6 @@ void AssemblyWriter::printNamedMDNode(const NamedMDNode *NMD) { | |
// Write DIExpressions inline. | ||
// FIXME: Ban DIExpressions in NamedMDNodes, they will serve no purpose. | ||
MDNode *Op = NMD->getOperand(i); | ||
assert(!isa<DIArgList>(Op) && | ||
"DIArgLists should not appear in NamedMDNodes"); | ||
if (auto *Expr = dyn_cast<DIExpression>(Op)) { | ||
writeDIExpression(Out, Expr, AsmWriterContext::getEmpty()); | ||
continue; | ||
|
@@ -4918,7 +4915,7 @@ static void printMetadataImplRec(raw_ostream &ROS, const Metadata &MD, | |
WriteAsOperandInternal(OS, &MD, WriterCtx, /* FromValue */ true); | ||
|
||
auto *N = dyn_cast<MDNode>(&MD); | ||
if (!N || isa<DIExpression>(MD) || isa<DIArgList>(MD)) | ||
if (!N || isa<DIExpression>(MD)) | ||
return; | ||
|
||
OS << " = "; | ||
|
@@ -4986,7 +4983,7 @@ static void printMetadataImpl(raw_ostream &ROS, const Metadata &MD, | |
WriteAsOperandInternal(OS, &MD, *WriterCtx, /* FromValue */ true); | ||
|
||
auto *N = dyn_cast<MDNode>(&MD); | ||
if (OnlyAsOperand || !N || isa<DIExpression>(MD) || isa<DIArgList>(MD)) | ||
if (OnlyAsOperand || !N || isa<DIExpression>(MD)) | ||
return; | ||
|
||
OS << " = "; | ||
|
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.
For my understanding, what are the implications of not having an abbrev here -- will we end up with a potentially suboptimal encoding or something?
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.
DIArgLists have no abbreviations, so this is a no-op I believe.