tracking of optimization information associated with statements

This commit is contained in:
Vern Paxson 2021-08-16 10:42:06 -07:00
parent ed3c87d253
commit 3ac725f44b
3 changed files with 39 additions and 0 deletions

View file

@ -48,6 +48,8 @@ class Reducer;
class Stmt;
using StmtPtr = IntrusivePtr<Stmt>;
class StmtOptInfo;
class Stmt : public Obj {
public:
StmtTag Tag() const { return tag; }
@ -160,6 +162,10 @@ public:
return Obj::GetLocationInfo();
}
// Access script optimization information associated with
// this statement.
StmtOptInfo* GetOptInfo() const { return opt_info; }
protected:
explicit Stmt(StmtTag arg_tag);
@ -182,6 +188,10 @@ protected:
// derived, if any. Used as an aid for generating meaningful
// and correctly-localized error messages.
StmtPtr original = nullptr;
// Information associated with the Stmt for purposes of
// script optimization.
StmtOptInfo* opt_info;
};
} // namespace detail