MaxSkew use copy constructor

This commit is contained in:
James Cherry 2020-01-08 15:20:15 -08:00
parent f07e3d233c
commit b49f78a8a6
2 changed files with 5 additions and 15 deletions

View File

@ -81,7 +81,7 @@ void
MaxSkewChecksVisitor::visit(MaxSkewCheck &check, MaxSkewChecksVisitor::visit(MaxSkewCheck &check,
const StaState *) const StaState *)
{ {
checks_.push_back(check.copy()); checks_.push_back(new MaxSkewCheck(check));
} }
class MaxSkewViolatorsVisititor : public MaxSkewCheckVisitor class MaxSkewViolatorsVisititor : public MaxSkewCheckVisitor
@ -108,7 +108,7 @@ MaxSkewViolatorsVisititor::visit(MaxSkewCheck &check,
const StaState *sta) const StaState *sta)
{ {
if (fuzzyLess(check.slack(sta), 0.0)) if (fuzzyLess(check.slack(sta), 0.0))
checks_.push_back(check.copy()); checks_.push_back(new MaxSkewCheck(check));
} }
MaxSkewCheckSeq & MaxSkewCheckSeq &
@ -146,11 +146,10 @@ MaxSkewSlackVisitor::visit(MaxSkewCheck &check,
const StaState *sta) const StaState *sta)
{ {
MaxSkewSlackLess slack_less(sta); MaxSkewSlackLess slack_less(sta);
if (min_slack_check_ == nullptr) if (min_slack_check_ == nullptr
min_slack_check_ = check.copy(); || slack_less(&check, min_slack_check_)) {
else if (slack_less(&check, min_slack_check_)) {
delete min_slack_check_; delete min_slack_check_;
min_slack_check_ = check.copy(); min_slack_check_ = new MaxSkewCheck(check);
} }
} }
@ -235,12 +234,6 @@ MaxSkewCheck::MaxSkewCheck(PathVertex *clk_path,
{ {
} }
MaxSkewCheck *
MaxSkewCheck::copy()
{
return new MaxSkewCheck(&clk_path_, &ref_path_, check_arc_, check_edge_);
}
Pin * Pin *
MaxSkewCheck::clkPin(const StaState *sta) const MaxSkewCheck::clkPin(const StaState *sta) const
{ {

View File

@ -58,7 +58,6 @@ public:
PathVertex *ref_path, PathVertex *ref_path,
TimingArc *check_arc, TimingArc *check_arc,
Edge *check_edge); Edge *check_edge);
MaxSkewCheck *copy();
PathVertex *clkPath() { return &clk_path_; } PathVertex *clkPath() { return &clk_path_; }
Pin *clkPin(const StaState *sta) const; Pin *clkPin(const StaState *sta) const;
PathVertex *refPath() { return &ref_path_; } PathVertex *refPath() { return &ref_path_; }
@ -69,8 +68,6 @@ public:
TimingArc *checkArc() const { return check_arc_; } TimingArc *checkArc() const { return check_arc_; }
private: private:
DISALLOW_COPY_AND_ASSIGN(MaxSkewCheck);
PathVertex clk_path_; PathVertex clk_path_;
PathVertex ref_path_; PathVertex ref_path_;
TimingArc *check_arc_; TimingArc *check_arc_;