c++20, 23 compatibility

Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
James Cherry 2024-11-13 18:25:26 -08:00
parent 22acd12935
commit c831ff8507
8 changed files with 19 additions and 19 deletions

View File

@ -314,7 +314,7 @@ CcsCeffDelayCalc::makeResult(const LibertyLibrary *drvr_library,
dcalc_result.setGateDelay(gate_delay);
dcalc_result.setDrvrSlew(drvr_slew);
for (const auto [load_pin, load_idx] : load_pin_index_map) {
for (const auto &[load_pin, load_idx] : load_pin_index_map) {
ArcDelay wire_delay;
Slew load_slew;
loadDelaySlew(load_pin, drvr_library, rf, drvr_slew, wire_delay, load_slew);
@ -452,7 +452,7 @@ CcsCeffDelayCalc::findVlTime(double v,
double t_init = region_ramp_times_[0];
double t_final = region_ramp_times_[region_count_];
bool root_fail = false;
double time = findRoot([=] (double t,
double time = findRoot([&] (double t,
double &y,
double &dy) {
vl(t, elmore, y, dy);

View File

@ -343,7 +343,7 @@ DmpAlg::findDriverParams(double ceff)
x_[DmpParam::dt] = dt;
x_[DmpParam::t0] = t0;
newtonRaphson(100, x_, nr_order_, driver_param_tol,
[=] () { evalDmpEqns(); },
[this] () { evalDmpEqns(); },
fvec_, fjac_, index_, p_, scale_);
t0_ = x_[DmpParam::t0];
dt_ = x_[DmpParam::dt];
@ -494,7 +494,7 @@ DmpAlg::findVoCrossing(double vth,
double t_lower,
double t_upper)
{
FindRootFunc vo_func = [=] (double t,
FindRootFunc vo_func = [&] (double t,
double &y,
double &dy) {
double vo, vo_dt;
@ -612,7 +612,7 @@ DmpAlg::findVlCrossing(double vth,
double t_lower,
double t_upper)
{
FindRootFunc vl_func = [=] (double t,
FindRootFunc vl_func = [&] (double t,
double &y,
double &dy) {
double vl, vl_dt;

View File

@ -86,7 +86,7 @@ ParallelDelayCalc::gateDelaysParallel(ArcDcalcArgSeq &dcalc_args,
slew_sum += 1.0 / drvr_slew;
dcalc_result.setLoadCount(load_pin_index_map.size());
for (const auto [load_pin, load_idx] : load_pin_index_map) {
for (const auto &[load_pin, load_idx] : load_pin_index_map) {
dcalc_result.setWireDelay(load_idx, gate_result.wireDelay(load_idx));
dcalc_result.setLoadSlew(load_idx, gate_result.loadSlew(load_idx));
}

View File

@ -38,7 +38,7 @@ class LibertyCell;
class LibertyPort;
typedef Map<const char*, ConcreteCell*, CharPtrLess> ConcreteCellMap;
typedef Map<string, string> AttributeMap;
typedef std::map<string, string> AttributeMap;
typedef Vector<ConcretePort*> ConcretePortSeq;
typedef Map<const char*, ConcretePort*, CharPtrLess> ConcretePortMap;
typedef ConcreteCellMap::ConstIterator ConcreteLibraryCellIterator;

View File

@ -38,7 +38,7 @@ class ConcreteBindingTbl;
class ConcreteLibertyLibraryIterator;
typedef Vector<ConcreteLibrary*> ConcreteLibrarySeq;
typedef Map<string, string> AttributeMap;
typedef std::map<string, string> AttributeMap;
typedef Map<const char*, ConcreteLibrary*, CharPtrLess> ConcreteLibraryMap;
typedef ConcreteLibrarySeq::ConstIterator ConcreteLibraryIterator;
typedef Map<const char *, ConcreteInstance*,

View File

@ -272,15 +272,15 @@ void
ConcreteCell::setAttribute(const string &key,
const string &value)
{
attribute_map_.insert(key, value);
attribute_map_[key] = value;
}
string
ConcreteCell::getAttribute(const string &key) const
{
if (attribute_map_.hasKey(key)) {
return attribute_map_.findKey(key);
}
const auto &itr = attribute_map_.find(key);
if (itr != attribute_map_.end())
return itr->second;
return "";
}

View File

@ -1686,15 +1686,15 @@ void
ConcreteInstance::setAttribute(const string &key,
const string &value)
{
attribute_map_.insert(key, value);
attribute_map_[key] = value;
}
string
ConcreteInstance::getAttribute(const string &key) const
{
if (attribute_map_.hasKey(key)) {
return attribute_map_.findKey(key);
}
const auto &itr = attribute_map_.find(key);
if (itr != attribute_map_.end())
return itr->second;
return "";
}

View File

@ -193,7 +193,7 @@ BfsIterator::visitParallel(Level to_level,
for (size_t k = 0; k < thread_count; k++) {
// Last thread gets the left overs.
size_t to = (k == thread_count - 1) ? vertex_count : from + chunk_size;
dispatch_queue_->dispatch( [=](int) {
dispatch_queue_->dispatch( [&](int) {
for (size_t i = from; i < to; i++) {
Vertex *vertex = level_vertices[i];
if (vertex) {