mirror of
https://github.com/zeek/zeek.git
synced 2025-10-11 02:58:20 +00:00
initial implementation of class for temporary variables; this will grow in complexity as we add additional optimization stages
This commit is contained in:
parent
8d77194719
commit
6aa84087b0
3 changed files with 54 additions and 0 deletions
17
src/script_opt/TempVar.cc
Normal file
17
src/script_opt/TempVar.cc
Normal file
|
@ -0,0 +1,17 @@
|
|||
// See the file "COPYING" in the main distribution directory for copyright.
|
||||
|
||||
#include "TempVar.h"
|
||||
#include "Reporter.h"
|
||||
|
||||
|
||||
namespace zeek::detail {
|
||||
|
||||
TempVar::TempVar(int num, const TypePtr& t, ExprPtr _rhs) : type(t)
|
||||
{
|
||||
char buf[8192];
|
||||
snprintf(buf, sizeof buf, "#%d", num);
|
||||
name = util::copy_string(buf);
|
||||
id = nullptr;
|
||||
}
|
||||
|
||||
} // zeek::detail
|
Loading…
Add table
Add a link
Reference in a new issue