mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 18:13:50 +02:00
Emit function locals in the place they appear in the tree
Do not sort and hoist function local variables to the top of the function definition. The stack layout of automatic variables is not defined by C so the compilers can lay these out optimally. Simplifies internals for follow on work. Effect on model performance is neutral to very slight improvement, so we do not seem to be loosing anything.
This commit is contained in:
+2
-3
@@ -544,7 +544,6 @@ void EmitCFunc::emitVarList(AstNode* firstp, EisWhich which, const string& prefi
|
||||
doit = (varp->isParam() && !VN_IS(varp->valuep(), Const));
|
||||
break;
|
||||
case EVL_CLASS_ALL: doit = true; break;
|
||||
case EVL_FUNC_ALL: doit = true; break;
|
||||
default: v3fatalSrc("Bad Case");
|
||||
}
|
||||
if (varp->isStatic() ? !isstatic : isstatic) doit = false;
|
||||
@@ -574,8 +573,8 @@ void EmitCFunc::emitVarList(AstNode* firstp, EisWhich which, const string& prefi
|
||||
&& !varp->isSc() // Aggregates can't be anon
|
||||
&& (varp->basicp()
|
||||
&& !varp->basicp()->isOpaque()) // Aggregates can't be anon
|
||||
&& which != EVL_FUNC_ALL); // Anon not legal in funcs, and gcc
|
||||
// bug free there anyhow
|
||||
);
|
||||
|
||||
if (anonOk) {
|
||||
varAnonMap[sortbytes].push_back(varp);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user