Helper class for processor modules to build macro instructions.
bool macro_constructor_t::construct_macro |
( |
insn_t * |
insn, |
|
|
bool |
enable |
|
) |
| |
|
inline |
Construct a macro instruction.
This function may be called from ana() to generate a macro instruction.
The real work is done by the 'build_macro()' virtual function. It must be defined by the processor module.
construct_macro() modifies the database using the info provided by build_macro(). It verifies if the instruction can really be created (for example, that other items do not hinder), may plan to reanalyze the macro, etc. If the macro instructions are disabled by the user, construct_macro() will destroy the macro instruction. Note: if INSN_MODMAC is not set in insn.flags, the database will not be modified.
- Parameters
-
insn | the instruction to modify into a macro |
enable | enable macro generation |
- Return values
-
true | the macro instruction is generated in 'insn' |
false | did not create a macro |