[CUDA][NFC] Fix an unused variable error when compiled with optimization (#170205)

#165519 causes some builds to fail.
[clang/lib/CodeGen/CGCUDARuntime.cpp:65]:15: error: unused variable
'Ctx' [-Werror,-Wunused-variable]
   65 |   ASTContext &Ctx = CGM.getContext();
This commit is contained in:
google-yfyang 2025-12-01 17:19:50 -05:00 committed by GitHub
parent d08b0f7240
commit e0e897e5c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -62,8 +62,8 @@ static llvm::Value *emitGetParamBuf(CodeGenFunction &CGF,
RValue CGCUDARuntime::EmitCUDADeviceKernelCallExpr(
CodeGenFunction &CGF, const CUDAKernelCallExpr *E,
ReturnValueSlot ReturnValue, llvm::CallBase **CallOrInvoke) {
ASTContext &Ctx = CGM.getContext();
assert(Ctx.getcudaLaunchDeviceDecl() == E->getConfig()->getDirectCallee());
assert(CGM.getContext().getcudaLaunchDeviceDecl() ==
E->getConfig()->getDirectCallee());
llvm::BasicBlock *ConfigOKBlock = CGF.createBasicBlock("dkcall.configok");
llvm::BasicBlock *ContBlock = CGF.createBasicBlock("dkcall.end");