mirror of
https://github.com/verilator/verilator.git
synced 2026-10-07 10:33:13 +02:00
Add --dump-defines.
This commit is contained in:
@@ -231,6 +231,7 @@ public:
|
||||
void insertUnreadback(const string& text) { m_lineCmt += text; }
|
||||
void insertUnreadbackAtBol(const string& text);
|
||||
void addLineComment(int enterExit);
|
||||
void dumpDefines(std::ostream& os);
|
||||
|
||||
// METHODS, callbacks
|
||||
virtual void comment(const string& text); // Comment detected (if keepComments==2)
|
||||
@@ -798,6 +799,16 @@ void V3PreProcImp::addLineComment(int enterExit) {
|
||||
}
|
||||
}
|
||||
|
||||
void V3PreProcImp::dumpDefines(std::ostream& os) {
|
||||
for (DefinesMap::iterator it = m_defines.begin(); it != m_defines.end(); ++it) {
|
||||
os<<"`define "<<it->first;
|
||||
// No need to print "()" below as already part of params()
|
||||
if (!it->second.params().empty()) os<<it->second.params();
|
||||
if (!it->second.value().empty()) os<<" "<<it->second.value();
|
||||
os<<endl;
|
||||
}
|
||||
}
|
||||
|
||||
int V3PreProcImp::getRawToken() {
|
||||
// Get a token from the file, whatever it may be.
|
||||
while (1) {
|
||||
|
||||
Reference in New Issue
Block a user