Skip to content

Commit

Permalink
More ctidy clean ups -- overrides, memory. Signed-off-by: Andy Fox an…
Browse files Browse the repository at this point in the history
[email protected]

Signed-off-by: andyfox-rushc <[email protected]>
  • Loading branch information
andyfox-rushc committed Jul 21, 2024
1 parent 40d975c commit 918b5a3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
6 changes: 3 additions & 3 deletions src/dbSta/include/db_sta/dbNetwork.hh
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class dbNetwork : public ConcreteNetwork
void init(dbDatabase* db, Logger* logger);
void setBlock(dbBlock* block);
void clear() override;
CellPortIterator* portIterator(const Cell* cell) const;
CellPortIterator* portIterator(const Cell* cell) const override;

void readLefAfter(dbLib* lib);
void readDefAfter(dbBlock* block);
Expand All @@ -119,7 +119,7 @@ class dbNetwork : public ConcreteNetwork
bool isPlaced(const Pin* pin) const;

LibertyCell* libertyCell(dbInst* inst);
LibertyPort* libertyPort(const Pin*) const;
LibertyPort* libertyPort(const Pin*) const override;
dbInst* staToDb(const Instance* instance) const;
void staToDb(const Instance* instance,
dbInst*& db_inst,
Expand Down Expand Up @@ -229,7 +229,7 @@ class dbNetwork : public ConcreteNetwork

////////////////////////////////////////////////////////////////
// Cell functions
const char* name(const Cell* instance) const override;
const char* name(const Cell* cell) const override;

bool isConcreteCell(const Cell*) const;
void registerConcreteCell(const Cell*);
Expand Down
29 changes: 14 additions & 15 deletions src/dbSta/src/dbNetwork.cc
Original file line number Diff line number Diff line change
Expand Up @@ -635,13 +635,13 @@ const char* dbNetwork::name(const Port* port) const
dbBTerm* bterm = nullptr;
staToDb(port, bterm, mterm, modbterm);
if (bterm) {
return bterm->getName().c_str();
return tmpStringCopy(bterm->getName().c_str());
}
if (mterm) {
return mterm->getName().c_str();
return tmpStringCopy(mterm->getName().c_str());
}
if (modbterm) {
return modbterm->getName();
return tmpStringCopy(modbterm->getName());
}
}
return nullptr;
Expand All @@ -652,19 +652,18 @@ const char* dbNetwork::busName(const Port* port) const
if (isConcretePort(port)) {
const ConcretePort* cport = reinterpret_cast<const ConcretePort*>(port);
return cport->busName();
} else {
dbMTerm* mterm = nullptr;
dbModBTerm* modbterm = nullptr;
dbBTerm* bterm = nullptr;
staToDb(port, bterm, mterm, modbterm);
if (modbterm) {
if (modbterm->isBusPort()) {
return modbterm->getBusPort()->getName();
}
}
dbMTerm* mterm = nullptr;
dbModBTerm* modbterm = nullptr;
dbBTerm* bterm = nullptr;
staToDb(port, bterm, mterm, modbterm);
if (modbterm) {
if (modbterm->isBusPort()) {
return modbterm->getBusPort()->getName();
}
logger_->error(ORD, 2020, "Error: database badly formed bus name");
return nullptr;
}
logger_->error(ORD, 2020, "Error: database badly formed bus name");
return nullptr;
}

const char* dbNetwork::name(const Instance* instance) const
Expand Down Expand Up @@ -704,7 +703,7 @@ class dbModulePortIterator : public CellPortIterator
{
public:
explicit dbModulePortIterator(const dbModule* cell);
~dbModulePortIterator();
~dbModulePortIterator() override;
virtual bool hasNext();
virtual Port* next();

Expand Down

0 comments on commit 918b5a3

Please sign in to comment.