Skip to content

Commit 6798309

Browse files
committed
Run clang-format
Signed-off-by: Szymon Gizler <[email protected]>
1 parent 3b19727 commit 6798309

File tree

5 files changed

+45
-30
lines changed

5 files changed

+45
-30
lines changed

src/drt/src/db/infra/frPoint.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class Point3D : public Point
6868
friend std::size_t hash_value(Point3D const& p)
6969
{
7070
std::size_t seed = 0;
71-
boost::hash_combine(seed, hash_value(((Point)p)));
71+
boost::hash_combine(seed, hash_value(((Point) p)));
7272
boost::hash_combine(seed, p.getZ());
7373
return seed;
7474
}

src/drt/src/gc/FlexGC_impl.h

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828

2929
#pragma once
3030

31+
#include <boost/unordered/unordered_flat_set.hpp>
3132
#include <memory>
3233

3334
#include "db/gcObj/gcNet.h"
3435
#include "dr/FlexDR.h"
3536
#include "frDesign.h"
3637
#include "gc/FlexGC.h"
37-
#include <boost/unordered/unordered_flat_set.hpp>
3838

3939
namespace odb {
4040
class dbTechLayerCutSpacingTableDefRule;
@@ -192,31 +192,36 @@ class FlexGCWorker::Impl
192192
void initNet_pins_polygonEdges(gcNet* net);
193193
void initNet_pins_polygonEdges_getFixedPolygonEdges(
194194
gcNet* net,
195-
std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>& fixedPolygonEdges);
195+
std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>&
196+
fixedPolygonEdges);
196197
void initNet_pins_polygonEdges_helper_outer(
197198
gcNet* net,
198199
gcPin* pin,
199200
gcPolygon* poly,
200201
frLayerNum i,
201-
const std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>& fixedPolygonEdges);
202+
const std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>&
203+
fixedPolygonEdges);
202204
void initNet_pins_polygonEdges_helper_inner(
203205
gcNet* net,
204206
gcPin* pin,
205207
const gtl::polygon_90_data<frCoord>& hole_poly,
206208
frLayerNum i,
207-
const std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>& fixedPolygonEdges);
209+
const std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>&
210+
fixedPolygonEdges);
208211
void initNet_pins_polygonCorners(gcNet* net);
209212
void initNet_pins_polygonCorners_helper(gcNet* net, gcPin* pin);
210213
void initNet_pins_maxRectangles(gcNet* net);
211214
void initNet_pins_maxRectangles_getFixedMaxRectangles(
212215
gcNet* net,
213-
std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>& fixedMaxRectangles);
216+
std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>&
217+
fixedMaxRectangles);
214218
void initNet_pins_maxRectangles_helper(
215219
gcNet* net,
216220
gcPin* pin,
217221
const gtl::rectangle_data<frCoord>& rect,
218222
frLayerNum i,
219-
const std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>& fixedMaxRectangles);
223+
const std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>&
224+
fixedMaxRectangles);
220225

221226
void initRegionQuery();
222227

src/drt/src/gc/FlexGC_init.cpp

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,8 @@ void FlexGCWorker::Impl::initNet_pins_polygon(gcNet* net)
486486

487487
void FlexGCWorker::Impl::initNet_pins_polygonEdges_getFixedPolygonEdges(
488488
gcNet* net,
489-
std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>& fixedPolygonEdges)
489+
std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>&
490+
fixedPolygonEdges)
490491
{
491492
int numLayers = getTech()->getLayers().size();
492493
std::vector<gtl::polygon_90_with_holes_data<frCoord>> polys;
@@ -552,7 +553,8 @@ void FlexGCWorker::Impl::initNet_pins_polygonEdges_helper_outer(
552553
gcPin* pin,
553554
gcPolygon* poly,
554555
frLayerNum i,
555-
const std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>& fixedPolygonEdges)
556+
const std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>&
557+
fixedPolygonEdges)
556558
{
557559
Point bp, ep, firstPt;
558560
gtl::point_data<frCoord> bp1, ep1, firstPt1;
@@ -626,7 +628,8 @@ void FlexGCWorker::Impl::initNet_pins_polygonEdges_helper_inner(
626628
gcPin* pin,
627629
const gtl::polygon_90_data<frCoord>& hole_poly,
628630
frLayerNum i,
629-
const std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>& fixedPolygonEdges)
631+
const std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>&
632+
fixedPolygonEdges)
630633
{
631634
Point bp, ep, firstPt;
632635
gtl::point_data<frCoord> bp1, ep1, firstPt1;
@@ -698,7 +701,8 @@ void FlexGCWorker::Impl::initNet_pins_polygonEdges_helper_inner(
698701
void FlexGCWorker::Impl::initNet_pins_polygonEdges(gcNet* net)
699702
{
700703
int numLayers = getTech()->getLayers().size();
701-
std::vector<boost::unordered_flat_set<std::pair<Point, Point>>> fixedPolygonEdges(numLayers);
704+
std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>
705+
fixedPolygonEdges(numLayers);
702706
// get all fixed polygon edges
703707
initNet_pins_polygonEdges_getFixedPolygonEdges(net, fixedPolygonEdges);
704708

@@ -852,7 +856,8 @@ void FlexGCWorker::Impl::initNet_pins_polygonCorners(gcNet* net)
852856

853857
void FlexGCWorker::Impl::initNet_pins_maxRectangles_getFixedMaxRectangles(
854858
gcNet* net,
855-
std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>& fixedMaxRectangles)
859+
std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>&
860+
fixedMaxRectangles)
856861
{
857862
int numLayers = getTech()->getLayers().size();
858863
std::vector<gtl::rectangle_data<frCoord>> rects;
@@ -878,7 +883,8 @@ void FlexGCWorker::Impl::initNet_pins_maxRectangles_helper(
878883
gcPin* pin,
879884
const gtl::rectangle_data<frCoord>& rect,
880885
frLayerNum i,
881-
const std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>& fixedMaxRectangles)
886+
const std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>&
887+
fixedMaxRectangles)
882888
{
883889
auto rectangle = std::make_unique<gcRect>();
884890
rectangle->setRect(rect);
@@ -916,7 +922,8 @@ void FlexGCWorker::Impl::initNet_pins_maxRectangles_helper(
916922
void FlexGCWorker::Impl::initNet_pins_maxRectangles(gcNet* net)
917923
{
918924
int numLayers = getTech()->getLayers().size();
919-
std::vector<boost::unordered_flat_set<std::pair<Point, Point>>> fixedMaxRectangles(numLayers);
925+
std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>
926+
fixedMaxRectangles(numLayers);
920927
// get all fixed max rectangles
921928
initNet_pins_maxRectangles_getFixedMaxRectangles(net, fixedMaxRectangles);
922929

src/drt/src/io/GuideProcessor.h

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class GuideProcessor
5454
: design_(designIn),
5555
logger_(loggerIn),
5656
db_(dbIn),
57-
router_cfg_(router_cfg){};
57+
router_cfg_(router_cfg) {};
5858
/**
5959
* @brief Reads guides from odb and fill the tmp_guides_ list of unprocessed
6060
* guides
@@ -176,11 +176,12 @@ class GuideProcessor
176176
* guides only.
177177
*
178178
*/
179-
void genGuides_split(std::vector<frRect>& rects,
180-
const TrackIntervalsByLayer& intvs,
181-
const boost::unordered_flat_map<Point3D, frBlockObjectSet>& gcell_pin_map,
182-
frBlockObjectMap<std::set<Point3D>>& pin_gcell_map,
183-
bool via_access_only) const;
179+
void genGuides_split(
180+
std::vector<frRect>& rects,
181+
const TrackIntervalsByLayer& intvs,
182+
const boost::unordered_flat_map<Point3D, frBlockObjectSet>& gcell_pin_map,
183+
frBlockObjectMap<std::set<Point3D>>& pin_gcell_map,
184+
bool via_access_only) const;
184185
/**
185186
* Initializes a map of gcell location to set of pins
186187
*
@@ -191,9 +192,9 @@ class GuideProcessor
191192
* considered by this function.
192193
* @param gcell_pin_map A map to be populated by the result of this function.
193194
*/
194-
void initGCellPinMap(
195-
const frNet* net,
196-
boost::unordered_flat_map<Point3D, frBlockObjectSet>& gcell_pin_map) const;
195+
void initGCellPinMap(const frNet* net,
196+
boost::unordered_flat_map<Point3D, frBlockObjectSet>&
197+
gcell_pin_map) const;
197198
/**
198199
* Populates gcell_pin_map with the values associated with the passed term
199200
* based on pin shapes.
@@ -205,8 +206,9 @@ class GuideProcessor
205206
* @param gcell_pin_map The map to be populated with the results.
206207
* @param term The current pin we are processing.
207208
*/
208-
void mapPinShapesToGCells(boost::unordered_flat_map<Point3D, frBlockObjectSet>& gcell_pin_map,
209-
frBlockObject* term) const;
209+
void mapPinShapesToGCells(
210+
boost::unordered_flat_map<Point3D, frBlockObjectSet>& gcell_pin_map,
211+
frBlockObject* term) const;
210212
/**
211213
* Populates gcell_pin_map with the values associated with the passed pin
212214
* based on access points.

src/odb/include/odb/geom.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@
3333
#pragma once
3434

3535
#include <algorithm>
36+
#include <boost/functional/hash.hpp>
3637
#include <iosfwd>
3738
#include <tuple>
3839
#include <vector>
3940

4041
#include "isotropy.h"
4142
#include "odb.h"
4243
#include "utl/Logger.h"
43-
#include <boost/functional/hash.hpp>
4444

4545
namespace odb {
4646

@@ -94,10 +94,11 @@ class Point
9494
inline std::size_t hash_value(Point const& p)
9595
{
9696
size_t hash = 0;
97-
if constexpr (sizeof(size_t) == 8 && sizeof(size_t) == 2*sizeof(int)) {
98-
// Use fast identity hash if possible. We don't care about avalanching since it will be mixed later by flat_map anyway
99-
return ((size_t)p.getX() << 32) | p.getY();
100-
} else {
97+
if constexpr (sizeof(size_t) == 8 && sizeof(size_t) == 2 * sizeof(int)) {
98+
// Use fast identity hash if possible. We don't care about avalanching since
99+
// it will be mixed later by flat_map anyway
100+
return ((size_t) p.getX() << 32) | p.getY();
101+
} else {
101102
boost::hash_combine(hash, p.x());
102103
boost::hash_combine(hash, p.y());
103104
}

0 commit comments

Comments
 (0)