Example #1
0
//////////////////////////////////////////////////////////////////////
//
// ClParser::internVarCell
//
//  o Returns %rd of VARDEF instruction.
//  o Returns %rd of UPVAR instruction in pFun for pVar->
//
Register*
ClParser::internVarCell(Variable* pVar)
{
    Register* pCell = ir_find_variable(GetFunction(), pVar);
    if (NULL == pCell)
    {
        pCell = new Register();

        Function* pUser = GetFunction();

        ir_insert_insn(
            new UpVarDefInsn(pCell, pVar),
            pUser->GetEntryInsn()->GetNext() );
    } // if

    return pCell;
} // ClParser::internVarCell