mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Switch InlineExpr from using IDPList* to vector<IDPtr>
This commit is contained in:
parent
a0552f9771
commit
c7bec09e14
3 changed files with 13 additions and 12 deletions
|
@ -199,12 +199,14 @@ ExprPtr Inliner::CheckForInlining(IntrusivePtr<CallExpr> c)
|
|||
// the function, *using the knowledge that the parameters are
|
||||
// declared first*.
|
||||
auto scope = func_vf->GetScope();
|
||||
auto vars = scope->OrderedVars();
|
||||
auto& vars = scope->OrderedVars();
|
||||
int nparam = func_vf->GetType()->Params()->NumFields();
|
||||
|
||||
auto params = new IDPList;
|
||||
std::vector<IDPtr> params;
|
||||
params.reserve(nparam);
|
||||
|
||||
for ( int i = 0; i < nparam; ++i )
|
||||
params->append(vars[i].get());
|
||||
params.emplace_back(vars[i]);
|
||||
|
||||
auto body_dup = body->Duplicate();
|
||||
|
||||
|
@ -229,8 +231,8 @@ ExprPtr Inliner::CheckForInlining(IntrusivePtr<CallExpr> c)
|
|||
else
|
||||
max_inlined_frame_size = hold_max_inlined_frame_size;
|
||||
|
||||
auto ie = make_intrusive<InlineExpr>(args, params, body_dup,
|
||||
curr_frame_size, t);
|
||||
auto ie = make_intrusive<InlineExpr>(args, std::move(params), body_dup,
|
||||
curr_frame_size, t);
|
||||
ie->SetOriginal(c);
|
||||
|
||||
return ie;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue