Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
56 | 2 | 3 | 0.957 | statement_seq[2] |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 56 | 2672 | InclusionConstraintGraph/Graph.h |
2 | 56 | 2758 | InclusionConstraintGraph/Graph.h |
| ||||
// propagate inclusion constraints do { // propagate inclusion constraints SetOfNodes existing_collapsed_inclusion_constraints; do { const SetOfNodes &inclusion_constraints = existing_collapses_to_node->GetInclusionConstraints(); for (std::size_t ic=0; ic <inclusion_constraints.Size();ic++) { existing_collapsed_inclusion_constraints.Add(inclusion_constraints[ic]->TransitivelyCollapse()); } } while ( 0); do { const SetOfNodes &inclusion_constraints = new_collapses_to_node->GetInclusionConstraints(); for (std::size_t ic=0; ic <inclusion_constraints.Size();ic++) { Node *node = inclusion_constraints[ic]->TransitivelyCollapse(); if (!existing_collapsed_inclusion_constraints.IsIn(node)) { if (node != existing_collapses_to_node) { if (existing_collapses_to_node->EstablishIncludes(node)) { changed_on_read = true; } } } } } while ( 0); // check whether inclusion constraints changed for collapsed node if (!changed_on_read) { SetOfNodes new_collapsed_inclusion_constraints; do { const SetOfNodes &inclusion_constraints = new_collapses_to_node->GetInclusionConstraints(); for (std::size_t ic=0; ic <inclusion_constraints.Size();ic++) { new_collapsed_inclusion_constraints.Add(inclusion_constraints[ic]->TransitivelyCollapse()); } } while ( 0); for (std::size_t n=0; n <existing_collapsed_inclusion_constraints.Size();n++) { if (!new_collapsed_inclusion_constraints.IsIn(existing_collapsed_inclusion_constraints[n])) { changed_on_read = true; break; } } } } while ( 0); // propagate pointed-to locations if (new_collapses_to_node->GetKind() == Node::TemporaryNode) { // propagate pointed-to locations const SetOfNodes &new_pointed_to_locations = new_collapses_to_node->GetPointedToLocations(); for (std::size_t p=0; p <new_pointed_to_locations.Size();p++) { if (existing_collapses_to_node->EstablishPointsTo(new_pointed_to_locations[p])) { changed_on_read = true; } } // check whether pointed-to locations changed for collapsed node if (!changed_on_read) { const SetOfNodes &existing_pointed_to_locations = existing_collapses_to_node->GetPointedToLocations(); for (std::size_t n=0; n <existing_pointed_to_locations.Size();n++) { if (!new_pointed_to_locations.IsIn(existing_pointed_to_locations[n])) { changed_on_read = true; break; } } } } |
| ||||
// propagate inclusion constraints do { // propagate inclusion constraints SetOfNodes to_collapsed_inclusion_constraints; do { const SetOfNodes &inclusion_constraints = to->GetInclusionConstraints(); for (std::size_t ic=0; ic <inclusion_constraints.Size();ic++) { to_collapsed_inclusion_constraints.Add(inclusion_constraints[ic]->TransitivelyCollapse()); } } while ( 0); do { const SetOfNodes &inclusion_constraints = from->GetInclusionConstraints(); for (std::size_t ic=0; ic <inclusion_constraints.Size();ic++) { Node *node = inclusion_constraints[ic]->TransitivelyCollapse(); if (!to_collapsed_inclusion_constraints.IsIn(node)) { if (node != to) { if (to->EstablishIncludes(node)) { changed_on_read = true; } } } } } while ( 0); // check whether inclusion constraints changed for collapsed node if (!changed_on_read) { SetOfNodes new_collapsed_inclusion_constraints; do { const SetOfNodes &inclusion_constraints = from->GetInclusionConstraints(); for (std::size_t ic=0; ic <inclusion_constraints.Size();ic++) { new_collapsed_inclusion_constraints.Add(inclusion_constraints[ic]->TransitivelyCollapse()); } } while ( 0); for (std::size_t n=0; n <to_collapsed_inclusion_constraints.Size();n++) { if (!new_collapsed_inclusion_constraints.IsIn(to_collapsed_inclusion_constraints[n])) { changed_on_read = true; break; } } } } while ( 0); // propagate pointed-to locations if (from->GetKind() == Node::TemporaryNode) { // propagate pointed-to locations const SetOfNodes &new_pointed_to_locations = from->GetPointedToLocations(); for (std::size_t p=0; p <new_pointed_to_locations.Size();p++) { if (to->EstablishPointsTo(new_pointed_to_locations[p])) { changed_on_read = true; } } // check whether pointed-to locations changed for collapsed node if (!changed_on_read) { const SetOfNodes &existing_pointed_to_locations = to->GetPointedToLocations(); for (std::size_t n=0; n <existing_pointed_to_locations.Size();n++) { if (!new_pointed_to_locations.IsIn(existing_pointed_to_locations[n])) { changed_on_read = true; break; } } } } |
| |||
// propagate inclusion constraints do { // propagate inclusion constraints SetOfNodes [[#variable4f6c0e0]]; do { const SetOfNodes &inclusion_constraints = [[#variable4f774c0]]->GetInclusionConstraints(); for (std::size_t ic = 0; ic < inclusion_constraints.Size(); ic++) { [[#variable4f6c0e0]].Add(inclusion_constraints[ic]->TransitivelyCollapse()); } } while (0); do { const SetOfNodes &inclusion_constraints = [[#variable4f5c1e0]]->GetInclusionConstraints(); for (std::size_t ic = 0; ic < inclusion_constraints.Size(); ic++) { Node * node = inclusion_constraints[ic]->TransitivelyCollapse(); if (![[#variable4f6c0e0]].IsIn(node)) { if (node != [[#variable4f774c0]]) { if ([[#variable4f774c0]]->EstablishIncludes(node)) { changed_on_read = true; } } } } } while (0); // check whether inclusion constraints changed for collapsed node if (!changed_on_read) { SetOfNodes new_collapsed_inclusion_constraints; do { const SetOfNodes &inclusion_constraints = [[#variable4f5c1e0]]->GetInclusionConstraints(); for (std::size_t ic = 0; ic < inclusion_constraints.Size(); ic++) { new_collapsed_inclusion_constraints.Add(inclusion_constraints[ic]->TransitivelyCollapse()); } } while (0); for (std::size_t n = 0; n < [[#variable4f6c0e0]].Size(); n++) { if (!new_collapsed_inclusion_constraints.IsIn([[#variable4f6c0e0]][n])) { changed_on_read = true; break; } } } } while (0); // propagate pointed-to locations if ([[#variable4f5c1e0]]->GetKind() == Node::TemporaryNode) { // propagate pointed-to locations const SetOfNodes &new_pointed_to_locations = [[#variable4f5c1e0]]->GetPointedToLocations(); for (std::size_t p = 0; p < new_pointed_to_locations.Size(); p++) { if ([[#variable4f774c0]]->EstablishPointsTo(new_pointed_to_locations[p])) { changed_on_read = true; } } // check whether pointed-to locations changed for collapsed node if (!changed_on_read) { const SetOfNodes &existing_pointed_to_locations = [[#variable4f774c0]]->GetPointedToLocations(); for (std::size_t n = 0; n < existing_pointed_to_locations.Size(); n++) { if (!new_pointed_to_locations.IsIn(existing_pointed_to_locations[n])) { changed_on_read = true; break; } } } } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#4f6c0e0]] | to_collapsed_inclusion_constraints |
1 | 2 | [[#4f6c0e0]] | existing_collapsed_inclusion_constraints |
2 | 1 | [[#4f774c0]] | to |
2 | 2 | [[#4f774c0]] | existing_collapses_to_node |
3 | 1 | [[#4f5c1e0]] | from |
3 | 2 | [[#4f5c1e0]] | new_collapses_to_node |