Skip to content

Commit e0e897e

Browse files
[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();
1 parent d08b0f7 commit e0e897e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/CodeGen/CGCUDARuntime.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ static llvm::Value *emitGetParamBuf(CodeGenFunction &CGF,
6262
RValue CGCUDARuntime::EmitCUDADeviceKernelCallExpr(
6363
CodeGenFunction &CGF, const CUDAKernelCallExpr *E,
6464
ReturnValueSlot ReturnValue, llvm::CallBase **CallOrInvoke) {
65-
ASTContext &Ctx = CGM.getContext();
66-
assert(Ctx.getcudaLaunchDeviceDecl() == E->getConfig()->getDirectCallee());
65+
assert(CGM.getContext().getcudaLaunchDeviceDecl() ==
66+
E->getConfig()->getDirectCallee());
6767

6868
llvm::BasicBlock *ConfigOKBlock = CGF.createBasicBlock("dkcall.configok");
6969
llvm::BasicBlock *ContBlock = CGF.createBasicBlock("dkcall.end");

0 commit comments

Comments
 (0)