Skip to content

Commit

Permalink
clang-tidy across many modules and remove Ath__ prefix
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
  • Loading branch information
maliberty committed Nov 6, 2024
1 parent 1531ad9 commit 89de30d
Show file tree
Hide file tree
Showing 79 changed files with 1,534 additions and 1,725 deletions.
1 change: 0 additions & 1 deletion src/OpenRoad.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ using odb::dbChip;
using odb::dbDatabase;
using odb::dbLib;
using odb::dbTech;
using odb::Rect;

using sta::evalTclInit;

Expand Down
2 changes: 0 additions & 2 deletions src/dpl/src/CheckPlacement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ using std::vector;

using utl::DPL;

using utl::format_as;

void Opendp::checkPlacement(const bool verbose,
const bool disallow_one_site_gaps,
const string& report_file_name)
Expand Down
2 changes: 0 additions & 2 deletions src/dpl/src/FillerPlacement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ using utl::DPL;
using odb::dbMaster;
using odb::dbPlacementStatus;

using utl::format_as;

static dbTechLayer* getImplant(dbMaster* master)
{
if (!master) {
Expand Down
2 changes: 0 additions & 2 deletions src/dpl/src/Grid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ using utl::DPL;
using odb::dbBox;
using odb::dbRow;

using utl::format_as;

PixelPt::PixelPt(Pixel* pixel1, GridX grid_x, GridY grid_y)
: pixel(pixel1), x(grid_x), y(grid_y)
{
Expand Down
3 changes: 0 additions & 3 deletions src/dpl/src/Opendp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,8 @@ using std::string;

using utl::DPL;

using odb::dbMasterType;
using odb::Rect;

using utl::format_as;

////////////////////////////////////////////////////////////////

bool Opendp::isMultiRow(const Cell* cell) const
Expand Down
2 changes: 0 additions & 2 deletions src/dpl/src/Place.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ using std::vector;

using utl::DPL;

using utl::format_as;

std::string Opendp::printBgBox(
const boost::geometry::model::box<bgPoint>& queryBox)
{
Expand Down
2 changes: 0 additions & 2 deletions src/dpl/src/dbToOpendp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ namespace dpl {
using std::string;
using std::vector;

using utl::DPL;

using odb::dbBox;
using odb::dbMaster;
using odb::dbOrientType;
Expand Down
2 changes: 1 addition & 1 deletion src/drt/src/io/io_parser_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ std::pair<frCoord, frCoord> getBloatingDist(frTechObject* tech,
}
return bloats;
}
return std::make_pair(0, 0);
return {0, 0};
}

} // namespace
Expand Down
2 changes: 1 addition & 1 deletion src/fin/src/DensityFill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ static std::pair<int, int> getSpacing(dbTechLayer* layer,
space_y = std::max(space_y, cfg.space_line_end);
}

return std::make_pair(space_x, space_y);
return {space_x, space_y};
}

// Two different polygons might be less than min space apart and this
Expand Down
2 changes: 1 addition & 1 deletion src/gpl/src/fft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ void FFT::updateDensity(int x, int y, float density)

std::pair<float, float> FFT::getElectroForce(int x, int y) const
{
return std::make_pair(electroForceX_[x][y], electroForceY_[x][y]);
return {electroForceX_[x][y], electroForceY_[x][y]};
}

float FFT::getElectroPhi(int x, int y) const
Expand Down
8 changes: 4 additions & 4 deletions src/gpl/src/nesterovBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ std::pair<int, int> BinGrid::getDensityMinMaxIdxX(const GCell* gcell) const

lowerIdx = std::max(lowerIdx, 0);
upperIdx = std::min(upperIdx, binCntX_);
return std::make_pair(lowerIdx, upperIdx);
return {lowerIdx, upperIdx};
}

std::pair<int, int> BinGrid::getDensityMinMaxIdxY(const GCell* gcell) const
Expand All @@ -840,7 +840,7 @@ std::pair<int, int> BinGrid::getDensityMinMaxIdxY(const GCell* gcell) const

lowerIdx = std::max(lowerIdx, 0);
upperIdx = std::min(upperIdx, binCntY_);
return std::make_pair(lowerIdx, upperIdx);
return {lowerIdx, upperIdx};
}

std::pair<int, int> BinGrid::getMinMaxIdxX(const Instance* inst) const
Expand All @@ -850,7 +850,7 @@ std::pair<int, int> BinGrid::getMinMaxIdxX(const Instance* inst) const
? (inst->ux() - lx()) / binSizeX_
: (inst->ux() - lx()) / binSizeX_ + 1;

return std::make_pair(std::max(lowerIdx, 0), std::min(upperIdx, binCntX_));
return {std::max(lowerIdx, 0), std::min(upperIdx, binCntX_)};
}

std::pair<int, int> BinGrid::getMinMaxIdxY(const Instance* inst) const
Expand All @@ -860,7 +860,7 @@ std::pair<int, int> BinGrid::getMinMaxIdxY(const Instance* inst) const
? (inst->uy() - ly()) / binSizeY_
: (inst->uy() - ly()) / binSizeY_ + 1;

return std::make_pair(std::max(lowerIdx, 0), std::min(upperIdx, binCntY_));
return {std::max(lowerIdx, 0), std::min(upperIdx, binCntY_)};
}

////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion src/gpl/src/placerBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1363,7 +1363,7 @@ static std::pair<int, int> getMinMaxIdx(int ll,
int upperIdx = (fastModulo((uu - coreLL), siteSize) == 0)
? (uu - coreLL) / siteSize
: (uu - coreLL) / siteSize + 1;
return std::make_pair(std::max(minIdx, lowerIdx), std::min(maxIdx, upperIdx));
return {std::max(minIdx, lowerIdx), std::min(maxIdx, upperIdx)};
}

static bool isCoreAreaOverlap(Die& die, Instance& inst)
Expand Down
6 changes: 3 additions & 3 deletions src/gpl/src/routeBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ std::pair<bool, bool> RouteBase::routability()
"FinalRC lower than targetRC({}), routability not needed.",
rbVars_.targetRC);
resetRoutabilityResources();
return std::make_pair(false, false);
return {false, false};
}

//
Expand Down Expand Up @@ -724,7 +724,7 @@ std::pair<bool, bool> RouteBase::routability()
nbVec_[0]->updateDensitySize();
resetRoutabilityResources();

return std::make_pair(false, true);
return {false, true};
}

log_->info(GPL,
Expand Down Expand Up @@ -807,7 +807,7 @@ std::pair<bool, bool> RouteBase::routability()
// reset
resetRoutabilityResources();

return std::make_pair(true, true);
return {true, true};
}

void RouteBase::revertGCellSizeToMinRc()
Expand Down
10 changes: 5 additions & 5 deletions src/gui/include/gui/gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,12 @@ class Descriptor

virtual bool lessThan(std::any l, std::any r) const = 0;

static const Editor makeEditor(const EditorCallback& func,
const std::vector<EditorOption>& options)
static Editor makeEditor(const EditorCallback& func,
const std::vector<EditorOption>& options)
{
return {func, options};
}
static const Editor makeEditor(const EditorCallback& func)
static Editor makeEditor(const EditorCallback& func)
{
return makeEditor(func, {});
}
Expand All @@ -357,7 +357,7 @@ class Selected
{
public:
// Null case
Selected() : object_({}), descriptor_(nullptr) {}
Selected() = default;

Selected(std::any object, const Descriptor* descriptor)
: object_(std::move(object)), descriptor_(descriptor)
Expand Down Expand Up @@ -429,7 +429,7 @@ class Selected

private:
std::any object_;
const Descriptor* descriptor_;
const Descriptor* descriptor_ = nullptr;
};

// This is an interface for classes that wish to be called to render
Expand Down
4 changes: 2 additions & 2 deletions src/mpl/src/ParquetFP/src/skyline.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ float SkylineContour::GetHeight(float left, float right)
std::pair<float, int> SkylineContour::GetHeightWithIdx(float left, float right)
{
if (!skyline_) {
return std::make_pair(0, -1);
return {0, -1};
}

float height = 0;
Expand All @@ -367,7 +367,7 @@ std::pair<float, int> SkylineContour::GetHeightWithIdx(float left, float right)
}

cout << "return height: " << height << endl;
return std::make_pair(height, idx);
return {height, idx};
}

// extract ContourArea
Expand Down
3 changes: 1 addition & 2 deletions src/mpl2/include/mpl2/rtl_mp.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ class MacroPlacer2

void init(sta::dbNetwork* network,
odb::dbDatabase* db,
sta::dbSta* sta,
utl::Logger* logger,
par::PartitionMgr* tritonpart);

Expand Down Expand Up @@ -99,7 +98,7 @@ class MacroPlacer2
float target_dead_space,
float min_ar,
int snap_layer,
bool bus_planning_flag,
bool bus_planning_on,
const char* report_directory);

void placeMacro(odb::dbInst* inst,
Expand Down
1 change: 0 additions & 1 deletion src/mpl2/src/MakeMacroPlacer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ void initMacroPlacer2(OpenRoad* openroad)
sta::evalTclInit(tcl_interp, sta::mpl2_tcl_inits);
openroad->getMacroPlacer2()->init(openroad->getDbNetwork(),
openroad->getDb(),
openroad->getSta(),
openroad->getLogger(),
openroad->getPartitionMgr());
}
Expand Down
4 changes: 1 addition & 3 deletions src/mpl2/src/SimulatedAnnealingCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,7 @@ void SimulatedAnnealingCore<T>::packFloorplan()
}

std::vector<float> accumulated_length(pos_seq_.size(), 0.0);
for (int i = 0; i < pos_seq_.size(); i++) {
const int macro_id = pos_seq_[i];

for (const int macro_id : pos_seq_) {
// There may exist pin access macros with zero area in our sequence pair
// when bus planning is on. This check is a temporary approach.
if (macros_[macro_id].getWidth() <= 0
Expand Down
5 changes: 2 additions & 3 deletions src/mpl2/src/clusterEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1337,8 +1337,7 @@ void ClusteringEngine::updateSubTree(Cluster* parent)
// When breaking large flat clusters, the children will
// be modified, so, we need to iterate them using indexes.
const UniqueClusterVector& new_children = parent->getChildren();
for (int i = 0; i < new_children.size(); ++i) {
auto& child = new_children[i];
for (auto& child : new_children) {
child->setParent(parent);
if (child->getNumStdCell() > max_std_cell_) {
breakLargeFlatCluster(child.get());
Expand Down Expand Up @@ -2152,4 +2151,4 @@ void ClusteringEngine::clearTempMacroClusterMapping(
}
}

} // namespace mpl2
} // namespace mpl2
9 changes: 1 addition & 8 deletions src/mpl2/src/graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,7 @@ Graphics::Graphics(bool coarse,
bool fine,
odb::dbBlock* block,
utl::Logger* logger)
: coarse_(coarse),
fine_(fine),
show_bundled_nets_(false),
skip_steps_(false),
is_skipping_(false),
only_final_result_(false),
block_(block),
logger_(logger)
: coarse_(coarse), fine_(fine), block_(block), logger_(logger)
{
gui::Gui::get()->registerRenderer(this);
}
Expand Down
10 changes: 5 additions & 5 deletions src/mpl2/src/graphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ class Graphics : public gui::Renderer, public Mpl2Observer
odb::Rect outline_;
std::vector<std::vector<odb::Rect>> outlines_;

bool active_ = true;
bool active_{true};
bool coarse_;
bool fine_;
bool show_bundled_nets_;
bool skip_steps_;
bool is_skipping_;
bool only_final_result_;
bool show_bundled_nets_{false};
bool skip_steps_{false};
bool is_skipping_{false};
bool only_final_result_{false};
odb::dbBlock* block_;
utl::Logger* logger_;

Expand Down
2 changes: 0 additions & 2 deletions src/mpl2/src/hier_rtlmp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,10 @@ HierRTLMP::~HierRTLMP() = default;
// Constructors
HierRTLMP::HierRTLMP(sta::dbNetwork* network,
odb::dbDatabase* db,
sta::dbSta* sta,
utl::Logger* logger,
par::PartitionMgr* tritonpart)
: network_(network),
db_(db),
sta_(sta),
logger_(logger),
tritonpart_(tritonpart),
tree_(std::make_unique<PhysicalHierarchy>())
Expand Down
2 changes: 0 additions & 2 deletions src/mpl2/src/hier_rtlmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ class HierRTLMP
public:
HierRTLMP(sta::dbNetwork* network,
odb::dbDatabase* db,
sta::dbSta* sta,
utl::Logger* logger,
par::PartitionMgr* tritonpart);
~HierRTLMP();
Expand Down Expand Up @@ -249,7 +248,6 @@ class HierRTLMP
sta::dbNetwork* network_ = nullptr;
odb::dbDatabase* db_ = nullptr;
odb::dbBlock* block_ = nullptr;
sta::dbSta* sta_ = nullptr;
utl::Logger* logger_ = nullptr;
par::PartitionMgr* tritonpart_ = nullptr;
std::unique_ptr<PhysicalHierarchy> tree_;
Expand Down
Loading

0 comments on commit 89de30d

Please sign in to comment.