mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +00:00
optimize generation of "-O gen-C++" code for table/vector size operations
This commit is contained in:
parent
5311904bb1
commit
4e253aae0a
1 changed files with 3 additions and 0 deletions
|
@ -576,6 +576,9 @@ string CPPCompile::GenSizeExpr(const Expr* e, GenType gt) {
|
||||||
else if ( it == TYPE_INTERNAL_DOUBLE )
|
else if ( it == TYPE_INTERNAL_DOUBLE )
|
||||||
gen = string("fabs__CPP(") + gen + ")";
|
gen = string("fabs__CPP(") + gen + ")";
|
||||||
|
|
||||||
|
else if ( gt == GEN_NATIVE && (t1->Tag() == TYPE_TABLE || t1->Tag() == TYPE_VECTOR) )
|
||||||
|
return gen + "->Size()";
|
||||||
|
|
||||||
else
|
else
|
||||||
return GenericValPtrToGT(gen + "->SizeVal()", t, gt);
|
return GenericValPtrToGT(gen + "->SizeVal()", t, gt);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue