Repository: dotnet/runtime
File: src/coreclr/jit/importercalls.cpp (C++)

Code before:

    JITLOG((LL_INFO1000000, "\nInline a PINVOKE call from method %s\n", info.compFullName));

    call->gtFlags |= GTF_CALL_UNMANAGED;
    call->unmgdCallConv = unmanagedCallConv;
    if (!call->IsSuppressGCTransition())
    {
        info.compUnmanagedCallCountWithGCTransition++;
    }

    if (unmanagedCallConv == CorInfoCallConvExtension::C ||
        unmanagedCallConv == CorInfoCallConvExtension::CMemberFunction)
    {
        call->gtFlags |= GTF_CALL_POP_ARGS;
    }
}

//------------------------------------------------------------------------
// impSetupAsyncCall:
//   Register a call as being async and set up context handling information depending on the IL.
//
// Arguments:
//    call        - The call
//    opcode      - The IL opcode for the call
//    prefixFlags - Flags containing context handling information from IL
//    numILArgs   - The number of IL arguments for the call
//    callDI      - Debug info for the async call
//
void Compiler::impSetupAsyncCall(GenTreeCall* call, OPCODE opcode, unsigned prefixFlags, const DebugInfo& callDI)
{
    AsyncCallInfo asyncInfo;

    unsigned newSourceTypes = ICorDebugInfo::ASYNC;
    newSourceTypes |= (unsigned)callDI.GetLocation().GetSourceTypes() & ~ICorDebugInfo::CALL_INSTRUCTION;
    ILLocation newILLocation(callDI.GetLocation().GetOffset(), (ICorDebugInfo::SourceTypes)newSourceTypes);
    asyncInfo.CallAsyncDebugInfo = DebugInfo(callDI.GetInlineContext(), newILLocation);

    if ((prefixFlags & PREFIX_IS_TASK_AWAIT) != 0)
    {
        JITDUMP("Call is an async task await\n");

        if ((prefixFlags & PREFIX_TASK_AWAIT_CONTINUE_ON_CAPTURED_CONTEXT) != 0)
        {
            asyncInfo.ContinuationContextHandling = ContinuationContextHandling::ContinueOnCapturedContext;
            JITDUMP("  Continuation continues on captured context\n");
        }
        else
        {
            asyncInfo.ContinuationContextHandling = ContinuationContextHandling::ContinueOnThreadPool;
            JITDUMP("  Continuation continues on thread pool\n");
        }

Review comment (suggestion):
The parameter `numILArgs` is documented but does not appear in the function signature for `impSetupAsyncCall()`. Either the parameter should be added to the function or this documentation line should be removed.
```suggestion

```

Code after:

    JITLOG((LL_INFO1000000, "\nInline a PINVOKE call from method %s\n", info.compFullName));

    call->gtFlags |= GTF_CALL_UNMANAGED;
    call->unmgdCallConv = unmanagedCallConv;
    if (!call->IsSuppressGCTransition())
    {
        info.compUnmanagedCallCountWithGCTransition++;
    }

    if (unmanagedCallConv == CorInfoCallConvExtension::C ||
        unmanagedCallConv == CorInfoCallConvExtension::CMemberFunction)
    {
        call->gtFlags |= GTF_CALL_POP_ARGS;
    }
}

//------------------------------------------------------------------------
// impSetupAsyncCall:
//   Register a call as being async and set up context handling information depending on the IL.
//
// Arguments:
//    call        - The call
//    opcode      - The IL opcode for the call
//    prefixFlags - Flags containing context handling information from IL
//    callDI      - Debug info for the async call
//
void Compiler::impSetupAsyncCall(GenTreeCall* call, OPCODE opcode, unsigned prefixFlags, const DebugInfo& callDI)
{
    AsyncCallInfo asyncInfo;

    unsigned newSourceTypes = ICorDebugInfo::ASYNC;
    newSourceTypes |= (unsigned)callDI.GetLocation().GetSourceTypes() & ~ICorDebugInfo::CALL_INSTRUCTION;
    ILLocation newILLocation(callDI.GetLocation().GetOffset(), (ICorDebugInfo::SourceTypes)newSourceTypes);
    asyncInfo.CallAsyncDebugInfo = DebugInfo(callDI.GetInlineContext(), newILLocation);

    if ((prefixFlags & PREFIX_IS_TASK_AWAIT) != 0)
    {
        JITDUMP("Call is an async task await\n");

        if ((prefixFlags & PREFIX_TASK_AWAIT_CONTINUE_ON_CAPTURED_CONTEXT) != 0)
        {
            asyncInfo.ContinuationContextHandling = ContinuationContextHandling::ContinueOnCapturedContext;
            JITDUMP("  Continuation continues on captured context\n");
        }
        else
        {
            asyncInfo.ContinuationContextHandling = ContinuationContextHandling::ContinueOnThreadPool;
            JITDUMP("  Continuation continues on thread pool\n");
        }
    }