Goose  Artifact [3fe283bf09]

Artifact 3fe283bf0933b2154fc3b09e4c199aab9c199a03aa38e8b3979c634ace28eccb:

  • File bs/llr/helpers.cpp — part of check-in [7a7e54ac04] at 2020-07-18 16:25:47 on branch llr-stack-language — Computed values now carry lists of instructions around, instead of expression trees. Also absolutely nothing works anymore.

    Update: closing this branch as I will finally not pursue this. (user: achavasse size: 824)


#include "llr/llr.h"

namespace goose::llr
{
    void AppendInstrSeq( InstrSeq& is, InstrSeq&& isToAppend )
    {
        is.splice( is.end(), isToAppend );

        // TODO update canBeExecuted, store it in InstrSeq?
    }

    void AppendInstrSeq( InstrSeq& is, const InstrSeq& isToAppend )
    {
        for( auto&& instr : isToAppend )
            AppendInstrToSeq( is, instr );
    }

    bool IsValueConstantOrExecutable( const ir::Value& val )
    {
        if( val.isConstant() )
            return true;

        // TODO
        return true;
      //  return val.llr()->canBeExecuted();
    }

    bool CanValueBeEagerlyEvaluated( const ir::Value& val )
    {
        if( val.isConstant() )
            return true;

        // TODO
        return true;
//        return val.llr()->canBeEagerlyEvaluated();
    }
}