already used.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46519
91177308-0d34-0410-b5e6-
96231b3b80d8
if (llvm::ZExtInst *ZI = dyn_cast<llvm::ZExtInst>(Src)) {
if (ZI->getOperand(0)->getType() == llvm::Type::Int1Ty) {
Value *Result = ZI->getOperand(0);
- ZI->eraseFromParent();
+ // If there aren't any more uses, zap the instruction to save space.
+ // Note that there can be more uses, for example if this
+ // is the result of an assignment.
+ if (ZI->use_empty())
+ ZI->eraseFromParent();
return Result;
}
}
--- /dev/null
+// RUN: clang %s -emit-llvm
+
+int testBoolAssign(void) {
+int ss;
+if ((ss = ss && ss)) {}
+}