#ifndef EMPATHY_LLR_INSTRUCTION_H
#define EMPATHY_LLR_INSTRUCTION_H

namespace empathy::llr
{
    class BasicBlock;

    class Instruction
    {
        public:
            Instruction() {}

            Instruction( Call&& c ) :
                m_content( move( c ) )
            {}

            Instruction( GetArg&& gv ) :
                m_content( move( gv ) )
            {}

            Instruction( LoadConstInt&& lci ) :
                m_content( move( lci ) )
            {}

            Instruction( LoadConstStr&& lcs ) :
                m_content( move( lcs ) )
            {}

            using Content = variant
            <
                GetArg,
                Call,
                LoadConstInt,
                LoadConstStr
            >;

            const auto& content() const { return m_content; }

            bool canBeExecuted() const;
            bool canBeEagerlyEvaluated() const;

        private:
            Content m_content = GetArg( 0 );
    };
}

#endif
