copy() use copy constructors
Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
parent
e0ddce76ac
commit
afa2286edc
|
|
@ -292,6 +292,7 @@ class FindVertexDelays : public VertexVisitor
|
|||
{
|
||||
public:
|
||||
FindVertexDelays(GraphDelayCalc *graph_delay_calc1);
|
||||
FindVertexDelays(const FindVertexDelays &find_vertex_delays);
|
||||
~FindVertexDelays() override;
|
||||
void visit(Vertex *vertex) override;
|
||||
VertexVisitor *copy() const override;
|
||||
|
|
@ -308,6 +309,11 @@ FindVertexDelays::FindVertexDelays(GraphDelayCalc *graph_delay_calc) :
|
|||
{
|
||||
}
|
||||
|
||||
FindVertexDelays::FindVertexDelays(const FindVertexDelays &find_vertex_delays) :
|
||||
FindVertexDelays(find_vertex_delays.graph_delay_calc_)
|
||||
{
|
||||
}
|
||||
|
||||
FindVertexDelays::~FindVertexDelays()
|
||||
{
|
||||
delete arc_delay_calc_;
|
||||
|
|
@ -318,7 +324,7 @@ FindVertexDelays::copy() const
|
|||
{
|
||||
// Copy StaState::arc_delay_calc_ because it needs separate state
|
||||
// for each thread.
|
||||
return new FindVertexDelays(graph_delay_calc_);
|
||||
return new FindVertexDelays(*this);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -770,6 +770,7 @@ class ArrivalVisitor : public PathVisitor
|
|||
{
|
||||
public:
|
||||
ArrivalVisitor(const StaState *sta);
|
||||
ArrivalVisitor(const ArrivalVisitor &arrival_visitor);
|
||||
~ArrivalVisitor() override;
|
||||
// Initialize the visitor.
|
||||
void init(bool always_to_endpoints,
|
||||
|
|
@ -797,9 +798,6 @@ public:
|
|||
TagGroupBldr *tagBldr() const { return tag_bldr_; }
|
||||
|
||||
protected:
|
||||
ArrivalVisitor(bool always_to_endpoints,
|
||||
SearchPred *pred,
|
||||
const StaState *sta);
|
||||
void init0();
|
||||
void enqueueRefPinInputDelays(const Pin *ref_pin,
|
||||
const Sdc *sdc);
|
||||
|
|
@ -842,6 +840,7 @@ class RequiredVisitor : public PathVisitor
|
|||
{
|
||||
public:
|
||||
RequiredVisitor(const StaState *sta);
|
||||
RequiredVisitor(const RequiredVisitor &required_visitor);
|
||||
~RequiredVisitor() override;
|
||||
VertexVisitor *copy() const override;
|
||||
void visit(Vertex *vertex) override;
|
||||
|
|
@ -862,9 +861,6 @@ public:
|
|||
const MinMax *min_max) override;
|
||||
|
||||
protected:
|
||||
RequiredVisitor(bool make_tag_cache,
|
||||
const StaState *sta);
|
||||
|
||||
RequiredCmp *required_cmp_;
|
||||
VisitPathEnds *visit_path_ends_;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -575,6 +575,7 @@ public:
|
|||
PropActivityVisitor(Power *power,
|
||||
const Mode *mode,
|
||||
BfsFwdIterator *bfs);
|
||||
PropActivityVisitor(const PropActivityVisitor &visitor);
|
||||
VertexVisitor *copy() const override;
|
||||
void visit(Vertex *vertex) override;
|
||||
InstanceSet &visitedRegs() { return visited_regs_; }
|
||||
|
|
@ -606,10 +607,15 @@ PropActivityVisitor::PropActivityVisitor(Power *power,
|
|||
{
|
||||
}
|
||||
|
||||
PropActivityVisitor::PropActivityVisitor(const PropActivityVisitor &visitor) :
|
||||
PropActivityVisitor(visitor.power_, visitor.mode_, visitor.bfs_)
|
||||
{
|
||||
}
|
||||
|
||||
VertexVisitor *
|
||||
PropActivityVisitor::copy() const
|
||||
{
|
||||
return new PropActivityVisitor(power_, mode_, bfs_);
|
||||
return new PropActivityVisitor(*this);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -693,17 +693,11 @@ public:
|
|||
BfsFwdIterator *insert_iter,
|
||||
GenclkInfo *genclk_info,
|
||||
const Mode *mode);
|
||||
GenclkSrcArrivalVisitor(const GenclkSrcArrivalVisitor &visitor);
|
||||
VertexVisitor *copy() const override;
|
||||
void visit(Vertex *vertex) override;
|
||||
|
||||
protected:
|
||||
GenclkSrcArrivalVisitor(Clock *gclk,
|
||||
BfsFwdIterator *insert_iter,
|
||||
GenclkInfo *genclk_info,
|
||||
bool always_to_endpoints,
|
||||
SearchPred *pred,
|
||||
const Mode *mode);
|
||||
|
||||
Clock *gclk_;
|
||||
BfsFwdIterator *insert_iter_;
|
||||
GenclkInfo *genclk_info_;
|
||||
|
|
@ -728,29 +722,22 @@ GenclkSrcArrivalVisitor::GenclkSrcArrivalVisitor(Clock *gclk,
|
|||
{
|
||||
}
|
||||
|
||||
// Copy constructor.
|
||||
GenclkSrcArrivalVisitor::GenclkSrcArrivalVisitor(Clock *gclk,
|
||||
BfsFwdIterator *insert_iter,
|
||||
GenclkInfo *genclk_info,
|
||||
bool always_to_endpoints,
|
||||
SearchPred *pred,
|
||||
const Mode *mode) :
|
||||
ArrivalVisitor(always_to_endpoints, pred, this),
|
||||
gclk_(gclk),
|
||||
insert_iter_(insert_iter),
|
||||
genclk_info_(genclk_info),
|
||||
srch_pred_(gclk, genclk_info, this),
|
||||
mode_(mode),
|
||||
sdc_(mode->sdc()),
|
||||
genclks_(mode->genclks())
|
||||
GenclkSrcArrivalVisitor::GenclkSrcArrivalVisitor(const GenclkSrcArrivalVisitor &visitor) :
|
||||
ArrivalVisitor(static_cast<const ArrivalVisitor &>(visitor)),
|
||||
gclk_(visitor.gclk_),
|
||||
insert_iter_(visitor.insert_iter_),
|
||||
genclk_info_(visitor.genclk_info_),
|
||||
srch_pred_(visitor.gclk_, visitor.genclk_info_, this),
|
||||
mode_(visitor.mode_),
|
||||
sdc_(visitor.sdc_),
|
||||
genclks_(visitor.genclks_)
|
||||
{
|
||||
}
|
||||
|
||||
VertexVisitor *
|
||||
GenclkSrcArrivalVisitor::copy() const
|
||||
{
|
||||
return new GenclkSrcArrivalVisitor(gclk_, insert_iter_, genclk_info_,
|
||||
always_to_endpoints_, pred_, mode_);
|
||||
return new GenclkSrcArrivalVisitor(*this);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -246,6 +246,7 @@ public:
|
|||
bool unique_pins,
|
||||
bool unique_edges,
|
||||
PathEnum *path_enum);
|
||||
PathEnumFaninVisitor(const PathEnumFaninVisitor &visitor);
|
||||
VertexVisitor *copy() const override;
|
||||
void visitFaninPathsThru(Path *before_div,
|
||||
Vertex *prev_vertex,
|
||||
|
|
@ -327,11 +328,16 @@ PathEnumFaninVisitor::PathEnumFaninVisitor(PathEnd *path_end,
|
|||
{
|
||||
}
|
||||
|
||||
PathEnumFaninVisitor::PathEnumFaninVisitor(const PathEnumFaninVisitor &visitor) :
|
||||
PathEnumFaninVisitor(visitor.path_end_, visitor.before_div_, visitor.unique_pins_,
|
||||
visitor.unique_edges_, visitor.path_enum_)
|
||||
{
|
||||
}
|
||||
|
||||
VertexVisitor *
|
||||
PathEnumFaninVisitor::copy() const
|
||||
{
|
||||
return new PathEnumFaninVisitor(path_end_, before_div_, unique_pins_,
|
||||
unique_edges_, path_enum_);
|
||||
return new PathEnumFaninVisitor(*this);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -995,7 +995,7 @@ MakeEndpointPathEnds::~MakeEndpointPathEnds()
|
|||
VertexVisitor *
|
||||
MakeEndpointPathEnds::copy() const
|
||||
{
|
||||
return new MakeEndpointPathEnds(path_end_visitor_, scenes_, min_max_, sta_);
|
||||
return new MakeEndpointPathEnds(*this);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -1090,14 +1090,11 @@ ArrivalVisitor::ArrivalVisitor(const StaState *sta) :
|
|||
init(true, false, nullptr);
|
||||
}
|
||||
|
||||
// Copy constructor.
|
||||
ArrivalVisitor::ArrivalVisitor(bool always_to_endpoints,
|
||||
SearchPred *pred,
|
||||
const StaState *sta) :
|
||||
PathVisitor(pred, true, sta)
|
||||
ArrivalVisitor::ArrivalVisitor(const ArrivalVisitor &arrival_visitor) :
|
||||
PathVisitor(arrival_visitor.pred_, true, &arrival_visitor)
|
||||
{
|
||||
init0();
|
||||
init(always_to_endpoints, false, pred);
|
||||
init(arrival_visitor.always_to_endpoints_, false, arrival_visitor.pred_);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1122,7 +1119,7 @@ ArrivalVisitor::init(bool always_to_endpoints,
|
|||
VertexVisitor *
|
||||
ArrivalVisitor::copy() const
|
||||
{
|
||||
return new ArrivalVisitor(always_to_endpoints_, pred_, this);
|
||||
return new ArrivalVisitor(*this);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1966,7 +1963,10 @@ PathVisitor::PathVisitor(SearchPred *pred,
|
|||
{
|
||||
}
|
||||
|
||||
PathVisitor::~PathVisitor() { delete tag_cache_; }
|
||||
PathVisitor::~PathVisitor()
|
||||
{
|
||||
delete tag_cache_;
|
||||
}
|
||||
|
||||
void
|
||||
PathVisitor::visitFaninPaths(Vertex *to_vertex)
|
||||
|
|
@ -3447,13 +3447,10 @@ RequiredVisitor::RequiredVisitor(const StaState *sta) :
|
|||
{
|
||||
}
|
||||
|
||||
RequiredVisitor::RequiredVisitor(bool make_tag_cache,
|
||||
const StaState *sta) :
|
||||
PathVisitor(sta->search()->evalPred(),
|
||||
make_tag_cache,
|
||||
sta),
|
||||
RequiredVisitor::RequiredVisitor(const RequiredVisitor &required_visitor) :
|
||||
PathVisitor(required_visitor.search()->evalPred(), true, &required_visitor),
|
||||
required_cmp_(new RequiredCmp),
|
||||
visit_path_ends_(new VisitPathEnds(sta))
|
||||
visit_path_ends_(new VisitPathEnds(&required_visitor))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -3466,7 +3463,7 @@ RequiredVisitor::~RequiredVisitor()
|
|||
VertexVisitor *
|
||||
RequiredVisitor::copy() const
|
||||
{
|
||||
return new RequiredVisitor(true, this);
|
||||
return new RequiredVisitor(*this);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Reference in New Issue