binary_translator/src/InstructionTranslationUnitCache.cpp
/**
 * Get a translated instruction, if it is already translated, or create a new one
 * if no translation has been found.
 */
Get a translated instruction, if it is already translated, or create a new one
if no translation has been found.
Get a translated instruction if it is already translated or create a new one if no translation has been found .
InstructionTranslationUnit* InstructionTranslationUnitCache::find_create(
    ReverseTranslationConfiguration& config, 
    Function* function, 
    uint64_t pc,
    const std::map< unsigned, Value* >& predecessor_values,
    BasicBlock *predecessor_bb,
    bool terminate_last_block)
{
    InstructionTranslationUnit* unit = this->find(function, pc);
    if (!unit)
    {
        unit = this->create(config, function, pc);
    }
    unit->addIncoming(predecessor_values, predecessor_bb);
    if (terminate_last_block)
    {
        IRBuilder<> builder(predecessor_bb);
        builder.CreateBr(unit->getHead());
    }
    return unit;
}
InstructionTranslationUnit * InstructionTranslationUnitCache :: find_create ( ReverseTranslationConfiguration & config , Function * function , uint64_t pc , const std :: map < unsigned , Value * > & predecessor_values , BasicBlock * predecessor_bb , bool terminate_last_block ) { InstructionTranslationUnit * unit = this -> find ( function , pc ) ; if ( ! unit ) { unit = this -> create ( config , function , pc ) ; } unit -> addIncoming ( predecessor_values , predecessor_bb ) ; if ( terminate_last_block ) { IRBuilder < > builder ( predecessor_bb ) ; builder . CreateBr ( unit -> getHead ( ) ) ; } return unit ; }
Get a translated instruction, if it is already translated, or create a new one
 if no translation has been found.
Get a translated instruction if it is already translated or create a new one if no translation has been found .