From fd2310ef5b44b34999c72ec5886a5b039b892526 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Mon, 12 Jun 2017 20:09:53 +0000 Subject: [PATCH] Remove unneeded conditionals - the code is already conditional on the same condition git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305226 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-stress/llvm-stress.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/tools/llvm-stress/llvm-stress.cpp b/tools/llvm-stress/llvm-stress.cpp index 9696dec6d1a..0ed7adb46dd 100644 --- a/tools/llvm-stress/llvm-stress.cpp +++ b/tools/llvm-stress/llvm-stress.cpp @@ -405,17 +405,15 @@ struct ConstModifier: public Modifier { if (Ty->isIntegerTy()) { switch (Ran->Rand() % 7) { - case 0: if (Ty->isIntegerTy()) - return PT->push_back(ConstantInt::get(Ty, - APInt::getAllOnesValue(Ty->getPrimitiveSizeInBits()))); - llvm_unreachable("Unexpected state"); - case 1: if (Ty->isIntegerTy()) - return PT->push_back(ConstantInt::get(Ty, - APInt::getNullValue(Ty->getPrimitiveSizeInBits()))); - llvm_unreachable("Unexpected state"); + case 0: + return PT->push_back(ConstantInt::get( + Ty, APInt::getAllOnesValue(Ty->getPrimitiveSizeInBits()))); + case 1: + return PT->push_back(ConstantInt::get( + Ty, APInt::getNullValue(Ty->getPrimitiveSizeInBits()))); case 2: case 3: case 4: case 5: - case 6: if (Ty->isIntegerTy()) - PT->push_back(ConstantInt::get(Ty, Ran->Rand())); + case 6: + PT->push_back(ConstantInt::get(Ty, Ran->Rand())); } } -- 2.50.1