HRESULT RewriteIL()

in ProfilingAPI/ReJITEnterLeaveHooks/ILRewriter.cpp [822:844]


HRESULT RewriteIL(
    ICorProfilerInfo * pICorProfilerInfo,
    ICorProfilerFunctionControl * pICorProfilerFunctionControl,
    ModuleID moduleID,
    mdMethodDef methodDef,
    FunctionID functionId,
    UINT_PTR enterMethodAddress,
    UINT_PTR exitMethodAddress,

    ULONG32 methodSignature)
{
    ILRewriter rewriter(pICorProfilerInfo, pICorProfilerFunctionControl, moduleID, methodDef);

    IfFailRet(rewriter.Import());
    {
        // Adds enter/exit probes
        IfFailRet(AddEnterProbe(&rewriter, functionId, enterMethodAddress, methodSignature));
        IfFailRet(AddExitProbe(&rewriter, functionId, exitMethodAddress, methodSignature));
    }
    IfFailRet(rewriter.Export());

    return S_OK;
}