[AutoUpgrade] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds

This commit is contained in:
Fangrui Song 2022-03-30 13:31:17 -07:00
parent bdea2afc8c
commit e572927f63
1 changed files with 3 additions and 3 deletions

View File

@ -3808,9 +3808,9 @@ void llvm::UpgradeIntrinsicCall(CallBase *CI, Function *NewFn) {
// This must be an upgrade from a named to a literal struct.
auto *OldST = cast<StructType>(CI->getType());
auto *NewST = cast<StructType>(NewFn->getReturnType());
assert(OldST != NewST && "Return type must have changed");
assert(OldST->getNumElements() == NewST->getNumElements() &&
assert(OldST != NewFn->getReturnType() && "Return type must have changed");
assert(OldST->getNumElements() ==
cast<StructType>(NewFn->getReturnType())->getNumElements() &&
"Must have same number of elements");
SmallVector<Value *> Args(CI->args());