Deprecate Expr::Type(), replace with GetType()

This commit is contained in:
Jon Siwek 2020-05-11 13:09:01 -07:00
parent 1eb723fc9d
commit e3f7b38890
8 changed files with 248 additions and 253 deletions

View file

@ -75,7 +75,16 @@ struct function_ingredients;
class Expr : public BroObj {
public:
[[deprecated("Remove in v4.1. Use GetType().")]]
BroType* Type() const { return type.get(); }
const IntrusivePtr<BroType>& GetType() const
{ return type; }
template <class T>
IntrusivePtr<T> GetType() const
{ return cast_intrusive<T>(type); }
BroExprTag Tag() const { return tag; }
Expr* Ref() { ::Ref(this); return this; }
@ -946,4 +955,4 @@ std::optional<std::vector<IntrusivePtr<Val>>> eval_list(Frame* f, const ListExpr
extern bool expr_greater(const Expr* e1, const Expr* e2);
// True if the given Val* has a vector type
inline bool is_vector(Expr* e) { return e->Type()->Tag() == TYPE_VECTOR; }
inline bool is_vector(Expr* e) { return e->GetType()->Tag() == TYPE_VECTOR; }