Skip to content

Commit

Permalink
MaxSkew use copy constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
jjcherry56 committed Jan 8, 2020
1 parent f07e3d2 commit b49f78a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
17 changes: 5 additions & 12 deletions search/CheckMaxSkews.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void
MaxSkewChecksVisitor::visit(MaxSkewCheck &check,
const StaState *)
{
checks_.push_back(check.copy());
checks_.push_back(new MaxSkewCheck(check));
}

class MaxSkewViolatorsVisititor : public MaxSkewCheckVisitor
Expand All @@ -108,7 +108,7 @@ MaxSkewViolatorsVisititor::visit(MaxSkewCheck &check,
const StaState *sta)
{
if (fuzzyLess(check.slack(sta), 0.0))
checks_.push_back(check.copy());
checks_.push_back(new MaxSkewCheck(check));
}

MaxSkewCheckSeq &
Expand Down Expand Up @@ -146,11 +146,10 @@ MaxSkewSlackVisitor::visit(MaxSkewCheck &check,
const StaState *sta)
{
MaxSkewSlackLess slack_less(sta);
if (min_slack_check_ == nullptr)
min_slack_check_ = check.copy();
else if (slack_less(&check, min_slack_check_)) {
if (min_slack_check_ == nullptr
|| slack_less(&check, min_slack_check_)) {
delete min_slack_check_;
min_slack_check_ = check.copy();
min_slack_check_ = new MaxSkewCheck(check);
}
}

Expand Down Expand Up @@ -235,12 +234,6 @@ MaxSkewCheck::MaxSkewCheck(PathVertex *clk_path,
{
}

MaxSkewCheck *
MaxSkewCheck::copy()
{
return new MaxSkewCheck(&clk_path_, &ref_path_, check_arc_, check_edge_);
}

Pin *
MaxSkewCheck::clkPin(const StaState *sta) const
{
Expand Down
3 changes: 0 additions & 3 deletions search/CheckMaxSkews.hh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public:
PathVertex *ref_path,
TimingArc *check_arc,
Edge *check_edge);
MaxSkewCheck *copy();
PathVertex *clkPath() { return &clk_path_; }
Pin *clkPin(const StaState *sta) const;
PathVertex *refPath() { return &ref_path_; }
Expand All @@ -69,8 +68,6 @@ public:
TimingArc *checkArc() const { return check_arc_; }

private:
DISALLOW_COPY_AND_ASSIGN(MaxSkewCheck);

PathVertex clk_path_;
PathVertex ref_path_;
TimingArc *check_arc_;
Expand Down

0 comments on commit b49f78a

Please sign in to comment.