Skip to content

Commit 7de25a9

Browse files
authored
Merge pull request #9158 from The-OpenROAD-Project-staging/tidy2
Tidy2
2 parents 1cd463f + ae9757a commit 7de25a9

File tree

135 files changed

+649
-716
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+649
-716
lines changed

etc/run-clang-tidy-cached.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ inline bool IsOneOf(std::string_view s,
152152
// Files that look like relevant include files.
153153
inline bool IsIncludeExtension(std::string_view extension)
154154
{
155-
return IsOneOf(extension, {".h", ".hpp", ".hxx", ".inl"});
155+
return IsOneOf(extension, {".h", ".hh", ".hpp", ".hxx", ".inl"});
156156
}
157157

158158
// Filter for source files to be considered.

src/Main.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// SPDX-License-Identifier: BSD-3-Clause
22
// Copyright (c) 2019-2025, The OpenROAD Authors
33

4-
#include <libgen.h>
54
#include <stdlib.h> // NOLINT(modernize-deprecated-headers): for setenv()
65
#include <strings.h>
76

@@ -371,8 +370,7 @@ std::string findPathToTclreadlineInit(Tcl_Interp* interp)
371370
)";
372371

373372
if (Tcl_Eval(interp, tcl_script) == TCL_ERROR) {
374-
std::cerr << "Tcl_Eval failed: " << Tcl_GetStringResult(interp)
375-
<< std::endl;
373+
std::cerr << "Tcl_Eval failed: " << Tcl_GetStringResult(interp) << '\n';
376374
return "";
377375
}
378376

src/OpenRoad.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ OpenRoad* OpenRoad::openRoad()
166166
void OpenRoad::setOpenRoad(OpenRoad* app, bool reinit_ok)
167167
{
168168
if (!reinit_ok && app_) {
169-
std::cerr << "Attempt to reinitialize the application." << std::endl;
169+
std::cerr << "Attempt to reinitialize the application.\n";
170170
exit(1);
171171
}
172172
app_ = app;

src/ant/src/Polygon.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515

1616
namespace ant {
1717

18+
using gtl::operators::operator+=;
19+
using gtl::operators::operator-=;
20+
using gtl::operators::operator&;
21+
1822
Polygon rectToPolygon(const odb::Rect& rect)
1923
{
2024
std::vector<Point> points{{gtl::construct<Point>(rect.xMin(), rect.yMin()),

src/ant/src/Polygon.hh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace ant {
1313

1414
namespace gtl = boost::polygon;
15-
using namespace gtl::operators;
1615

1716
using Polygon = gtl::polygon_90_data<int>;
1817
using PolygonSet = std::vector<Polygon>;

src/cts/src/LatencyBalancer.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ class LatencyBalancer
6767
openSta_(sta),
6868
wireSegmentUnit_(scalingUnit),
6969
capPerDBU_(capPerDBU),
70-
worseDelay_(std::numeric_limits<float>::min()),
71-
delayBufIndex_(0)
70+
worseDelay_(std::numeric_limits<float>::min())
7271
{
7372
}
7473

@@ -120,9 +119,9 @@ class LatencyBalancer
120119
float bufferDelay_;
121120
double capPerDBU_;
122121
float worseDelay_;
123-
int delayBufIndex_;
122+
int delayBufIndex_{0};
124123
std::vector<GraphNode> graph_;
125124
std::map<std::string, TreeBuilder*> inst2builder_;
126125
};
127126

128-
} // namespace cts
127+
} // namespace cts

src/cut/src/abc_library_factory.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33

44
#include "cut/abc_library_factory.h"
55

6-
#include <string.h>
7-
86
#include <cmath>
7+
#include <cstring>
98
#include <optional>
109
#include <unordered_set>
1110
#include <utility>

src/cut/src/blif.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,12 +301,12 @@ bool Blif::writeBlif(const char* file_name, bool write_arrival_requireds)
301301
if (write_arrival_requireds) {
302302
for (auto& arrival : arrivals_) {
303303
f << ".input_arrival " << arrival.first << " " << arrival.second.first
304-
<< " " << arrival.second.second << std::endl;
304+
<< " " << arrival.second.second << '\n';
305305
}
306306

307307
for (auto& required : requireds_) {
308308
f << ".output_required " << required.first << " " << required.second.first
309-
<< " " << required.second.second << std::endl;
309+
<< " " << required.second.second << '\n';
310310
}
311311
}
312312

src/cut/src/blifParser.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ void BlifParser::addClock(const std::string& clock)
134134
void BlifParser::addNewInstanceType(const std::string& type)
135135
{
136136
if (currentInstanceType_ != GateType::None) {
137-
gates_.push_back(
138-
Gate(currentInstanceType_, currentGate_, currentConnections_));
137+
gates_.emplace_back(
138+
currentInstanceType_, currentGate_, currentConnections_);
139139
}
140140
currentInstanceType_ = GateType::Mlatch;
141141
if (type != "mlatch") {
@@ -159,8 +159,8 @@ void BlifParser::addConnection(const std::string& connection)
159159
void BlifParser::endParser()
160160
{
161161
if (currentInstanceType_ != GateType::None) {
162-
gates_.push_back(
163-
Gate(currentInstanceType_, currentGate_, currentConnections_));
162+
gates_.emplace_back(
163+
currentInstanceType_, currentGate_, currentConnections_);
164164
}
165165
}
166166

src/cut/src/logic_cut.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33

44
#include "cut/logic_cut.h"
55

6-
#include <string.h>
7-
86
#include <algorithm>
97
#include <cstdlib>
8+
#include <cstring>
109
#include <memory>
1110
#include <string>
1211
#include <unordered_map>

0 commit comments

Comments
 (0)