mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
Optimize returns at end of functions.
This commit is contained in:
@@ -94,6 +94,15 @@ void AstNode::init() {
|
||||
m_user5Cnt = 0;
|
||||
}
|
||||
|
||||
AstNode* AstNode::abovep() const {
|
||||
// m_headtailp only valid at beginning or end of list
|
||||
// Avoid supporting at other locations as would require walking
|
||||
// list which is likely to cause performance issues.
|
||||
UASSERT_OBJ(!m_nextp || firstAbovep(), this, "abovep() not allowed when in midlist");
|
||||
const AstNode* firstp = firstAbovep() ? this : m_headtailp;
|
||||
return firstp->backp();
|
||||
}
|
||||
|
||||
string AstNode::encodeName(const string& namein) {
|
||||
// Encode signal name raw from parser, then not called again on same signal
|
||||
string out;
|
||||
|
||||
Reference in New Issue
Block a user