25 #ifndef _JIT_COMPILER2_PASSMANAGER
26 #define _JIT_COMPILER2_PASSMANAGER
29 #include <unordered_map>
40 #define MYLOG(EXPR) do { dbg() << EXPR; } while(0)
126 assert(PI &&
"Pass not registered");
153 using PassMapTy = std::unordered_map<PassInfo::IDTy,PassUPtrTy>;
169 template<
class _PassClass>
171 auto pass_id = _PassClass::template ID<_PassClass>();
175 return (_PassClass*)
passes[pass_id].get();
187 template<
class _PassClass>
190 template <
class _PassClass>
Pass *(*)( ConstructorTy)
Pass superclass All compiler passes should inheritate this class.
_PassClass * get_Pass_result()
PassUPtrTy & get_Pass(PassInfo::IDTy ID)
Each instance of PassRunner represents a single run of the compiler2.
std::unordered_map< PassInfo::IDTy, PassUPtrTy > PassMapTy
PassInfo(const char *name, PassInfo::IDTy ID, ConstructorTy ctor)
std::unique_ptr< Pass > PassUPtrTy
ResultReadyMapTy result_ready
Map of ready results.
static PassManager & get()
JNIEnv jclass jobject const char * name
alloc::vector< PassInfo::IDTy >::type ScheduleListTy
PassInfoMapTy::const_iterator registered_begin() const
PassUPtrTy create_Pass(PassInfo::IDTy ID) const
ScheduleListTy::const_iterator schedule_begin()
std::vector< T, Allocator< T > > type
bool passes_are_scheduled
PassMapTy passes
Stores pass instances so other passes can retrieve their results.
static PassInfoMapTy & registered_passes()
PassInfoMapTy::const_iterator registered_end() const
Pass * create_Pass() const
PassRegistry(const char *name)
Manages pass registry and scheduling.
const char * get_Pass_name(PassInfo::IDTy ID)
alloc::unordered_map< PassInfo::IDTy, bool >::type ResultReadyMapTy
static void register_Pass(PassInfo *PI)
DO NOT CALL THIS MANUALLY.
const char * get_name() const
alloc::unordered_map< PassInfo::IDTy, PassInfo * >::type PassInfoMapTy
#define assert_msg(COND, EXPR)
ScheduleListTy::const_iterator schedule_end() const
ConstructorTy ctor
Constructor function pointer.
void runPasses(JITData &JD)
run passes
ScheduleListTy schedule
This is the pass schedule.
std::unordered_map< Key, T, Hash, KeyEqual, Allocator< std::pair< const Key, T > > > type