diff --git a/search/Crpr.cc b/search/Crpr.cc index 898a21d6..c692e731 100644 --- a/search/Crpr.cc +++ b/search/Crpr.cc @@ -302,8 +302,8 @@ CheckCrpr::genClkSrcPaths(const PathVertex *path, PathAnalysisPt *path_ap = path->pathAnalysisPt(this); gclk_paths.push_back(path); while (clk_edge->clock()->isGenerated()) { - PathVertex genclk_path; - search_->genclks()->srcPath(clk_edge, clk_src, path_ap, genclk_path); + PathVertex genclk_path = + search_->genclks()->srcPath(clk_edge, clk_src, path_ap); if (genclk_path.isNull()) break; clk_info = genclk_path.clkInfo(this); diff --git a/search/Genclks.cc b/search/Genclks.cc index c0cebf84..d76f0e80 100644 --- a/search/Genclks.cc +++ b/search/Genclks.cc @@ -973,47 +973,40 @@ Genclks::matchesSrcFilter(Path *path, return false; } -void -Genclks::srcPath(Path *clk_path, - // Return value. - PathVertex &src_path) const +PathVertex +Genclks::srcPath(Path *clk_path) const { const Pin *src_pin = clk_path->pin(this); const ClockEdge *clk_edge = clk_path->clkEdge(this); const PathAnalysisPt *path_ap = clk_path->pathAnalysisPt(this); const EarlyLate *early_late = clk_path->minMax(this); PathAnalysisPt *insert_ap = path_ap->insertionAnalysisPt(early_late); - srcPath(clk_edge->clock(), src_pin, clk_edge->transition(), - insert_ap, src_path); + return srcPath(clk_edge->clock(), src_pin, clk_edge->transition(), + insert_ap); } -void +PathVertex Genclks::srcPath(const ClockEdge *clk_edge, const Pin *src_pin, - const PathAnalysisPt *path_ap, - // Return value. - PathVertex &src_path) const + const PathAnalysisPt *path_ap) const { - srcPath(clk_edge->clock(), src_pin, clk_edge->transition(), - path_ap, src_path); + return srcPath(clk_edge->clock(), src_pin, clk_edge->transition(), path_ap); } -void +PathVertex Genclks::srcPath(const Clock *gclk, const Pin *src_pin, const RiseFall *rf, - const PathAnalysisPt *path_ap, - // Return value. - PathVertex &src_path) const + const PathAnalysisPt *path_ap) const { PathVertexRep *src_paths = genclk_src_paths_.findKey(ClockPinPair(gclk, src_pin)); if (src_paths) { int path_index = srcPathIndex(rf, path_ap); - src_path.init(src_paths[path_index], this); + return PathVertex(src_paths[path_index], this); } else - src_path.init(); + return PathVertex(); } Arrival @@ -1023,9 +1016,8 @@ Genclks::insertionDelay(const Clock *clk, const EarlyLate *early_late, const PathAnalysisPt *path_ap) const { - PathVertex src_path; PathAnalysisPt *insert_ap = path_ap->insertionAnalysisPt(early_late); - srcPath(clk, pin, rf, insert_ap, src_path); + PathVertex src_path = srcPath(clk, pin, rf, insert_ap); if (!src_path.isNull()) return src_path.arrival(this); else diff --git a/search/Genclks.hh b/search/Genclks.hh index 4b76b06d..1d8189c4 100644 --- a/search/Genclks.hh +++ b/search/Genclks.hh @@ -71,21 +71,15 @@ public: const EarlyLate *early_late, const PathAnalysisPt *path_ap) const; // Generated clock source path for a clock path root. - void srcPath(Path *clk_path, - // Return value. - PathVertex &src_path) const; + PathVertex srcPath(Path *clk_path) const; // Generated clock source path. - void srcPath(const ClockEdge *clk_edge, - const Pin *src_pin, - const PathAnalysisPt *path_ap, - // Return value. - PathVertex &src_path) const; - void srcPath(const Clock *clk, - const Pin *src_pin, - const RiseFall *rf, - const PathAnalysisPt *path_ap, - // Return value. - PathVertex &src_path) const; + PathVertex srcPath(const ClockEdge *clk_edge, + const Pin *src_pin, + const PathAnalysisPt *path_ap) const; + PathVertex srcPath(const Clock *clk, + const Pin *src_pin, + const RiseFall *rf, + const PathAnalysisPt *path_ap) const; Vertex *srcPathVertex(const Pin *pin) const; Level clkPinMaxLevel(const Clock *clk) const; void copyGenClkSrcPaths(Vertex *vertex, diff --git a/search/PathExpanded.cc b/search/PathExpanded.cc index 6eb2c578..93c54946 100644 --- a/search/PathExpanded.cc +++ b/search/PathExpanded.cc @@ -115,8 +115,7 @@ PathExpanded::expandGenclk(PathRef *clk_path) if (!clk_path->isNull()) { const Clock *src_clk = clk_path->clock(sta_); if (src_clk && src_clk->isGenerated()) { - PathVertex src_path; - sta_->search()->genclks()->srcPath(clk_path, src_path); + PathVertex src_path = sta_->search()->genclks()->srcPath(clk_path); if (!src_path.isNull()) { // The head of the genclk src path is already in paths_, // so skip past it. diff --git a/search/ReportPath.cc b/search/ReportPath.cc index 401301c5..bd23c47d 100644 --- a/search/ReportPath.cc +++ b/search/ReportPath.cc @@ -2394,9 +2394,9 @@ ReportPath::reportGenClkSrcPath1(const Clock *clk, bool clk_used_as_data) const { PathAnalysisPt *insert_ap = path_ap->insertionAnalysisPt(early_late); - PathVertex src_path; const MinMax *min_max = path_ap->pathMinMax(); - search_->genclks()->srcPath(clk, clk_pin, clk_rf, insert_ap, src_path); + PathVertex src_path = + search_->genclks()->srcPath(clk, clk_pin, clk_rf, insert_ap); if (!src_path.isNull()) { ClkInfo *src_clk_info = src_path.clkInfo(search_); const ClockEdge *src_clk_edge = src_clk_info->clkEdge();