25 #ifndef _JIT_COMPILER2_PASS
26 #define _JIT_COMPILER2_PASS
77 template<
class _PassClass>
79 if (!allowed_to_use_result(_PassClass::template ID<_PassClass>())) {
80 assert(0 &&
"Not allowed to get result (not declared in get_PassUsage())");
83 return pm->get_Pass_result<_PassClass>();
91 template<
class _PassClass>
93 if (!pm->result_ready[_PassClass::template ID<_PassClass>()])
95 return pm->get_Pass_result<_PassClass>();
133 virtual bool run(
JITData &JD) = 0;
141 virtual bool verify()
const {
return true; }
Pass superclass All compiler passes should inheritate this class.
Each instance of PassRunner represents a single run of the compiler2.
static PassInfo::IDTy ID()
This template will return a unique ID for each type that it is called with.
virtual PassUsage & get_PassUsage(PassUsage &PU) const
Set the requirements for the pass.
virtual void finalize()
Finalize the Pass.
_PassClass * get_Pass() const
Get the result of a previous compiler pass.
static PassInfo::IDTy id_counter
Stores the interdependencies of a pass.
virtual bool is_enabled() const
Allows concrete passes to enable/disable themselves the way they like.
virtual bool verify() const
Verify the Result.
void set_PassRunner(PassRunner *pr)
virtual ~Pass()
Destructor.
_PassClass * get_Pass_if_available() const
Get the result of a previous compiler pass.
virtual void initialize()
Initialize the Pass.