script_opt/ZAM: ZBody.h / Support.h: Cleanup includes, use forward declarations

Not sure the IsAny() convenience functions were really worth the
include zeek/Expr.h.
This commit is contained in:
Arne Welzel 2024-08-30 13:51:20 +02:00
parent 29536d6453
commit d843eb5c2b
3 changed files with 15 additions and 6 deletions

View file

@ -9,15 +9,24 @@
#pragma once #pragma once
#include "zeek/Expr.h" #include <vector>
#include "zeek/IntrusivePtr.h"
#include "zeek/script_opt/ZAM/Profile.h" #include "zeek/script_opt/ZAM/Profile.h"
#include "zeek/util.h"
namespace zeek { namespace zeek {
class Connection; class Connection;
class EnumVal; class EnumVal;
class RecordVal; class RecordVal;
class Val;
class StringVal; class StringVal;
class Type;
class Val;
using ValPtr = IntrusivePtr<Val>;
using StringValPtr = IntrusivePtr<StringVal>;
using TypePtr = IntrusivePtr<Type>;
namespace plugin { namespace plugin {
class Component; class Component;
@ -25,6 +34,7 @@ class Component;
namespace detail { namespace detail {
class Expr;
class Stmt; class Stmt;
using ValVec = std::vector<ValPtr>; using ValVec = std::vector<ValPtr>;
@ -96,7 +106,6 @@ extern bool IsAny(const Type* t);
// Convenience functions for getting to these. // Convenience functions for getting to these.
inline bool IsAny(const TypePtr& t) { return IsAny(t.get()); } inline bool IsAny(const TypePtr& t) { return IsAny(t.get()); }
inline bool IsAny(const Expr* e) { return IsAny(e->GetType()); }
// Run-time checking for "any" type being consistent with // Run-time checking for "any" type being consistent with
// expected typed. Returns true if the type match is okay. // expected typed. Returns true if the type match is okay.

View file

@ -4,9 +4,9 @@
#pragma once #pragma once
#include <vector>
#include "zeek/script_opt/ZAM/IterInfo.h" #include "zeek/script_opt/ZAM/IterInfo.h"
#include "zeek/script_opt/ZAM/Profile.h"
#include "zeek/script_opt/ZAM/Support.h"
namespace zeek::detail { namespace zeek::detail {

View file

@ -2,7 +2,7 @@
#include "zeek/script_opt/ZAM/ZOp.h" #include "zeek/script_opt/ZAM/ZOp.h"
#include "zeek/script_opt/ZAM/Support.h" #include "zeek/Type.h"
namespace zeek::detail { namespace zeek::detail {