Skip to content

Commit

Permalink
PathEndVisitor::copy const
Browse files Browse the repository at this point in the history
Signed-off-by: James Cherry <[email protected]>
  • Loading branch information
jjcherry56 committed Dec 16, 2021
1 parent cdf590d commit 9da23bc
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 34 deletions.
2 changes: 1 addition & 1 deletion include/sta/VisitPathEnds.hh
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class PathEndVisitor
{
public:
virtual ~PathEndVisitor() {}
virtual PathEndVisitor *copy() = 0;
virtual PathEndVisitor *copy() const = 0;
// Begin visiting the path ends for a vertex / path_index.
virtual void vertexBegin(Vertex *) {}
// Visit a path end. path_end is only valid during the call.
Expand Down
26 changes: 13 additions & 13 deletions search/PathGroup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -518,13 +518,13 @@ PathGroups::makePathEnds(ExceptionTo *to,
class MakePathEnds1 : public PathEndVisitor
{
public:
explicit MakePathEnds1(PathGroups *path_groups);
virtual PathEndVisitor *copy();
MakePathEnds1(PathGroups *path_groups);
MakePathEnds1(const MakePathEnds1&) = default;
virtual PathEndVisitor *copy() const;
virtual void visit(PathEnd *path_end);
virtual void vertexEnd(Vertex *vertex);

private:
DISALLOW_COPY_AND_ASSIGN(MakePathEnds1);
void visitPathEnd(PathEnd *path_end,
PathGroup *group);

Expand All @@ -535,14 +535,14 @@ class MakePathEnds1 : public PathEndVisitor

MakePathEnds1::MakePathEnds1(PathGroups *path_groups) :
path_groups_(path_groups),
cmp_(path_groups){

cmp_(path_groups)
{
}

PathEndVisitor *
MakePathEnds1::copy()
MakePathEnds1::copy() const
{
return new MakePathEnds1(path_groups_);
return new MakePathEnds1(*this);
}

void
Expand Down Expand Up @@ -597,15 +597,15 @@ MakePathEnds1::vertexEnd(Vertex *)
class MakePathEndsAll : public PathEndVisitor
{
public:
explicit MakePathEndsAll(int endpoint_count,
PathGroups *path_groups);
MakePathEndsAll(int endpoint_count,
PathGroups *path_groups);
MakePathEndsAll(const MakePathEndsAll&) = default;
virtual ~MakePathEndsAll();
virtual PathEndVisitor *copy();
virtual PathEndVisitor *copy() const;
virtual void visit(PathEnd *path_end);
virtual void vertexEnd(Vertex *vertex);

private:
DISALLOW_COPY_AND_ASSIGN(MakePathEndsAll);
void visitPathEnd(PathEnd *path_end,
PathGroup *group);

Expand All @@ -629,9 +629,9 @@ MakePathEndsAll::MakePathEndsAll(int endpoint_count,


PathEndVisitor *
MakePathEndsAll::copy()
MakePathEndsAll::copy() const
{
return new MakePathEndsAll(endpoint_count_, path_groups_);
return new MakePathEndsAll(*this);
}

MakePathEndsAll::~MakePathEndsAll()
Expand Down
12 changes: 6 additions & 6 deletions search/Search.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3211,7 +3211,7 @@ class FindEndRequiredVisitor : public PathEndVisitor
const StaState *sta);
FindEndRequiredVisitor(const StaState *sta);
virtual ~FindEndRequiredVisitor();
virtual PathEndVisitor *copy();
virtual PathEndVisitor *copy() const;
virtual void visit(PathEnd *path_end);

protected:
Expand Down Expand Up @@ -3242,7 +3242,7 @@ FindEndRequiredVisitor::~FindEndRequiredVisitor()
}

PathEndVisitor *
FindEndRequiredVisitor::copy()
FindEndRequiredVisitor::copy() const
{
return new FindEndRequiredVisitor(sta_);
}
Expand Down Expand Up @@ -3861,7 +3861,8 @@ class FindEndSlackVisitor : public PathEndVisitor
public:
FindEndSlackVisitor(SlackSeq &slacks,
const StaState *sta);
virtual PathEndVisitor *copy();
FindEndSlackVisitor(const FindEndSlackVisitor &) = default;
virtual PathEndVisitor *copy() const;
virtual void visit(PathEnd *path_end);

protected:
Expand All @@ -3877,10 +3878,9 @@ FindEndSlackVisitor::FindEndSlackVisitor(SlackSeq &slacks,
}

PathEndVisitor *
FindEndSlackVisitor::copy()
FindEndSlackVisitor::copy() const
{

return new FindEndSlackVisitor(slacks_, sta_);
return new FindEndSlackVisitor(*this);
}

void
Expand Down
7 changes: 4 additions & 3 deletions search/Sta.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3040,7 +3040,8 @@ class MinPeriodEndVisitor : public PathEndVisitor
MinPeriodEndVisitor(const Clock *clk,
bool include_port_paths,
StaState *sta);
virtual PathEndVisitor *copy();
MinPeriodEndVisitor(const MinPeriodEndVisitor &) = default;
virtual PathEndVisitor *copy() const;
virtual void visit(PathEnd *path_end);
float minPeriod() const { return min_period_; }

Expand All @@ -3064,9 +3065,9 @@ MinPeriodEndVisitor::MinPeriodEndVisitor(const Clock *clk,
}

PathEndVisitor *
MinPeriodEndVisitor::copy()
MinPeriodEndVisitor::copy() const
{
return new MinPeriodEndVisitor(clk_, include_port_paths_, sta_);
return new MinPeriodEndVisitor(*this);
}

void
Expand Down
20 changes: 9 additions & 11 deletions search/VisitPathGroupVertices.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,18 @@ vertexPathSetMapInsertPath(VertexPathSetMap *matching_path_map,
class VisitPathGroupEnds : public PathEndVisitor
{
public:
explicit VisitPathGroupEnds(PathGroup *path_group,
VertexVisitor *vertex_visitor,
VertexPathSetMap *matching_path_map,
BfsBkwdIterator *bkwd_iter,
StaState *sta);
virtual PathEndVisitor *copy();
VisitPathGroupEnds(PathGroup *path_group,
VertexVisitor *vertex_visitor,
VertexPathSetMap *matching_path_map,
BfsBkwdIterator *bkwd_iter,
StaState *sta);
VisitPathGroupEnds(const VisitPathGroupEnds&) = default;
virtual PathEndVisitor *copy() const;
virtual void visit(PathEnd *path_end);
virtual void vertexBegin(Vertex *vertex);
virtual void vertexEnd(Vertex *vertex);

private:
DISALLOW_COPY_AND_ASSIGN(VisitPathGroupEnds);

PathGroup *path_group_;
VertexVisitor *vertex_visitor_;
BfsBkwdIterator *bkwd_iter_;
Expand Down Expand Up @@ -160,10 +159,9 @@ VisitPathGroupEnds::VisitPathGroupEnds(PathGroup *path_group,
}

PathEndVisitor *
VisitPathGroupEnds::copy()
VisitPathGroupEnds::copy() const
{
return new VisitPathGroupEnds(path_group_, vertex_visitor_,
matching_path_map_, bkwd_iter_, sta_);
return new VisitPathGroupEnds(*this);
}

void
Expand Down

0 comments on commit 9da23bc

Please sign in to comment.