Changeset 2e9b59b for src/AST/Decl.hpp


Ignore:
Timestamp:
Apr 19, 2022, 3:00:04 PM (3 years ago)
Author:
m3zulfiq <m3zulfiq@…>
Branches:
ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
Children:
5b84a321
Parents:
ba897d21 (diff), bb7c77d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

added benchmark and evaluations chapter to thesis

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Decl.hpp

    rba897d21 r2e9b59b  
    302302class EnumDecl final : public AggregateDecl {
    303303public:
     304        ptr<Type> base;
     305
    304306        EnumDecl( const CodeLocation& loc, const std::string& name,
    305                 std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall )
    306         : AggregateDecl( loc, name, std::move(attrs), linkage ), enumValues() {}
     307                std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall, Type * base = nullptr,
     308                 std::unordered_map< std::string, long long > enumValues = std::unordered_map< std::string, long long >() )
     309        : AggregateDecl( loc, name, std::move(attrs), linkage ), base(base), enumValues(enumValues) {}
    307310
    308311        /// gets the integer value for this enumerator, returning true iff value found
     312        // Maybe it is not used in producing the enum value
    309313        bool valueOf( const Decl * enumerator, long long& value ) const;
    310314
     
    312316
    313317        const char * typeString() const override { return aggrString( Enum ); }
     318
     319        bool isTyped() {return base && base.get();}
    314320
    315321private:
Note: See TracChangeset for help on using the changeset viewer.