mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 22:58:20 +00:00
regularized (some) types of pointers used in script optimization
This commit is contained in:
parent
dd389c0380
commit
709d410fcd
18 changed files with 85 additions and 93 deletions
|
@ -151,7 +151,7 @@ string CPPCompile::GenNameExpr(const NameExpr* ne, GenType gt) {
|
|||
|
||||
if ( t->Tag() == TYPE_FUNC && ! is_global_var ) {
|
||||
auto func = n->Name();
|
||||
if ( globals.count(func) > 0 && pfs.BiFGlobals().count(n) == 0 )
|
||||
if ( globals.count(func) > 0 && pfs->BiFGlobals().count(n) == 0 )
|
||||
return GenericValPtrToGT(IDNameStr(n), t, gt);
|
||||
}
|
||||
|
||||
|
@ -202,9 +202,9 @@ string CPPCompile::GenIncrExpr(const Expr* e, GenType gt, bool is_incr, bool top
|
|||
|
||||
// Make sure any newly created types are known to
|
||||
// the profiler.
|
||||
(void)pfs.HashType(one_e->GetType());
|
||||
(void)pfs.HashType(rhs->GetType());
|
||||
(void)pfs.HashType(assign->GetType());
|
||||
(void)pfs->HashType(one_e->GetType());
|
||||
(void)pfs->HashType(rhs->GetType());
|
||||
(void)pfs->HashType(assign->GetType());
|
||||
|
||||
auto gen = GenExpr(assign, GEN_DONT_CARE, top_level);
|
||||
|
||||
|
@ -269,10 +269,10 @@ string CPPCompile::GenCallExpr(const CallExpr* c, GenType gt, bool top_level) {
|
|||
//
|
||||
// If it is a BiF *that's also a global variable*, then
|
||||
// we need to look up the BiF version of the global.
|
||||
if ( pfs.BiFGlobals().count(f_id) == 0 )
|
||||
if ( pfs->BiFGlobals().count(f_id) == 0 )
|
||||
gen += +"->AsFunc()";
|
||||
|
||||
else if ( pfs.Globals().count(f_id) > 0 )
|
||||
else if ( pfs->Globals().count(f_id) > 0 )
|
||||
// The BiF version has an extra "_", per
|
||||
// AddBiF(..., true).
|
||||
gen = globals[string(id_name) + "_"];
|
||||
|
@ -511,8 +511,8 @@ string CPPCompile::GenAddToExpr(const Expr* e, GenType gt, bool top_level) {
|
|||
|
||||
// Make sure any newly created types are known to
|
||||
// the profiler.
|
||||
(void)pfs.HashType(rhs->GetType());
|
||||
(void)pfs.HashType(assign->GetType());
|
||||
(void)pfs->HashType(rhs->GetType());
|
||||
(void)pfs->HashType(assign->GetType());
|
||||
|
||||
return GenExpr(assign, gt, top_level);
|
||||
}
|
||||
|
@ -542,8 +542,8 @@ string CPPCompile::GenRemoveFromExpr(const Expr* e, GenType gt, bool top_level)
|
|||
|
||||
// Make sure any newly created types are known to
|
||||
// the profiler.
|
||||
(void)pfs.HashType(rhs->GetType());
|
||||
(void)pfs.HashType(assign->GetType());
|
||||
(void)pfs->HashType(rhs->GetType());
|
||||
(void)pfs->HashType(assign->GetType());
|
||||
|
||||
return GenExpr(assign, gt, top_level);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue