#include <cassert>
#include <optional>
#include <string>
#include <unordered_map>
#include "src/base/hashing.h"
#include "src/base/logging.h"
#include "src/torque/ast.h"
#include "src/torque/types.h"
#include "src/torque/utils.h"
Go to the source code of this file.
◆ DECLARE_DECLARABLE_BOILERPLATE
#define DECLARE_DECLARABLE_BOILERPLATE |
( |
| x, |
|
|
| y ) |
Value: static x*
cast(Declarable* declarable) { \
DCHECK(declarable->Is##
x()); \
return static_cast<x*
>(declarable); \
} \
static const x*
cast(
const Declarable* declarable) { \
DCHECK(declarable->Is##
x()); \
return static_cast<const x*
>(declarable); \
} \
const char* type_name()
const override {
return #
y; } \
static x* DynamicCast(Declarable* declarable) { \
if (!declarable) return nullptr; \
if (!declarable->Is##
x()) return
nullptr; \
return static_cast<
x*>(declarable); \
} \
static const
x* DynamicCast(const Declarable* declarable) { \
if (!declarable) return nullptr; \
if (!declarable->Is##
x()) return
nullptr; \
return static_cast<const
x*>(declarable); \
}
Definition at line 127 of file declarable.h.