forked from github/verilator
Emit: Attach VL_ATTR_COLD to definitions as well as declarations.
This is required by clang if the definition precedes the declaration (which can happen when building via __ALL.cpp), otherwise we get a warning.
This commit is contained in:
parent
da8930a57a
commit
32e99ba0d9
@ -82,6 +82,7 @@ string EmitCBaseVisitor::cFuncArgs(const AstCFunc* nodep) {
|
|||||||
|
|
||||||
void EmitCBaseVisitor::emitCFuncHeader(const AstCFunc* funcp, const AstNodeModule* modp,
|
void EmitCBaseVisitor::emitCFuncHeader(const AstCFunc* funcp, const AstNodeModule* modp,
|
||||||
bool withScope) {
|
bool withScope) {
|
||||||
|
if (funcp->slow()) puts("VL_ATTR_COLD ");
|
||||||
if (!funcp->isConstructor() && !funcp->isDestructor()) {
|
if (!funcp->isConstructor() && !funcp->isDestructor()) {
|
||||||
puts(funcp->rtnTypeVoid());
|
puts(funcp->rtnTypeVoid());
|
||||||
puts(" ");
|
puts(" ");
|
||||||
@ -109,7 +110,6 @@ void EmitCBaseVisitor::emitCFuncDecl(const AstCFunc* funcp, const AstNodeModule*
|
|||||||
puts("virtual ");
|
puts("virtual ");
|
||||||
}
|
}
|
||||||
emitCFuncHeader(funcp, modp, /* withScope: */ false);
|
emitCFuncHeader(funcp, modp, /* withScope: */ false);
|
||||||
if (funcp->slow()) puts(" VL_ATTR_COLD");
|
|
||||||
puts(";\n");
|
puts(";\n");
|
||||||
if (!funcp->ifdef().empty()) puts("#endif // " + funcp->ifdef() + "\n");
|
if (!funcp->ifdef().empty()) puts("#endif // " + funcp->ifdef() + "\n");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user