initial implementation of class for temporary variables; this will grow in complexity as we add additional optimization stages

This commit is contained in:
Vern Paxson 2021-01-10 13:41:39 -08:00
parent 8d77194719
commit 6aa84087b0
3 changed files with 54 additions and 0 deletions

17
src/script_opt/TempVar.cc Normal file
View 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