mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
DLA: revive and rework CollapseSingleChild Step
The step now collapse parents with their single child if they are indistinguishable, i.e. if the parent has only that single child, at offset zero, and their size is the same.
This commit is contained in:
@@ -446,10 +446,17 @@ bool LayoutTypeSystem::verifyConsistency() const {
|
||||
unsigned NonPtrChildren = 0U;
|
||||
bool IsPointer = false;
|
||||
for (const auto &Edge : NodePtr->Successors) {
|
||||
if (isPointerEdge(Edge))
|
||||
if (isPointerEdge(Edge)) {
|
||||
// Node with outgoing pointer edges, only have one pointer edge.
|
||||
if (IsPointer) {
|
||||
if (VerifyDLALog.isEnabled())
|
||||
revng_check(false);
|
||||
return false;
|
||||
}
|
||||
IsPointer = true;
|
||||
else if (isInstanceEdge(Edge))
|
||||
} else if (isInstanceEdge(Edge)) {
|
||||
NonPtrChildren++;
|
||||
}
|
||||
|
||||
if (IsPointer and NonPtrChildren > 0) {
|
||||
if (VerifyDLALog.isEnabled())
|
||||
|
||||
Reference in New Issue
Block a user