Skip to content

Commit c831ff8

Browse files
committed
c++20, 23 compatibility
Signed-off-by: James Cherry <[email protected]>
1 parent 22acd12 commit c831ff8

File tree

8 files changed

+19
-19
lines changed

8 files changed

+19
-19
lines changed

dcalc/CcsCeffDelayCalc.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ CcsCeffDelayCalc::makeResult(const LibertyLibrary *drvr_library,
314314
dcalc_result.setGateDelay(gate_delay);
315315
dcalc_result.setDrvrSlew(drvr_slew);
316316

317-
for (const auto [load_pin, load_idx] : load_pin_index_map) {
317+
for (const auto &[load_pin, load_idx] : load_pin_index_map) {
318318
ArcDelay wire_delay;
319319
Slew load_slew;
320320
loadDelaySlew(load_pin, drvr_library, rf, drvr_slew, wire_delay, load_slew);
@@ -452,9 +452,9 @@ CcsCeffDelayCalc::findVlTime(double v,
452452
double t_init = region_ramp_times_[0];
453453
double t_final = region_ramp_times_[region_count_];
454454
bool root_fail = false;
455-
double time = findRoot([=] (double t,
456-
double &y,
457-
double &dy) {
455+
double time = findRoot([&] (double t,
456+
double &y,
457+
double &dy) {
458458
vl(t, elmore, y, dy);
459459
y -= v;
460460
}, t_init, t_final + elmore * 3.0, .001, 20, root_fail);

dcalc/DmpCeff.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ DmpAlg::findDriverParams(double ceff)
343343
x_[DmpParam::dt] = dt;
344344
x_[DmpParam::t0] = t0;
345345
newtonRaphson(100, x_, nr_order_, driver_param_tol,
346-
[=] () { evalDmpEqns(); },
346+
[this] () { evalDmpEqns(); },
347347
fvec_, fjac_, index_, p_, scale_);
348348
t0_ = x_[DmpParam::t0];
349349
dt_ = x_[DmpParam::dt];
@@ -494,7 +494,7 @@ DmpAlg::findVoCrossing(double vth,
494494
double t_lower,
495495
double t_upper)
496496
{
497-
FindRootFunc vo_func = [=] (double t,
497+
FindRootFunc vo_func = [&] (double t,
498498
double &y,
499499
double &dy) {
500500
double vo, vo_dt;
@@ -612,7 +612,7 @@ DmpAlg::findVlCrossing(double vth,
612612
double t_lower,
613613
double t_upper)
614614
{
615-
FindRootFunc vl_func = [=] (double t,
615+
FindRootFunc vl_func = [&] (double t,
616616
double &y,
617617
double &dy) {
618618
double vl, vl_dt;

dcalc/ParallelDelayCalc.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ ParallelDelayCalc::gateDelaysParallel(ArcDcalcArgSeq &dcalc_args,
8686
slew_sum += 1.0 / drvr_slew;
8787

8888
dcalc_result.setLoadCount(load_pin_index_map.size());
89-
for (const auto [load_pin, load_idx] : load_pin_index_map) {
89+
for (const auto &[load_pin, load_idx] : load_pin_index_map) {
9090
dcalc_result.setWireDelay(load_idx, gate_result.wireDelay(load_idx));
9191
dcalc_result.setLoadSlew(load_idx, gate_result.loadSlew(load_idx));
9292
}

include/sta/ConcreteLibrary.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class LibertyCell;
3838
class LibertyPort;
3939

4040
typedef Map<const char*, ConcreteCell*, CharPtrLess> ConcreteCellMap;
41-
typedef Map<string, string> AttributeMap;
41+
typedef std::map<string, string> AttributeMap;
4242
typedef Vector<ConcretePort*> ConcretePortSeq;
4343
typedef Map<const char*, ConcretePort*, CharPtrLess> ConcretePortMap;
4444
typedef ConcreteCellMap::ConstIterator ConcreteLibraryCellIterator;

include/sta/ConcreteNetwork.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class ConcreteBindingTbl;
3838
class ConcreteLibertyLibraryIterator;
3939

4040
typedef Vector<ConcreteLibrary*> ConcreteLibrarySeq;
41-
typedef Map<string, string> AttributeMap;
41+
typedef std::map<string, string> AttributeMap;
4242
typedef Map<const char*, ConcreteLibrary*, CharPtrLess> ConcreteLibraryMap;
4343
typedef ConcreteLibrarySeq::ConstIterator ConcreteLibraryIterator;
4444
typedef Map<const char *, ConcreteInstance*,

network/ConcreteLibrary.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,15 +272,15 @@ void
272272
ConcreteCell::setAttribute(const string &key,
273273
const string &value)
274274
{
275-
attribute_map_.insert(key, value);
275+
attribute_map_[key] = value;
276276
}
277277

278278
string
279279
ConcreteCell::getAttribute(const string &key) const
280280
{
281-
if (attribute_map_.hasKey(key)) {
282-
return attribute_map_.findKey(key);
283-
}
281+
const auto &itr = attribute_map_.find(key);
282+
if (itr != attribute_map_.end())
283+
return itr->second;
284284
return "";
285285
}
286286

network/ConcreteNetwork.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,15 +1686,15 @@ void
16861686
ConcreteInstance::setAttribute(const string &key,
16871687
const string &value)
16881688
{
1689-
attribute_map_.insert(key, value);
1689+
attribute_map_[key] = value;
16901690
}
16911691

16921692
string
16931693
ConcreteInstance::getAttribute(const string &key) const
16941694
{
1695-
if (attribute_map_.hasKey(key)) {
1696-
return attribute_map_.findKey(key);
1697-
}
1695+
const auto &itr = attribute_map_.find(key);
1696+
if (itr != attribute_map_.end())
1697+
return itr->second;
16981698
return "";
16991699
}
17001700

search/Bfs.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ BfsIterator::visitParallel(Level to_level,
193193
for (size_t k = 0; k < thread_count; k++) {
194194
// Last thread gets the left overs.
195195
size_t to = (k == thread_count - 1) ? vertex_count : from + chunk_size;
196-
dispatch_queue_->dispatch( [=](int) {
196+
dispatch_queue_->dispatch( [&](int) {
197197
for (size_t i = from; i < to; i++) {
198198
Vertex *vertex = level_vertices[i];
199199
if (vertex) {

0 commit comments

Comments
 (0)