// Control Flow Graph determination pass

#ifndef CFGPASS_H
#define CFGPASS_H

#include "ast.h"
#include <set>
#include <iostream>
#include "clasplayer.h"

namespace xreate {
class CFGPass
{
public:
    void run();
    CFGPass(ClaspLayer* claspLayer);

private:
    struct Context {
        FID id;
        const CodeScope* scope;
    };

    CFGraph __graph;
    ClaspLayer* clasp;

    void process(const Expression& entity, const Context& context);
    void process(const CodeScope* scope, Context context);
}; }

#endif // CFGPASS_H
