Goose  Artifact [0e966b9de8]

Artifact 0e966b9de883256b6573c59d0ae1934c925effbab7f2bb6d15fcb554817ccd7a:

  • File bs/cir/load.h — part of check-in [b4d5bdf6ec] at 2022-06-18 18:51:47 on branch cir-stack-language —
    • Added a location id to all CIR instructions (needed with the stack based approach to locate intermediate results)
    • Fixed a bunch of verifier errors
    • Re-enabled most verifier tests, other than some requiring to re-implement a few more bits
    (user: zlodo size: 737)

#ifndef GOOSE_CIR_LOAD_H
#define GOOSE_CIR_LOAD_H

namespace goose::cir
{
    class Load : public BaseInstr
    {
        public:
            template< typename T >
            Load( T&& type, LocationId loc ) :
                BaseInstr( loc ),
                m_type( forward< T >( type ) )
            {}

            const auto& type() const { return m_type; }

            bool canBeExecuted() const { return true; }
            bool canBeEagerlyEvaluated() const { return true; }
            bool haveSideEffects() const { return false; }

            bool operator<( const Load& rhs ) const;
            friend ostream& operator<<( ostream& out, const Load& ins );

        private:
            eir::Term m_type;
    };
}

#endif