Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
43 | 2 | 3 | 0.961 | statement_seq[4] |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 43 | 151 | InclusionConstraintGraph/Graph.h |
2 | 43 | 481 | InclusionConstraintGraph/Graph.h |
| ||||
// TODO: merge this code with CollapseNodes? // create node representing collapsed cycle Node *collapsed_cycle_node = Node::CreateTemporaryNode(); collapsed_cycle_node->SetCollapsedCycle(Node::IsCollapsedCycle); // remember new node m_collapsed_cycle_nodes.Append(collapsed_cycle_node); // establish inclusion constraints and pointed to locations for collapsed cycle node do { for (std::size_t n=0; n <next_path.direct_collapse_nodes->Size();n++) { Node *node = (*next_path.direct_collapse_nodes)[n]; if (node->GetKind() != Node::FunctionNode) { #if USE_BULK_ESTABLISH_INCLUDES_FOR_CYCLE_NODES collapsed_cycle_node->EstablishIncludes(node->GetInclusionConstraints()); #else const SetOfNodes &inclusion_constraints = node->GetInclusionConstraints(); for (std::size_t ic=0; ic <inclusion_constraints.Size();ic++) { Node *included = inclusion_constraints[ic]->TransitivelyCollapse(); if (included->GetOnPath() != Node::IsMarked) { collapsed_cycle_node->EstablishIncludes(included); } } #endif } if (node->GetKind() == Node::TemporaryNode) { #if USE_BULK_ESTABLISH_POINTS_TO_FOR_CYCLE_NODES collapsed_cycle_node->EstablishPointsTo(node->GetPointedToLocations()); #else const SetOfNodes &pointed_to_locations = node->GetPointedToLocations(); for (std::size_t p=0; p <pointed_to_locations.Size();p++) { collapsed_cycle_node->EstablishPointsTo(pointed_to_locations[p]); } #endif } /* if (node->GetKind() == Node::ObjectNode) { if (node->GetObjectFields().Size() != 0) { std::cerr << "Unexpectedly cycle involving object with fields." << std::endl; } } */ } #if USE_BULK_ESTABLISH_INCLUDES_FOR_CYCLE_NODES collapsed_cycle_node->RemoveIncludes(*next_path.direct_collapse_nodes); #endif } while ( 0); |
| ||||
// create node representing collapsed cycle Node *collapsed_cycle_node = Node::CreateTemporaryNode(); collapsed_cycle_node->SetCollapsedCycle(Node::IsCollapsedCycle); // remember new node m_collapsed_cycle_nodes.Append(collapsed_cycle_node); // establish inclusion constraints and pointed to locations for collapsed cycle node do { for (std::size_t n=0; n <equivalent_nodes.Size();n++) { Node *node = equivalent_nodes[n]; if (node->GetKind() != Node::FunctionNode) { #if USE_BULK_ESTABLISH_INCLUDES_FOR_CYCLE_NODES collapsed_cycle_node->EstablishIncludes(node->GetInclusionConstraints()); #else const SetOfNodes &inclusion_constraints = node->GetInclusionConstraints(); for (std::size_t ic=0; ic <inclusion_constraints.Size();ic++) { Node *included = inclusion_constraints[ic]->TransitivelyCollapse(); if (included->GetOnPath() != Node::IsMarked) { collapsed_cycle_node->EstablishIncludes(included); } } #endif } if (node->GetKind() == Node::TemporaryNode) { #if USE_BULK_ESTABLISH_POINTS_TO_FOR_CYCLE_NODES collapsed_cycle_node->EstablishPointsTo(node->GetPointedToLocations()); #else const SetOfNodes &pointed_to_locations = node->GetPointedToLocations(); for (std::size_t p=0; p <pointed_to_locations.Size();p++) { collapsed_cycle_node->EstablishPointsTo(pointed_to_locations[p]); } #endif } /* if (node->GetKind() == Node::ObjectNode) { if (node->GetObjectFields().Size() != 0) { std::cerr << "Unexpectedly cycle involving object with fields." << std::endl; } } */ } #if USE_BULK_ESTABLISH_INCLUDES_FOR_CYCLE_NODES collapsed_cycle_node->RemoveIncludes(equivalent_nodes); #endif } while ( 0); |
| |||
// TODO: merge this code with CollapseNodes? // create node representing collapsed cycle Node * collapsed_cycle_node = Node::CreateTemporaryNode(); collapsed_cycle_node->SetCollapsedCycle(Node::IsCollapsedCycle); // remember new node m_collapsed_cycle_nodes.Append(collapsed_cycle_node); // establish inclusion constraints and pointed to locations for collapsed cycle node do { for (std::size_t n = 0; n < [[#variable4f811c0]](); n++) { Node * node = [[#variable4f54660]][n]; if (node->GetKind() != Node::FunctionNode) { #if USE_BULK_ESTABLISH_INCLUDES_FOR_CYCLE_NODES collapsed_cycle_node->EstablishIncludes(node->GetInclusionConstraints()); #else const SetOfNodes &inclusion_constraints = node->GetInclusionConstraints(); for (std::size_t ic = 0; ic < inclusion_constraints.Size(); ic++) { Node * included = inclusion_constraints[ic]->TransitivelyCollapse(); if (included->GetOnPath() != Node::IsMarked) { collapsed_cycle_node->EstablishIncludes(included); } } #endif } if (node->GetKind() == Node::TemporaryNode) { #if USE_BULK_ESTABLISH_POINTS_TO_FOR_CYCLE_NODES collapsed_cycle_node->EstablishPointsTo(node->GetPointedToLocations()); #else const SetOfNodes &pointed_to_locations = node->GetPointedToLocations(); for (std::size_t p = 0; p < pointed_to_locations.Size(); p++) { collapsed_cycle_node->EstablishPointsTo(pointed_to_locations[p]); } #endif } /* if (node->GetKind() == Node::ObjectNode) { if (node->GetObjectFields().Size() != 0) { std::cerr << "Unexpectedly cycle involving object with fields." << std::endl; } } */ /* if (node->GetKind() == Node::ObjectNode) { if (node->GetObjectFields().Size() != 0) { std::cerr << "Unexpectedly cycle involving object with fields." << std::endl; } } */ } #if USE_BULK_ESTABLISH_INCLUDES_FOR_CYCLE_NODES collapsed_cycle_node->RemoveIncludes([[#variable4f808c0]]); #endif } while (0); |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#4f811c0]] | equivalent_nodes.Size |
1 | 2 | [[#4f811c0]] | next_path.direct_collapse_nodes->Size |
2 | 1 | [[#4f54660]] | equivalent_nodes |
2 | 2 | [[#4f54660]] | (*next_path.direct_collapse_nodes) |
3 | 1 | [[#4f808c0]] | equivalent_nodes |
3 | 2 | [[#4f808c0]] | *next_path.direct_collapse_nodes |