MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
mim::Dispatch Class Reference

Matches a dispatch through a jump table of the form: (target_0, target_1, ...)#index arg where index is not a Literal. More...

#include <mim/tuple.h>

Public Member Functions

 Dispatch (const Def *)
 operator bool () const noexcept
const Appapp () const
const Defcallee () const
const Defarg () const
const Extractextract () const
const Deftuple () const
const Defindex () const
size_t num_targets () const
const Deftarget (size_t i) const

Detailed Description

Matches a dispatch through a jump table of the form: (target_0, target_1, ...)#index arg where index is not a Literal.

Note
Subsumes Branch. If you want to deal with Branch separately, match Branch first:
if (auto branch = Branch(def)) {
// special case first
} else if (auto dispatch = Dispatch(def)) {
// now, the generic case
}
Branch(const Def *)
Definition tuple.cpp:24
Dispatch(const Def *)
Definition tuple.cpp:32

Definition at line 255 of file tuple.h.

Constructor & Destructor Documentation

◆ Dispatch()

mim::Dispatch::Dispatch ( const Def * def)

Member Function Documentation

◆ app()

const App * mim::Dispatch::app ( ) const
inline

Definition at line 261 of file tuple.h.

Referenced by arg(), callee(), and Dispatch().

◆ arg()

const Def * mim::Dispatch::arg ( ) const

Definition at line 44 of file tuple.cpp.

References app(), and mim::App::arg().

◆ callee()

const Def * mim::Dispatch::callee ( ) const

Definition at line 43 of file tuple.cpp.

References app(), and mim::App::callee().

◆ extract()

const Extract * mim::Dispatch::extract ( ) const
inline

Definition at line 265 of file tuple.h.

Referenced by Dispatch(), index(), num_targets(), and tuple().

◆ index()

const Def * mim::Dispatch::index ( ) const
inline

Definition at line 267 of file tuple.h.

References extract(), and mim::Extract::index().

◆ num_targets()

size_t mim::Dispatch::num_targets ( ) const
inline

Definition at line 269 of file tuple.h.

References mim::Lit::as(), extract(), and tuple().

◆ operator bool()

mim::Dispatch::operator bool ( ) const
inlineexplicitnoexcept

Definition at line 259 of file tuple.h.

◆ target()

const Def * mim::Dispatch::target ( size_t i) const
inline

Definition at line 270 of file tuple.h.

References mim::Def::proj(), and tuple().

◆ tuple()

const Def * mim::Dispatch::tuple ( ) const
inline

Definition at line 266 of file tuple.h.

References extract(), and mim::Extract::tuple().

Referenced by num_targets(), and target().


The documentation for this class was generated from the following files: