diff options
author | Andy Kaylor <akaylor@nvidia.com> | 2025-07-31 14:54:56 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-31 14:54:56 -0700 |
commit | ba2edbd0c8d7a0199485d2969aebcc4de4a3d983 (patch) | |
tree | 6bfd715ad4fde59675457e5be7df06d495aee901 /clang/lib/CIR/CodeGen/CIRGenModule.cpp | |
parent | e1d45b1b97c1f18e5a5fb9db8621ae4b34ba0ab1 (diff) | |
download | llvm-ba2edbd0c8d7a0199485d2969aebcc4de4a3d983.zip llvm-ba2edbd0c8d7a0199485d2969aebcc4de4a3d983.tar.gz llvm-ba2edbd0c8d7a0199485d2969aebcc4de4a3d983.tar.bz2 |
[CIR] Fix warnings related to unused variables in release builds (#151412)
This fixes a number of warnings in release builds due to variables that
were only being used in asserts. Some of these variables will later be
used in non-debug code, but for now they are unused in release builds.
Diffstat (limited to 'clang/lib/CIR/CodeGen/CIRGenModule.cpp')
-rw-r--r-- | clang/lib/CIR/CodeGen/CIRGenModule.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/CIR/CodeGen/CIRGenModule.cpp b/clang/lib/CIR/CodeGen/CIRGenModule.cpp index d0f9fc3..b143682 100644 --- a/clang/lib/CIR/CodeGen/CIRGenModule.cpp +++ b/clang/lib/CIR/CodeGen/CIRGenModule.cpp @@ -656,8 +656,6 @@ mlir::Value CIRGenModule::getAddrOfGlobalVar(const VarDecl *d, mlir::Type ty, void CIRGenModule::emitGlobalVarDefinition(const clang::VarDecl *vd, bool isTentative) { - const QualType astTy = vd->getType(); - if (getLangOpts().OpenCL || getLangOpts().OpenMPIsTargetDevice) { errorNYI(vd->getSourceRange(), "emit OpenCL/OpenMP global variable"); return; @@ -701,7 +699,7 @@ void CIRGenModule::emitGlobalVarDefinition(const clang::VarDecl *vd, // never attempt to emit a tentative definition if a real one // exists. A use may still exists, however, so we still may need // to do a RAUW. - assert(!astTy->isIncompleteType() && "Unexpected incomplete type"); + assert(!vd->getType()->isIncompleteType() && "Unexpected incomplete type"); init = builder.getZeroInitAttr(convertType(vd->getType())); } else { emitter.emplace(*this); |