mirror of
https://github.com/verilator/verilator.git
synced 2025-04-25 10:06:54 +00:00
Fix auto-indentation of AstCStmts
This commit is contained in:
parent
ad0fcb745e
commit
1da07a3b86
@ -251,7 +251,7 @@ private:
|
||||
if (!m_scopeFinalp) {
|
||||
m_scopeFinalp = new AstCFunc(nodep->fileline(), "_final", m_namer.scopep());
|
||||
m_scopeFinalp->argTypes(EmitCBaseVisitor::symClassVar());
|
||||
m_scopeFinalp->addInitsp(new AstCStmt(nodep->fileline()," "+EmitCBaseVisitor::symTopAssign()+"\n"));
|
||||
m_scopeFinalp->addInitsp(new AstCStmt(nodep->fileline(), EmitCBaseVisitor::symTopAssign()+"\n"));
|
||||
m_scopeFinalp->dontCombine(true);
|
||||
m_scopeFinalp->formCallTree(true);
|
||||
m_scopeFinalp->slow(true);
|
||||
|
@ -235,7 +235,7 @@ private:
|
||||
funcp->addInitsp(
|
||||
new AstCStmt(nodep->fileline(),
|
||||
" "+EmitCBaseVisitor::symClassVar()+" = this->__VlSymsp;\n"));
|
||||
funcp->addInitsp(new AstCStmt(nodep->fileline()," "+EmitCBaseVisitor::symTopAssign()+"\n"));
|
||||
funcp->addInitsp(new AstCStmt(nodep->fileline(), EmitCBaseVisitor::symTopAssign()+"\n"));
|
||||
m_scopep->addActivep(funcp);
|
||||
m_finalFuncp = funcp;
|
||||
}
|
||||
|
@ -131,6 +131,7 @@ private:
|
||||
|
||||
//--------------------
|
||||
// Marking of non-static functions (because they might need "this")
|
||||
// (Here just to avoid another iteration)
|
||||
void needNonStaticFunc(AstNode* nodep) {
|
||||
if (!m_funcp) nodep->v3fatalSrc("Non-static accessor not under a function");
|
||||
if (m_funcp->isStatic()) {
|
||||
|
@ -122,7 +122,7 @@ private:
|
||||
newfuncp->addInitsp(
|
||||
new AstCStmt(newfuncp->fileline(),
|
||||
" "+EmitCBaseVisitor::symClassVar()+" = this->__VlSymsp;\n"));
|
||||
newfuncp->addInitsp(new AstCStmt(newfuncp->fileline()," "+EmitCBaseVisitor::symTopAssign()+"\n"));
|
||||
newfuncp->addInitsp(new AstCStmt(newfuncp->fileline(), EmitCBaseVisitor::symTopAssign()+"\n"));
|
||||
topFuncp->addNextHere(newfuncp);
|
||||
// In the body, call each function if it matches the given scope
|
||||
for (FuncMmap::iterator eachIt = it; eachIt!=m_modFuncs.end() && eachIt->first==name; ++eachIt) {
|
||||
|
@ -415,9 +415,11 @@ public:
|
||||
ofp()->putsNoTracking(nodep->text());
|
||||
}
|
||||
virtual void visit(AstCStmt* nodep, AstNUser*) {
|
||||
putbs("");
|
||||
nodep->bodysp()->iterateAndNext(*this);
|
||||
}
|
||||
virtual void visit(AstCMath* nodep, AstNUser*) {
|
||||
putbs("");
|
||||
nodep->bodysp()->iterateAndNext(*this);
|
||||
}
|
||||
virtual void visit(AstUCStmt* nodep, AstNUser*) {
|
||||
@ -572,6 +574,9 @@ public:
|
||||
}
|
||||
|
||||
// Just iterate
|
||||
virtual void visit(AstNetlist* nodep, AstNUser*) {
|
||||
nodep->iterateChildren(*this);
|
||||
}
|
||||
virtual void visit(AstTopScope* nodep, AstNUser*) {
|
||||
nodep->iterateChildren(*this);
|
||||
}
|
||||
@ -585,6 +590,7 @@ public:
|
||||
virtual void visit(AstNodeText*, AstNUser*) {} // Handled outside the Visit class
|
||||
virtual void visit(AstTraceDecl*, AstNUser*) {} // Handled outside the Visit class
|
||||
virtual void visit(AstTraceInc*, AstNUser*) {} // Handled outside the Visit class
|
||||
virtual void visit(AstCFile*, AstNUser*) {} // Handled outside the Visit class
|
||||
// Default
|
||||
virtual void visit(AstNode* nodep, AstNUser*) {
|
||||
puts((string)"\n???? // "+nodep->prettyTypeName()+"\n");
|
||||
|
@ -72,7 +72,6 @@ struct V3ParseBisonYYSType {
|
||||
AstPin* pinp;
|
||||
AstRange* rangep;
|
||||
AstSenTree* sentreep;
|
||||
AstTask* taskp;
|
||||
AstVar* varp;
|
||||
};
|
||||
};
|
||||
|
@ -540,7 +540,7 @@ private:
|
||||
// We need to get a pointer to all of our variables (may have eval'ed something else earlier)
|
||||
cfuncp->addInitsp(
|
||||
new AstCStmt(nodep->fileline(),
|
||||
" "+EmitCBaseVisitor::symClassVar()+" = this->__VlSymsp;\n"));
|
||||
EmitCBaseVisitor::symClassVar()+" = this->__VlSymsp;\n"));
|
||||
} else {
|
||||
// Need symbol table
|
||||
cfuncp->argTypes(EmitCBaseVisitor::symClassVar());
|
||||
|
@ -2015,7 +2015,7 @@ lifetime: // ==IEEE: lifetime
|
||||
| yAUTOMATIC { }
|
||||
;
|
||||
|
||||
taskId<taskp>:
|
||||
taskId<ftaskp>:
|
||||
tfIdScoped
|
||||
{ $$ = new AstTask($<fl>1, *$<strp>1, NULL);
|
||||
SYMP->pushNewUnder($$, NULL); }
|
||||
|
@ -94,7 +94,7 @@ if ($#opt_tests<0) {
|
||||
mkdir "obj_dir";
|
||||
mkdir "logs";
|
||||
|
||||
my $okcnt=0; my $failcnt=0;
|
||||
my $leftcnt=0; my $okcnt=0; my $failcnt=0;
|
||||
my @fails;
|
||||
|
||||
foreach my $testpl (@opt_tests) {
|
||||
@ -108,6 +108,7 @@ $Fork->wait_all(); # Wait for all children to finish
|
||||
|
||||
sub one_test {
|
||||
my @params = @_;
|
||||
$leftcnt++;
|
||||
$Fork->schedule
|
||||
(
|
||||
run_on_start => sub {
|
||||
@ -139,6 +140,8 @@ sub one_test {
|
||||
$failcnt++;
|
||||
if ($opt_stop) { die "%Error: --stop and errors found\n"; }
|
||||
}
|
||||
$leftcnt--;
|
||||
print "==SUMMARY: Left $leftcnt Passed $okcnt Failed $failcnt\n";
|
||||
},
|
||||
)->ready();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user