Remove value serialization.

Note - this compiles, but you cannot run Bro anymore - it crashes
immediately with a 0-pointer access. The reason behind it is that the
required clone functionality does not work anymore.
This commit is contained in:
Johanna Amann 2019-05-09 11:52:51 -07:00
parent 9b49c7cbc6
commit 474efe9e69
78 changed files with 58 additions and 9185 deletions

View file

@ -189,9 +189,6 @@ public:
void Describe(ODesc* d) const override;
bool Serialize(SerialInfo* info) const;
static Expr* Unserialize(UnserialInfo* info, BroExprTag want = EXPR_ANY);
virtual TraversalCode Traverse(TraversalCallback* cb) const = 0;
protected:
@ -214,8 +211,6 @@ protected:
void RuntimeErrorWithCallStack(const std::string& msg) const;
DECLARE_ABSTRACT_SERIAL(Expr);
BroExprTag tag;
BroType* type;
@ -242,8 +237,6 @@ protected:
void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(NameExpr);
ID* id;
bool in_const_init;
};
@ -264,8 +257,6 @@ protected:
ConstExpr() { val = 0; }
void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(ConstExpr);
Val* val;
};
@ -294,8 +285,6 @@ protected:
// Returns the expression folded using the given constant.
virtual Val* Fold(Val* v) const;
DECLARE_SERIAL(UnaryExpr);
Expr* op;
};
@ -357,8 +346,6 @@ protected:
void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(BinaryExpr);
Expr* op1;
Expr* op2;
};
@ -373,8 +360,6 @@ protected:
CloneExpr() { }
Val* Fold(Val* v) const override;
DECLARE_SERIAL(CloneExpr);
};
class IncrExpr : public UnaryExpr {
@ -388,8 +373,6 @@ public:
protected:
friend class Expr;
IncrExpr() { }
DECLARE_SERIAL(IncrExpr);
};
class ComplementExpr : public UnaryExpr {
@ -401,8 +384,6 @@ protected:
ComplementExpr() { }
Val* Fold(Val* v) const override;
DECLARE_SERIAL(ComplementExpr);
};
class NotExpr : public UnaryExpr {
@ -414,8 +395,6 @@ protected:
NotExpr() { }
Val* Fold(Val* v) const override;
DECLARE_SERIAL(NotExpr);
};
class PosExpr : public UnaryExpr {
@ -427,8 +406,6 @@ protected:
PosExpr() { }
Val* Fold(Val* v) const override;
DECLARE_SERIAL(PosExpr);
};
class NegExpr : public UnaryExpr {
@ -440,8 +417,6 @@ protected:
NegExpr() { }
Val* Fold(Val* v) const override;
DECLARE_SERIAL(NegExpr);
};
class SizeExpr : public UnaryExpr {
@ -454,7 +429,6 @@ protected:
SizeExpr() { }
Val* Fold(Val* v) const override;
DECLARE_SERIAL(SizeExpr);
};
class AddExpr : public BinaryExpr {
@ -465,9 +439,6 @@ public:
protected:
friend class Expr;
AddExpr() { }
DECLARE_SERIAL(AddExpr);
};
class AddToExpr : public BinaryExpr {
@ -478,8 +449,6 @@ public:
protected:
friend class Expr;
AddToExpr() { }
DECLARE_SERIAL(AddToExpr);
};
class RemoveFromExpr : public BinaryExpr {
@ -490,8 +459,6 @@ public:
protected:
friend class Expr;
RemoveFromExpr() { }
DECLARE_SERIAL(RemoveFromExpr);
};
class SubExpr : public BinaryExpr {
@ -501,9 +468,6 @@ public:
protected:
friend class Expr;
SubExpr() { }
DECLARE_SERIAL(SubExpr);
};
class TimesExpr : public BinaryExpr {
@ -514,9 +478,6 @@ public:
protected:
friend class Expr;
TimesExpr() { }
DECLARE_SERIAL(TimesExpr);
};
class DivideExpr : public BinaryExpr {
@ -528,9 +489,6 @@ protected:
DivideExpr() { }
Val* AddrFold(Val* v1, Val* v2) const override;
DECLARE_SERIAL(DivideExpr);
};
class ModExpr : public BinaryExpr {
@ -540,8 +498,6 @@ public:
protected:
friend class Expr;
ModExpr() { }
DECLARE_SERIAL(ModExpr);
};
class BoolExpr : public BinaryExpr {
@ -554,8 +510,6 @@ public:
protected:
friend class Expr;
BoolExpr() { }
DECLARE_SERIAL(BoolExpr);
};
class BitExpr : public BinaryExpr {
@ -565,8 +519,6 @@ public:
protected:
friend class Expr;
BitExpr() { }
DECLARE_SERIAL(BitExpr);
};
class EqExpr : public BinaryExpr {
@ -579,8 +531,6 @@ protected:
EqExpr() { }
Val* Fold(Val* v1, Val* v2) const override;
DECLARE_SERIAL(EqExpr);
};
class RelExpr : public BinaryExpr {
@ -591,8 +541,6 @@ public:
protected:
friend class Expr;
RelExpr() { }
DECLARE_SERIAL(RelExpr);
};
class CondExpr : public Expr {
@ -615,8 +563,6 @@ protected:
void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(CondExpr);
Expr* op1;
Expr* op2;
Expr* op3;
@ -632,8 +578,6 @@ public:
protected:
friend class Expr;
RefExpr() { }
DECLARE_SERIAL(RefExpr);
};
class AssignExpr : public BinaryExpr {
@ -657,8 +601,6 @@ protected:
bool TypeCheck(attr_list* attrs = 0);
bool TypeCheckArithmetics(TypeTag bt1, TypeTag bt2);
DECLARE_SERIAL(AssignExpr);
int is_init;
Val* val; // optional
};
@ -689,8 +631,6 @@ protected:
Val* Fold(Val* v1, Val* v2) const override;
void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(IndexExpr);
};
class FieldExpr : public UnaryExpr {
@ -716,8 +656,6 @@ protected:
void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(FieldExpr);
const char* field_name;
const TypeDecl* td;
int field; // -1 = attributes
@ -740,8 +678,6 @@ protected:
void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(HasFieldExpr);
const char* field_name;
int field;
};
@ -759,8 +695,6 @@ protected:
Val* Fold(Val* v) const override;
void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(RecordConstructorExpr);
};
class TableConstructorExpr : public UnaryExpr {
@ -781,8 +715,6 @@ protected:
void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(TableConstructorExpr);
Attributes* attrs;
};
@ -804,8 +736,6 @@ protected:
void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(SetConstructorExpr);
Attributes* attrs;
};
@ -822,8 +752,6 @@ protected:
Val* InitVal(const BroType* t, Val* aggr) const override;
void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(VectorConstructorExpr);
};
class FieldAssignExpr : public UnaryExpr {
@ -841,8 +769,6 @@ protected:
void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(FieldAssignExpr);
string field_name;
};
@ -856,8 +782,6 @@ protected:
Val* FoldSingleVal(Val* v, InternalTypeTag t) const;
Val* Fold(Val* v) const override;
DECLARE_SERIAL(ArithCoerceExpr);
};
class RecordCoerceExpr : public UnaryExpr {
@ -872,8 +796,6 @@ protected:
Val* InitVal(const BroType* t, Val* aggr) const override;
Val* Fold(Val* v) const override;
DECLARE_SERIAL(RecordCoerceExpr);
// For each super-record slot, gives subrecord slot with which to
// fill it.
int* map;
@ -890,8 +812,6 @@ protected:
TableCoerceExpr() { }
Val* Fold(Val* v) const override;
DECLARE_SERIAL(TableCoerceExpr);
};
class VectorCoerceExpr : public UnaryExpr {
@ -904,8 +824,6 @@ protected:
VectorCoerceExpr() { }
Val* Fold(Val* v) const override;
DECLARE_SERIAL(VectorCoerceExpr);
};
// An internal operator for flattening array indices that are records
@ -920,8 +838,6 @@ protected:
Val* Fold(Val* v) const override;
DECLARE_SERIAL(FlattenExpr);
int num_fields;
};
@ -961,8 +877,6 @@ protected:
void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(ScheduleExpr);
Expr* when;
EventExpr* event;
};
@ -977,8 +891,6 @@ protected:
Val* Fold(Val* v1, Val* v2) const override;
DECLARE_SERIAL(InExpr);
};
class CallExpr : public Expr {
@ -1001,8 +913,6 @@ protected:
void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(CallExpr);
Expr* func;
ListExpr* args;
};
@ -1026,8 +936,6 @@ protected:
void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(EventExpr);
string name;
EventHandlerPtr handler;
ListExpr* args;
@ -1064,8 +972,6 @@ protected:
void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(ListExpr);
expr_list exprs;
};
@ -1079,8 +985,6 @@ public:
protected:
friend class Expr;
RecordAssignExpr() { }
DECLARE_SERIAL(RecordAssignExpr);
};
class CastExpr : public UnaryExpr {
@ -1093,8 +997,6 @@ protected:
Val* Eval(Frame* f) const override;
void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(CastExpr);
};
class IsExpr : public UnaryExpr {
@ -1108,7 +1010,6 @@ protected:
Val* Fold(Val* v) const override;
void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(IsExpr);
private:
BroType* t;