diff options
author | John Hodge <tpg@mutabah.net> | 2016-10-31 11:58:03 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-10-31 11:58:03 +0800 |
commit | 542633bbfad33d1b94921d89261bb637ba48ff47 (patch) | |
tree | 1ac6ad83f407ba64c92554d843b7ed54cc5593fd /src/ast | |
parent | fc7239e7271e879102272ea4d7e98f87f027ee84 (diff) | |
download | mrust-542633bbfad33d1b94921d89261bb637ba48ff47.tar.gz |
AST+HIR - Union support through to HIR
Diffstat (limited to 'src/ast')
-rw-r--r-- | src/ast/ast.cpp | 4 | ||||
-rw-r--r-- | src/ast/attrs.hpp | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/ast/ast.cpp b/src/ast/ast.cpp index 6e93a0d9..15b8c7d7 100644 --- a/src/ast/ast.cpp +++ b/src/ast/ast.cpp @@ -35,11 +35,11 @@ void MetaItems::push_back(MetaItem i) {
m_items.push_back( ::std::move(i) );
}
-MetaItem* MetaItems::get(const char *name)
+const MetaItem* MetaItems::get(const char *name) const
{
for( auto& i : m_items ) {
if(i.name() == name) {
- i.mark_used();
+ //i.mark_used();
return &i;
}
}
diff --git a/src/ast/attrs.hpp b/src/ast/attrs.hpp index aa892d6d..f4e6af8d 100644 --- a/src/ast/attrs.hpp +++ b/src/ast/attrs.hpp @@ -28,8 +28,9 @@ public: MetaItems clone() const; - MetaItem* get(const char *name); - bool has(const char *name) { + MetaItem* get(const char *name) { return const_cast<MetaItem*>( const_cast<const MetaItems*>(this)->get(name)); } + const MetaItem* get(const char *name) const; + bool has(const char *name) const { return get(name) != 0; } |