8 #include <hilti/ast/attribute.h> 9 #include <hilti/ast/id.h> 10 #include <hilti/ast/type.h> 13 namespace declaration {
21 Type(
ID id, ::hilti::Type type, std::optional<AttributeSet> attrs, Linkage
linkage = Linkage::Private,
23 :
NodeBase(nodes(std::move(
id), std::move(type), std::move(attrs)), std::move(m)), _linkage(
linkage) {}
25 auto type()
const {
return type::effectiveType(child<hilti::Type>(1)); }
28 bool isOnHeap()
const {
29 if ( type::isOnHeap(type()) )
32 auto x = attributes();
33 return x && x->find(
"&on-heap");
42 bool operator==(
const Type& other)
const {
return id() == other.
id() && type() == other.type(); }
50 const ID&
id()
const {
return child<ID>(0); }
52 Linkage
linkage()
const {
return _linkage; }
56 auto isEqual(
const Declaration& other)
const {
return node::isEqual(
this, other); }
69 auto x = Declaration(d)._clone().as<
Type>();
auto & childs() const
Definition: node.h:445
std::vector< T > childs(int begin, int end) const
Definition: node.h:373
bool isConstant() const
Definition: type.h:48
const Node none
Definition: node.cc:12
const ID & id() const
Definition: type.h:50
auto typeID() const
Definition: type.h:37
auto isEqual(const Declaration &other) const
Definition: type.h:56
auto & _typeNode()
Definition: type.h:45
auto properties() const
Definition: type.h:59
static Type setType(const Type &d, const ::hilti::Type &t)
Definition: type.h:68
Definition: attribute.h:159
auto cxxID() const
Definition: type.h:40
std::map< std::string, node::detail::PropertyValue > Properties
Definition: node.h:83
Definition: declaration.h:15
Linkage linkage() const
Definition: type.h:52
std::string displayName() const
Definition: type.h:54