Jlm
Loading...
Searching...
No Matches
attribute.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2020 Nico Reißmann <nico.reissmann@gmail.com>
3 * See COPYING for terms of redistribution.
4 */
5
7
8namespace jlm::llvm
9{
10
11Attribute::~Attribute() noexcept = default;
12
13StringAttribute::~StringAttribute() noexcept = default;
14
15bool
16StringAttribute::operator==(const Attribute & other) const
17{
18 auto sa = dynamic_cast<const StringAttribute *>(&other);
19 return sa && sa->kind() == kind() && sa->value() == value();
20}
21
22EnumAttribute::~EnumAttribute() noexcept = default;
23
24bool
25EnumAttribute::operator==(const Attribute & other) const
26{
27 auto ea = dynamic_cast<const EnumAttribute *>(&other);
28 return ea && ea->kind() == kind();
29}
30
31IntAttribute::~IntAttribute() noexcept = default;
32
33bool
34IntAttribute::operator==(const Attribute & other) const
35{
36 auto ia = dynamic_cast<const IntAttribute *>(&other);
37 return ia && ia->kind() == kind() && ia->value() == value();
38}
39
40TypeAttribute::~TypeAttribute() noexcept = default;
41
42bool
43TypeAttribute::operator==(const Attribute & other) const
44{
45 auto ta = dynamic_cast<const TypeAttribute *>(&other);
46 return ta && ta->kind() == kind() && ta->type() == type();
47}
48
54
60
66
72
73}
EnumAttributeHashSet EnumAttributes_
IntAttributeHashSet IntAttributes_
StringAttributeHashSet StringAttributes_
EnumAttributeRange EnumAttributes() const
Definition attribute.cpp:50
TypeAttributeHashSet TypeAttributes_
StringAttributeRange StringAttributes() const
Definition attribute.cpp:68
TypeAttributeRange TypeAttributes() const
Definition attribute.cpp:62
IntAttributeRange IntAttributes() const
Definition attribute.cpp:56
virtual ~Attribute() noexcept
~EnumAttribute() noexcept override
const Attribute::kind & kind() const noexcept
Integer attribute.
~IntAttribute() noexcept override
const std::string & kind() const noexcept
~TypeAttribute() noexcept override
IteratorRange< ItemConstIterator > Items() const noexcept
Definition HashSet.hpp:223
Global memory state passed between functions.