mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
Remove unreachable code. (replace with llvm_unreachable to help GCC where necessary)
llvm-svn: 148284
This commit is contained in:
parent
8adac160c9
commit
2526691971
@ -61,6 +61,8 @@ static bool GetX86CpuIDAndInfo(unsigned value, unsigned *rEAX,
|
||||
*rECX = registers[2];
|
||||
*rEDX = registers[3];
|
||||
return false;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
#elif defined(i386) || defined(__i386__) || defined(__x86__) || defined(_M_IX86)
|
||||
#if defined(__GNUC__)
|
||||
@ -87,9 +89,14 @@ static bool GetX86CpuIDAndInfo(unsigned value, unsigned *rEAX,
|
||||
mov dword ptr [esi],edx
|
||||
}
|
||||
return false;
|
||||
// pedantic #else returns to appease -Wunreachable-code (so we don't generate
|
||||
// postprocessed code that looks like "return true; return false;")
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void DetectX86FamilyModel(unsigned EAX, unsigned &Family,
|
||||
|
@ -1886,7 +1886,6 @@ Depends(DependenceKind Flavor, Instruction *Inst, const Value *Arg,
|
||||
}
|
||||
|
||||
llvm_unreachable("Invalid dependence flavor");
|
||||
return true;
|
||||
}
|
||||
|
||||
/// FindDependencies - Walk up the CFG from StartPos (which is in StartBB) and
|
||||
|
@ -249,7 +249,6 @@ unsigned llvm::GetSuccessorNumber(BasicBlock *BB, BasicBlock *Succ) {
|
||||
if (Term->getSuccessor(i) == Succ)
|
||||
return i;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// SplitEdge - Split the edge connecting specified block. Pass P must
|
||||
|
@ -59,7 +59,6 @@ unsigned llvm::getICmpCode(const ICmpInst *ICI, bool InvertPred) {
|
||||
// True -> 7
|
||||
default:
|
||||
llvm_unreachable("Invalid ICmp predicate!");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -458,7 +458,6 @@ struct ConstantCreator<ConstantExpr, Type, ExprMapKeyType> {
|
||||
return new CompareConstantExpr(Ty, Instruction::FCmp, V.subclassdata,
|
||||
V.operands[0], V.operands[1]);
|
||||
llvm_unreachable("Invalid ConstantExpr!");
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1092,8 +1092,7 @@ LLVMLinkage LLVMGetLinkage(LLVMValueRef Global) {
|
||||
return LLVMCommonLinkage;
|
||||
}
|
||||
|
||||
// Should never get here.
|
||||
return static_cast<LLVMLinkage>(0);
|
||||
llvm_unreachable("Make GCC's unreachability happy");
|
||||
}
|
||||
|
||||
void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage) {
|
||||
|
@ -166,8 +166,6 @@ const char *Instruction::getOpcodeName(unsigned OpCode) {
|
||||
|
||||
default: return "<Invalid operator> ";
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// isIdenticalTo - Return true if the specified instruction is exactly
|
||||
|
@ -526,6 +526,4 @@ int main(int argc, char **argv) {
|
||||
case AC_EDisassemble:
|
||||
return DisassembleInput(argv[0], true);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -163,6 +163,4 @@ int main(int argc, char **argv) {
|
||||
case AC_Execute:
|
||||
return executeInput();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "llvm/ADT/StringExtras.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
#include <set>
|
||||
#include <algorithm>
|
||||
using namespace llvm;
|
||||
@ -912,7 +913,7 @@ bool SDTypeConstraint::ApplyTypeConstraint(TreePatternNode *N,
|
||||
EnforceVectorSubVectorTypeIs(NodeToApply->getExtType(ResNo), TP);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
llvm_unreachable("Make GCC's unreachability happy");
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -102,7 +102,6 @@ static inline bool inheritsFrom(InstructionContext child,
|
||||
return false;
|
||||
default:
|
||||
llvm_unreachable("Unknown instruction class");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user