mirror of
https://github.com/zeek/zeek.git
synced 2025-10-11 02:58:20 +00:00
greater ZAM optimization of inlined function calls
This commit is contained in:
parent
e3b75ac391
commit
b489cfc508
13 changed files with 130 additions and 95 deletions
|
@ -6,7 +6,7 @@
|
|||
|
||||
namespace zeek::detail {
|
||||
|
||||
TempVar::TempVar(size_t num, const TypePtr& t, ExprPtr _rhs) : type(t) {
|
||||
TempVar::TempVar(size_t num, ExprPtr _rhs) {
|
||||
char buf[8192];
|
||||
snprintf(buf, sizeof buf, "#%zu", num);
|
||||
name = buf;
|
||||
|
@ -14,6 +14,11 @@ TempVar::TempVar(size_t num, const TypePtr& t, ExprPtr _rhs) : type(t) {
|
|||
}
|
||||
|
||||
void TempVar::SetAlias(IDPtr _alias) {
|
||||
if ( _alias == alias )
|
||||
// This can happen when treating function parameters as
|
||||
// temporary variables.
|
||||
return;
|
||||
|
||||
if ( alias )
|
||||
reporter->InternalError("Re-aliasing a temporary");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue