mirror of
https://github.com/verilator/verilator.git
synced 2026-09-08 10:33:20 +02:00
Add '--decorations node' for inserting debug comments into emitted code.
This commit is contained in:
@@ -66,7 +66,7 @@ class EmitCConstPool final : public EmitCConstInit {
|
||||
void emitVars(const AstConstPool* poolp) {
|
||||
std::vector<const AstVar*> varps;
|
||||
for (AstNode* nodep = poolp->modp()->stmtsp(); nodep; nodep = nodep->nextp()) {
|
||||
if (const AstVar* const varp = VN_CAST(nodep, Var)) { varps.push_back(varp); }
|
||||
if (const AstVar* const varp = VN_CAST(nodep, Var)) varps.push_back(varp);
|
||||
}
|
||||
|
||||
if (varps.empty()) return; // Constant pool is empty, so we are done
|
||||
@@ -81,11 +81,11 @@ class EmitCConstPool final : public EmitCConstInit {
|
||||
maybeSplitCFile();
|
||||
const string nameProtect = topClassName() + "__ConstPool__" + varp->nameProtect();
|
||||
puts("\n");
|
||||
puts("extern const ");
|
||||
puts(varp->dtypep()->cType(nameProtect, false, false));
|
||||
puts(" = ");
|
||||
putns(varp, "extern const ");
|
||||
putns(varp, varp->dtypep()->cType(nameProtect, false, false));
|
||||
putns(varp, " = ");
|
||||
iterateConst(varp->valuep());
|
||||
puts(";\n");
|
||||
putns(varp, ";\n");
|
||||
// Keep track of stats
|
||||
if (VN_IS(varp->dtypep(), UnpackArrayDType)) {
|
||||
++m_tablesEmitted;
|
||||
|
||||
Reference in New Issue
Block a user