mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
removed use of unnecessary member variable accessors for StmtList methods
This commit is contained in:
parent
1b2cd0c767
commit
fbdc5e3f29
2 changed files with 15 additions and 15 deletions
|
@ -1677,7 +1677,7 @@ ValPtr StmtList::Exec(Frame* f, StmtFlowType& flow)
|
||||||
RegisterAccess();
|
RegisterAccess();
|
||||||
flow = FLOW_NEXT;
|
flow = FLOW_NEXT;
|
||||||
|
|
||||||
for ( const auto& stmt_ptr : Stmts() )
|
for ( const auto& stmt_ptr : stmts )
|
||||||
{
|
{
|
||||||
auto stmt = stmt_ptr.get();
|
auto stmt = stmt_ptr.get();
|
||||||
|
|
||||||
|
@ -1702,7 +1702,7 @@ ValPtr StmtList::Exec(Frame* f, StmtFlowType& flow)
|
||||||
|
|
||||||
bool StmtList::IsPure() const
|
bool StmtList::IsPure() const
|
||||||
{
|
{
|
||||||
for ( const auto& stmt : Stmts() )
|
for ( const auto& stmt : stmts )
|
||||||
if ( ! stmt->IsPure() )
|
if ( ! stmt->IsPure() )
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
|
@ -1727,7 +1727,7 @@ void StmtList::StmtDescribe(ODesc* d) const
|
||||||
d->NL();
|
d->NL();
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( const auto& stmt : Stmts() )
|
for ( const auto& stmt : stmts )
|
||||||
{
|
{
|
||||||
stmt->Describe(d);
|
stmt->Describe(d);
|
||||||
d->NL();
|
d->NL();
|
||||||
|
@ -1743,7 +1743,7 @@ TraversalCode StmtList::Traverse(TraversalCallback* cb) const
|
||||||
TraversalCode tc = cb->PreStmt(this);
|
TraversalCode tc = cb->PreStmt(this);
|
||||||
HANDLE_TC_STMT_PRE(tc);
|
HANDLE_TC_STMT_PRE(tc);
|
||||||
|
|
||||||
for ( const auto& stmt : Stmts() )
|
for ( const auto& stmt : stmts )
|
||||||
{
|
{
|
||||||
tc = stmt->Traverse(cb);
|
tc = stmt->Traverse(cb);
|
||||||
HANDLE_TC_STMT_PRE(tc);
|
HANDLE_TC_STMT_PRE(tc);
|
||||||
|
|
|
@ -699,25 +699,25 @@ StmtPtr StmtList::Duplicate()
|
||||||
{
|
{
|
||||||
auto new_sl = new StmtList();
|
auto new_sl = new StmtList();
|
||||||
|
|
||||||
for ( auto& stmt : Stmts() )
|
for ( auto& stmt : stmts )
|
||||||
new_sl->Stmts().push_back(stmt->Duplicate());
|
new_sl->stmts.push_back(stmt->Duplicate());
|
||||||
|
|
||||||
return SetSucc(new_sl);
|
return SetSucc(new_sl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void StmtList::Inline(Inliner* inl)
|
void StmtList::Inline(Inliner* inl)
|
||||||
{
|
{
|
||||||
for ( const auto& stmt : Stmts() )
|
for ( const auto& stmt : stmts )
|
||||||
stmt->Inline(inl);
|
stmt->Inline(inl);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StmtList::IsReduced(Reducer* c) const
|
bool StmtList::IsReduced(Reducer* c) const
|
||||||
{
|
{
|
||||||
auto n = Stmts().size();
|
auto n = stmts.size();
|
||||||
|
|
||||||
for ( auto i = 0; i < n; ++i )
|
for ( auto i = 0; i < n; ++i )
|
||||||
{
|
{
|
||||||
auto& s_i = Stmts()[i];
|
auto& s_i = stmts[i];
|
||||||
if ( ! s_i->IsReduced(c) )
|
if ( ! s_i->IsReduced(c) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -733,14 +733,14 @@ StmtPtr StmtList::DoReduce(Reducer* c)
|
||||||
std::vector<StmtPtr> f_stmts;
|
std::vector<StmtPtr> f_stmts;
|
||||||
bool did_change = false;
|
bool did_change = false;
|
||||||
|
|
||||||
auto n = Stmts().size();
|
auto n = stmts.size();
|
||||||
|
|
||||||
for ( auto i = 0; i < n; ++i )
|
for ( auto i = 0; i < n; ++i )
|
||||||
{
|
{
|
||||||
if ( ReduceStmt(i, f_stmts, c) )
|
if ( ReduceStmt(i, f_stmts, c) )
|
||||||
did_change = true;
|
did_change = true;
|
||||||
|
|
||||||
if ( i < n - 1 && Stmts()[i]->NoFlowAfter(false) )
|
if ( i < n - 1 && stmts[i]->NoFlowAfter(false) )
|
||||||
{
|
{
|
||||||
did_change = true;
|
did_change = true;
|
||||||
break;
|
break;
|
||||||
|
@ -768,7 +768,7 @@ StmtPtr StmtList::DoReduce(Reducer* c)
|
||||||
bool StmtList::ReduceStmt(int& s_i, std::vector<StmtPtr>& f_stmts, Reducer* c)
|
bool StmtList::ReduceStmt(int& s_i, std::vector<StmtPtr>& f_stmts, Reducer* c)
|
||||||
{
|
{
|
||||||
bool did_change = false;
|
bool did_change = false;
|
||||||
auto stmt = Stmts()[s_i];
|
auto stmt = stmts[s_i];
|
||||||
auto old_stmt = stmt;
|
auto old_stmt = stmt;
|
||||||
|
|
||||||
stmt = stmt->Reduce(c);
|
stmt = stmt->Reduce(c);
|
||||||
|
@ -813,10 +813,10 @@ bool StmtList::ReduceStmt(int& s_i, std::vector<StmtPtr>& f_stmts, Reducer* c)
|
||||||
auto var = lhs->AsNameExpr();
|
auto var = lhs->AsNameExpr();
|
||||||
auto rhs = a->GetOp2();
|
auto rhs = a->GetOp2();
|
||||||
|
|
||||||
if ( s_i < Stmts().size() - 1 )
|
if ( s_i < stmts.size() - 1 )
|
||||||
{
|
{
|
||||||
// See if we can compress an assignment chain.
|
// See if we can compress an assignment chain.
|
||||||
auto& s_i_succ = Stmts()[s_i + 1];
|
auto& s_i_succ = stmts[s_i + 1];
|
||||||
|
|
||||||
// Don't reduce s_i_succ. If it's what we're
|
// Don't reduce s_i_succ. If it's what we're
|
||||||
// looking for, it's already reduced. Plus
|
// looking for, it's already reduced. Plus
|
||||||
|
@ -864,7 +864,7 @@ bool StmtList::ReduceStmt(int& s_i, std::vector<StmtPtr>& f_stmts, Reducer* c)
|
||||||
|
|
||||||
bool StmtList::NoFlowAfter(bool ignore_break) const
|
bool StmtList::NoFlowAfter(bool ignore_break) const
|
||||||
{
|
{
|
||||||
for ( auto& s : Stmts() )
|
for ( auto& s : stmts )
|
||||||
{
|
{
|
||||||
// For "break" statements, if ignore_break is set then
|
// For "break" statements, if ignore_break is set then
|
||||||
// by construction flow *does* go to after this statement
|
// by construction flow *does* go to after this statement
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue