Merge remote-tracking branch 'remotes/origin/topic/robin/gh59-when'

Fixed a few small bugs - Modifiable had an uninitialized member and the
Registry looped over a map while deleting elements from it.

Fixes GH-319

* remotes/origin/topic/robin/gh59-when:
  Renaming src/StateAccess.{h,cc} to src/Notifier.{h,cc}.
  Clean up new code.
  Remove MutableVal class.
  Redo API for notifiers.
  Remove most of MutableVal (but not the class itelf yet)
  Remove enum Opcode.
  Remove StateAccess class.
  Redo NotfifierRegistry to no longer rely on StateAccess.
  Add new test for when-statement watching global variables.
  Couple of compile fixes.
This commit is contained in:
Johanna Amann 2019-06-20 14:15:37 -07:00
commit b1be8abe4e
22 changed files with 365 additions and 1422 deletions

View file

@ -86,7 +86,7 @@ public:
const;
// Assign to the given value, if appropriate.
virtual void Assign(Frame* f, Val* v, Opcode op = OP_ASSIGN);
virtual void Assign(Frame* f, Val* v);
// Returns the type corresponding to this expression interpreted
// as an initialization. The type should be Unref()'d when done
@ -239,7 +239,7 @@ public:
ID* Id() const { return id; }
Val* Eval(Frame* f) const override;
void Assign(Frame* f, Val* v, Opcode op = OP_ASSIGN) override;
void Assign(Frame* f, Val* v) override;
Expr* MakeLvalue() override;
int IsPure() const override;
@ -586,7 +586,7 @@ class RefExpr : public UnaryExpr {
public:
explicit RefExpr(Expr* op);
void Assign(Frame* f, Val* v, Opcode op = OP_ASSIGN) override;
void Assign(Frame* f, Val* v) override;
Expr* MakeLvalue() override;
protected:
@ -639,7 +639,7 @@ public:
void Add(Frame* f) override;
void Delete(Frame* f) override;
void Assign(Frame* f, Val* v, Opcode op = OP_ASSIGN) override;
void Assign(Frame* f, Val* v) override;
Expr* MakeLvalue() override;
// Need to override Eval since it can take a vector arg but does
@ -671,7 +671,7 @@ public:
int CanDel() const override;
void Assign(Frame* f, Val* v, Opcode op = OP_ASSIGN) override;
void Assign(Frame* f, Val* v) override;
void Delete(Frame* f) override;
Expr* MakeLvalue() override;
@ -991,7 +991,7 @@ public:
BroType* InitType() const override;
Val* InitVal(const BroType* t, Val* aggr) const override;
Expr* MakeLvalue() override;
void Assign(Frame* f, Val* v, Opcode op = OP_ASSIGN) override;
void Assign(Frame* f, Val* v) override;
TraversalCode Traverse(TraversalCallback* cb) const override;