CloneSet4


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
43230.961statement_seq[4]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
143151
InclusionConstraintGraph/Graph.h
243481
InclusionConstraintGraph/Graph.h
Clone Instance
1
Line Count
43
Source Line
151
Source File
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);


Clone Instance
2
Line Count
43
Source Line
481
Source File
InclusionConstraintGraph/Graph.h

                        // 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);


Clone AbstractionParameter Count: 3Parameter Bindings

// 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 Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#4f811c0]]
equivalent_nodes.Size 
12[[#4f811c0]]
next_path.direct_collapse_nodes->Size 
21[[#4f54660]]
equivalent_nodes 
22[[#4f54660]]
(*next_path.direct_collapse_nodes) 
31[[#4f808c0]]
equivalent_nodes 
32[[#4f808c0]]
*next_path.direct_collapse_nodes