ICorProfilerFunctionControl::SetCodegenFlags Method

Sets one or more flags from the COR_PRF_CODEGEN_FLAGS enumeration to control code generation for a just-in-time (JIT) recompiled function.

Syntax

HRESULT SetCodegenFlags(  
    [in] DWORD flags);  

Parameters

flags
[in] One or more flags from the COR_PRF_CODEGEN_FLAGS enumeration.

Remarks

The profiler obtains an instance of this interface through the ICorProfilerCallback4::GetReJITParameters callback. SetCodegenFlags allows the profiler to control the code generation for the recompiled function. As with all other JIT recompilation parameters, the code generation flags apply to all instances of the function.

The JIT compiler considers these compilation flags, along with other flags specified by other sources, when compiling a function. The other sources include the debugger, global flags set by the profiler on startup by using the ICorProfilerInfo::SetEventMask method (with the values COR_PRF_DISABLE_INLINING and COR_PRF_DISABLE_OPTIMIZATIONS), and the profiler’s ICorProfilerCallback::JITInlining callback. The JIT compiler gives precedence to a source that requests the least amount of optimizing. For example, if the profiler specifies COR_PRF_DISABLE_INLINING on startup, but does not specify COR_PRF_CODEGEN_DISABLE_INLINING in the ICorProfilerFunctionControl::SetCodegenFlags callback, inlining is still disabled. Similarly, if the profiler does not specify COR_PRF_CODEGEN_DISABLE_INLINING in SetCodegenFlags, but then disables inlining by using the ICorProfilerCallback::JITInlining callback, inlining is disabled.

Requirements

Platforms: See System Requirements.

Header: CorProf.idl, CorProf.h

Library: CorGuids.lib

.NET Framework Versions: Available since 4.5

See also