5#ifndef V8_TORQUE_DECLARATIONS_H_
6#define V8_TORQUE_DECLARATIONS_H_
28 if (T* t = T::DynamicCast(declarable)) {
36 if (generates.length() < 7 || generates.substr(0, 6) !=
"TNode<" ||
37 generates.substr(generates.length() - 1, 1) !=
">") {
39 "\" should be of the form \"TNode<...>\"");
41 return generates.substr(6, generates.length() - 7);
47 return CurrentScope::Get()->Lookup(name);
51 return CurrentScope::Get()->LookupShallow(name);
60 std::vector<Declarable*> d =
TryLookup(name);
84 static std::vector<GenericCallable*>
LookupGeneric(
const std::string& name);
99 std::string readable_name,
100 bool exported_to_csa,
102 std::optional<Statement*> body,
103 bool is_user_defined);
105 std::string external_assembler_name,
108 std::optional<std::string> external_assembler_name,
110 std::optional<Statement*> body,
111 std::optional<std::string> op = {},
112 bool is_user_defined =
true);
115 const std::string& name,
Signature signature,
127 std::optional<std::string> use_counter_name,
128 std::optional<Statement*> body);
141 const std::string& name, GenericCallableDeclaration* ast_node);
143 GenericTypeDeclaration* ast_node);
146 static T*
Declare(
const std::string& name, T* d) {
147 CurrentScope::Get()->AddDeclarable(name, d);
151 static T*
Declare(
const std::string& name, std::unique_ptr<T> d) {
152 return CurrentScope::Get()->AddDeclarable(name,
158 const std::string& name,
const TypeVector& specialized_types);
base::Flags< Flag > Flags
static Value * LookupValue(const QualifiedName &name)
static std::optional< Builtin * > TryLookupBuiltin(const QualifiedName &name)
static Intrinsic * CreateIntrinsic(const std::string &name, const Signature &signature)
static TypeAlias * DeclareType(const Identifier *name, const Type *type)
static TorqueMacro * CreateTorqueMacro(std::string external_name, std::string readable_name, bool exported_to_csa, Signature signature, std::optional< Statement * > body, bool is_user_defined)
static Macro * TryLookupMacro(const std::string &name, const TypeVector &types)
static std::vector< Declarable * > LookupGlobalScope(const QualifiedName &name)
static std::vector< T * > TryLookup(const QualifiedName &name)
static T * Declare(const std::string &name, T *d)
static Macro * DeclareMacro(const std::string &name, bool accessible_from_csa, std::optional< std::string > external_assembler_name, const Signature &signature, std::optional< Statement * > body, std::optional< std::string > op={}, bool is_user_defined=true)
static std::vector< Declarable * > TryLookupShallow(const QualifiedName &name)
static ExternConstant * DeclareExternConstant(Identifier *name, const Type *type, std::string value)
static Builtin * CreateBuiltin(std::string external_name, std::string readable_name, Builtin::Kind kind, Builtin::Flags flags, Signature signature, std::optional< std::string > use_counter_name, std::optional< Statement * > body)
static Namespace * DeclareNamespace(const std::string &name)
static Method * CreateMethod(AggregateType *class_type, const std::string &name, Signature signature, Statement *body)
static std::vector< GenericCallable * > LookupGeneric(const std::string &name)
static RuntimeFunction * DeclareRuntimeFunction(const std::string &name, const Signature &signature)
static ExternMacro * CreateExternMacro(std::string name, std::string external_assembler_name, Signature signature)
static std::vector< Declarable * > TryLookup(const QualifiedName &name)
static GenericCallable * LookupUniqueGeneric(const QualifiedName &name)
static Intrinsic * DeclareIntrinsic(const std::string &name, const Signature &signature)
static GenericCallable * DeclareGenericCallable(const std::string &name, GenericCallableDeclaration *ast_node)
static const Type * LookupGlobalType(const QualifiedName &name)
static std::string GetGeneratedCallableName(const std::string &name, const TypeVector &specialized_types)
static const TypeAlias * LookupTypeAlias(const QualifiedName &name)
static Macro * DeclareOperator(const std::string &name, Macro *m)
static GenericType * LookupGlobalUniqueGenericType(const std::string &name)
static T * Declare(const std::string &name, std::unique_ptr< T > d)
static const Type * LookupType(const QualifiedName &name)
static NamespaceConstant * DeclareNamespaceConstant(Identifier *name, const Type *type, Expression *body)
static Builtin * FindSomeInternalBuiltinWithType(const BuiltinPointerType *type)
static TypeAlias * PredeclareTypeAlias(const Identifier *name, TypeDeclaration *type, bool redeclaration)
static GenericType * LookupUniqueGenericType(const QualifiedName &name)
static std::vector< Declarable * > Lookup(const QualifiedName &name)
static std::optional< GenericType * > TryLookupGenericType(const QualifiedName &name)
static GenericType * DeclareGenericType(const std::string &name, GenericTypeDeclaration *ast_node)
static std::optional< const Type * > TryLookupType(const QualifiedName &name)
ZoneVector< RpoNumber > & result
T * RegisterDeclarable(std::unique_ptr< T > d)
static constexpr const char * kContinueLabelName
std::string UnwrapTNodeTypeName(const std::string &generates)
static constexpr const char *const kFromConstexprMacroName
void ReportError(Args &&... args)
static constexpr const char * kBreakLabelName
std::vector< T * > FilterDeclarables(const std::vector< Declarable * > list)
static constexpr const char * kMacroEndLabelName
static constexpr const char * kNextCaseLabelName
std::vector< const Type * > TypeVector
static constexpr const char * kCatchLabelName