Goose  Diff

Differences From Artifact [9e6d396270]:

  • File bs/cir/branch.h — part of check-in [7992dbe59f] at 2022-05-25 17:28:04 on branch cir-stack-language —
    • Split function invocation code into several specialized versions for each function kind
    • Almost fully completed the migration of CIR to a stack language
    • Compilation-time execution works again
    (user: zlodo size: 2235) [more...]

To Artifact [b249f83bbc]:

  • File bs/cir/branch.h — part of check-in [4edae7e1a3] at 2023-01-10 22:01:36 on branch trunk — Implemented textual dump of a function's CIR to more easily inspect it and implement some code generation tests at the CIR level (user: zlodo size: 2472)

16
17
18
19
20
21
22


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42


43
44
45
46
47
48
49
            const auto& dest() const { return m_dest; }

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

            void addCFGEdges( const ptr< CFG >& cfg, uint32_t srcBBIndex );



        private:
            wptr< BasicBlock > m_dest;
    };

    class CondBranch
    {
        public:
            template< typename BT, typename BF >
            CondBranch( BT&& trueDest, BF&& falseDest ) :
                m_trueDest( forward< BT >( trueDest ) ),
                m_falseDest( forward< BF >( falseDest ) )
            {}

            const auto& trueDest() const { return m_trueDest; }
            const auto& falseDest() const { return m_falseDest; }

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

            void addCFGEdges( const ptr< CFG >& cfg, uint32_t srcBBIndex );



        private:
            wptr< BasicBlock > m_trueDest;
            wptr< BasicBlock > m_falseDest;
    };

    // A special terminator that points to a basic block to use only







>
>




















>
>







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
            const auto& dest() const { return m_dest; }

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

            void addCFGEdges( const ptr< CFG >& cfg, uint32_t srcBBIndex );

            friend ostream& operator<<( ostream& out, const Branch& ter );

        private:
            wptr< BasicBlock > m_dest;
    };

    class CondBranch
    {
        public:
            template< typename BT, typename BF >
            CondBranch( BT&& trueDest, BF&& falseDest ) :
                m_trueDest( forward< BT >( trueDest ) ),
                m_falseDest( forward< BF >( falseDest ) )
            {}

            const auto& trueDest() const { return m_trueDest; }
            const auto& falseDest() const { return m_falseDest; }

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

            void addCFGEdges( const ptr< CFG >& cfg, uint32_t srcBBIndex );

            friend ostream& operator<<( ostream& out, const CondBranch& ter );

        private:
            wptr< BasicBlock > m_trueDest;
            wptr< BasicBlock > m_falseDest;
    };

    // A special terminator that points to a basic block to use only
61
62
63
64
65
66
67


68
69
70
71
72
73
74
75
            const auto& ghostCode() const { return m_ghostCode; }
            const auto& continuation() const { return m_continuation; }

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

            void addCFGEdges( const ptr< CFG >& cfg, uint32_t srcBBIndex );



        private:
            wptr< BasicBlock > m_ghostCode;
            wptr< BasicBlock > m_continuation;
    };
}

#endif







>
>








65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
            const auto& ghostCode() const { return m_ghostCode; }
            const auto& continuation() const { return m_continuation; }

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

            void addCFGEdges( const ptr< CFG >& cfg, uint32_t srcBBIndex );

            friend ostream& operator<<( ostream& out, const GhostBranch& ter );

        private:
            wptr< BasicBlock > m_ghostCode;
            wptr< BasicBlock > m_continuation;
    };
}

#endif