aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Analysis/ScalarEvolutionExpressions.h1
-rw-r--r--lib/CodeGen/GCStrategy.cpp2
-rw-r--r--lib/CodeGen/StrongPHIElimination.cpp1
-rw-r--r--lib/ExecutionEngine/Interpreter/Execution.cpp2
-rw-r--r--lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp1
-rw-r--r--lib/MC/MCDisassembler/EDDisassembler.cpp27
-rw-r--r--lib/Support/CrashRecoveryContext.cpp1
-rw-r--r--lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp1
-rw-r--r--lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp1
-rw-r--r--lib/Target/MBlaze/MCTargetDesc/MBlazeMCTargetDesc.cpp2
-rw-r--r--lib/Target/Mips/MipsAsmPrinter.cpp5
-rw-r--r--lib/Target/PTX/PTXAsmPrinter.cpp1
-rw-r--r--lib/Target/PTX/PTXRegisterInfo.cpp42
-rw-r--r--lib/Target/Sparc/SparcISelDAGToDAG.cpp1
-rw-r--r--lib/Target/X86/AsmParser/X86AsmParser.cpp1
-rw-r--r--lib/Target/X86/Disassembler/X86DisassemblerDecoder.c4
-rw-r--r--lib/Transforms/Scalar/IndVarSimplify.cpp1
-rw-r--r--lib/VMCore/Instructions.cpp17
-rw-r--r--tools/llvm-ld/llvm-ld.cpp3
-rw-r--r--utils/KillTheDoctor/KillTheDoctor.cpp46
-rw-r--r--utils/TableGen/X86DisassemblerTables.cpp2
21 files changed, 24 insertions, 138 deletions
diff --git a/include/llvm/Analysis/ScalarEvolutionExpressions.h b/include/llvm/Analysis/ScalarEvolutionExpressions.h
index b6f0ae5..47b3710 100644
--- a/include/llvm/Analysis/ScalarEvolutionExpressions.h
+++ b/include/llvm/Analysis/ScalarEvolutionExpressions.h
@@ -491,7 +491,6 @@ namespace llvm {
RetVal visitCouldNotCompute(const SCEVCouldNotCompute *S) {
llvm_unreachable("Invalid use of SCEVCouldNotCompute!");
- return RetVal();
}
};
}
diff --git a/lib/CodeGen/GCStrategy.cpp b/lib/CodeGen/GCStrategy.cpp
index 970c8bc..506b5cf 100644
--- a/lib/CodeGen/GCStrategy.cpp
+++ b/lib/CodeGen/GCStrategy.cpp
@@ -112,7 +112,7 @@ bool GCStrategy::initializeCustomLowering(Module &M) { return false; }
bool GCStrategy::performCustomLowering(Function &F) {
dbgs() << "gc " << getName() << " must override performCustomLowering.\n";
- llvm_unreachable(0);
+ llvm_unreachable("must override performCustomLowering");
}
diff --git a/lib/CodeGen/StrongPHIElimination.cpp b/lib/CodeGen/StrongPHIElimination.cpp
index 202c4cb..c6fdc73 100644
--- a/lib/CodeGen/StrongPHIElimination.cpp
+++ b/lib/CodeGen/StrongPHIElimination.cpp
@@ -228,7 +228,6 @@ static MachineOperand *findLastUse(MachineBasicBlock *MBB, unsigned Reg) {
return &MO;
}
}
- return NULL;
}
bool StrongPHIElimination::runOnMachineFunction(MachineFunction &MF) {
diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp
index ac4c49f..3dce3b3 100644
--- a/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/lib/ExecutionEngine/Interpreter/Execution.cpp
@@ -1235,7 +1235,7 @@ GenericValue Interpreter::getConstantExprValue (ConstantExpr *CE,
break;
default:
dbgs() << "Unhandled ConstantExpr: " << *CE << "\n";
- llvm_unreachable(0);
+ llvm_unreachable("Unhandled ConstantExpr");
}
return Dest;
}
diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
index 75e4f71..4553ef4 100644
--- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
+++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
@@ -34,7 +34,6 @@ resolveRelocation(uint8_t *Address, uint64_t Value, bool isPCRel,
return resolveARMRelocation((uintptr_t)Address, (uintptr_t)Value,
isPCRel, Type, Size, Addend);
}
- llvm_unreachable("");
}
bool RuntimeDyldMachO::
diff --git a/lib/MC/MCDisassembler/EDDisassembler.cpp b/lib/MC/MCDisassembler/EDDisassembler.cpp
index 9edf505..ea77902 100644
--- a/lib/MC/MCDisassembler/EDDisassembler.cpp
+++ b/lib/MC/MCDisassembler/EDDisassembler.cpp
@@ -104,27 +104,22 @@ EDDisassembler *EDDisassembler::getDisassembler(StringRef str,
CPUKey key;
key.Triple = str.str();
key.Syntax = syntax;
-
+
EDDisassembler::DisassemblerMap_t::iterator i = sDisassemblers.find(key);
-
+
if (i != sDisassemblers.end()) {
return i->second;
}
- else {
- EDDisassembler *sdd = new EDDisassembler(key);
- if (!sdd->valid()) {
- delete sdd;
- return NULL;
- }
-
- sDisassemblers[key] = sdd;
-
- return sdd;
+
+ EDDisassembler *sdd = new EDDisassembler(key);
+ if (!sdd->valid()) {
+ delete sdd;
+ return NULL;
}
-
- return NULL;
-
- return getDisassembler(Triple(str).getArch(), syntax);
+
+ sDisassemblers[key] = sdd;
+
+ return sdd;
}
EDDisassembler::EDDisassembler(CPUKey &key) :
diff --git a/lib/Support/CrashRecoveryContext.cpp b/lib/Support/CrashRecoveryContext.cpp
index 263114c..e2af0bc 100644
--- a/lib/Support/CrashRecoveryContext.cpp
+++ b/lib/Support/CrashRecoveryContext.cpp
@@ -165,7 +165,6 @@ static LONG CALLBACK ExceptionHandler(PEXCEPTION_POINTERS ExceptionInfo)
// Note that we don't actually get here because HandleCrash calls
// longjmp, which means the HandleCrash function never returns.
llvm_unreachable("Handled the crash, should have longjmp'ed out of here");
- return EXCEPTION_CONTINUE_SEARCH;
}
// Because the Enable and Disable calls are static, it means that
diff --git a/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp b/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp
index bbb1dd5..a821192 100644
--- a/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp
+++ b/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp
@@ -673,7 +673,6 @@ void ARMInstPrinter::printMSRMaskOperand(const MCInst *MI, unsigned OpNum,
case 8: O << "nzcvq"; return;
case 12: O << "nzcvqg"; return;
}
- llvm_unreachable("Unexpected mask value!");
}
if (SpecRegRBit)
diff --git a/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp b/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
index 89aa68f..32bf18c 100644
--- a/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
+++ b/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
@@ -155,7 +155,6 @@ static MCStreamer *createMCStreamer(const Target &T, StringRef TT,
if (TheTriple.isOSWindows()) {
llvm_unreachable("ARM does not support Windows COFF format");
- return NULL;
}
return createELFStreamer(Ctx, MAB, OS, Emitter, RelaxAll, NoExecStack);
diff --git a/lib/Target/MBlaze/MCTargetDesc/MBlazeMCTargetDesc.cpp b/lib/Target/MBlaze/MCTargetDesc/MBlazeMCTargetDesc.cpp
index 9d64cf2..f83e8ab 100644
--- a/lib/Target/MBlaze/MCTargetDesc/MBlazeMCTargetDesc.cpp
+++ b/lib/Target/MBlaze/MCTargetDesc/MBlazeMCTargetDesc.cpp
@@ -83,12 +83,10 @@ static MCStreamer *createMCStreamer(const Target &T, StringRef TT,
if (TheTriple.isOSDarwin()) {
llvm_unreachable("MBlaze does not support Darwin MACH-O format");
- return NULL;
}
if (TheTriple.isOSWindows()) {
llvm_unreachable("MBlaze does not support Windows COFF format");
- return NULL;
}
return createELFStreamer(Ctx, MAB, _OS, _Emitter, RelaxAll, NoExecStack);
diff --git a/lib/Target/Mips/MipsAsmPrinter.cpp b/lib/Target/Mips/MipsAsmPrinter.cpp
index fbc5f7d..9ddc08a 100644
--- a/lib/Target/Mips/MipsAsmPrinter.cpp
+++ b/lib/Target/Mips/MipsAsmPrinter.cpp
@@ -246,11 +246,8 @@ const char *MipsAsmPrinter::getCurrentABIString() const {
case MipsSubtarget::N32: return "abiN32";
case MipsSubtarget::N64: return "abi64";
case MipsSubtarget::EABI: return "eabi32"; // TODO: handle eabi64
- default: break;
+ default: llvm_unreachable("Unknown Mips ABI");;
}
-
- llvm_unreachable("Unknown Mips ABI");
- return NULL;
}
void MipsAsmPrinter::EmitFunctionEntryLabel() {
diff --git a/lib/Target/PTX/PTXAsmPrinter.cpp b/lib/Target/PTX/PTXAsmPrinter.cpp
index 3a2e8b1..58ac5f2 100644
--- a/lib/Target/PTX/PTXAsmPrinter.cpp
+++ b/lib/Target/PTX/PTXAsmPrinter.cpp
@@ -79,7 +79,6 @@ static const char *getStateSpaceName(unsigned addressSpace) {
case PTXStateSpace::Parameter: return "param";
case PTXStateSpace::Shared: return "shared";
}
- return NULL;
}
static const char *getTypeName(Type* type) {
diff --git a/lib/Target/PTX/PTXRegisterInfo.cpp b/lib/Target/PTX/PTXRegisterInfo.cpp
index b8bb9e8..3f087cd 100644
--- a/lib/Target/PTX/PTXRegisterInfo.cpp
+++ b/lib/Target/PTX/PTXRegisterInfo.cpp
@@ -31,44 +31,8 @@ PTXRegisterInfo::PTXRegisterInfo(PTXTargetMachine &TM,
: PTXGenRegisterInfo(0), TII(tii) {
}
-void PTXRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
- int SPAdj,
- RegScavenger *RS) const {
- unsigned Index;
- MachineInstr &MI = *II;
- //MachineBasicBlock &MBB = *MI.getParent();
- //DebugLoc dl = MI.getDebugLoc();
- //MachineRegisterInfo &MRI = MI.getParent()->getParent()->getRegInfo();
-
- //unsigned Reg = MRI.createVirtualRegister(PTX::RegF32RegisterClass);
-
+void PTXRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator /*II*/,
+ int /*SPAdj*/,
+ RegScavenger * /*RS*/) const {
llvm_unreachable("FrameIndex should have been previously eliminated!");
-
- Index = 0;
- while (!MI.getOperand(Index).isFI()) {
- ++Index;
- assert(Index < MI.getNumOperands() &&
- "Instr does not have a FrameIndex operand!");
- }
-
- int FrameIndex = MI.getOperand(Index).getIndex();
-
- DEBUG(dbgs() << "eliminateFrameIndex: " << MI);
- DEBUG(dbgs() << "- SPAdj: " << SPAdj << "\n");
- DEBUG(dbgs() << "- FrameIndex: " << FrameIndex << "\n");
-
- //MachineInstr* MI2 = BuildMI(MBB, II, dl, TII.get(PTX::LOAD_LOCAL_F32))
- //.addReg(Reg, RegState::Define).addImm(FrameIndex);
- //if (MI2->findFirstPredOperandIdx() == -1) {
- // MI2->addOperand(MachineOperand::CreateReg(PTX::NoRegister, /*IsDef=*/false));
- // MI2->addOperand(MachineOperand::CreateImm(PTX::PRED_NORMAL));
- //}
- //MI2->dump();
-
- //MachineOperand ESOp = MachineOperand::CreateES("__local__");
-
- // This frame index is post stack slot re-use assignments
- //MI.getOperand(Index).ChangeToRegister(Reg, false);
- MI.getOperand(Index).ChangeToImmediate(FrameIndex);
- //MI.getOperand(Index) = ESOp;
}
diff --git a/lib/Target/Sparc/SparcISelDAGToDAG.cpp b/lib/Target/Sparc/SparcISelDAGToDAG.cpp
index 8c6103d..93710c4 100644
--- a/lib/Target/Sparc/SparcISelDAGToDAG.cpp
+++ b/lib/Target/Sparc/SparcISelDAGToDAG.cpp
@@ -176,7 +176,6 @@ SDNode *SparcDAGToDAGISel::Select(SDNode *N) {
MulLHS, MulRHS);
// The high part is in the Y register.
return CurDAG->SelectNodeTo(N, SP::RDY, MVT::i32, SDValue(Mul, 1));
- return NULL;
}
}
diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp
index a1f1d5c..05340c1 100644
--- a/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ b/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -1444,7 +1444,6 @@ processInstruction(MCInst &Inst,
return true;
}
}
- return false;
}
bool X86AsmParser::
diff --git a/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c b/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c
index 3740f49..e055773 100644
--- a/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c
+++ b/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c
@@ -82,11 +82,9 @@ static int modRMRequired(OpcodeType type,
decision = &THREEBYTEA7_SYM;
break;
}
-
+
return decision->opcodeDecisions[insnContext].modRMDecisions[opcode].
modrm_type != MODRM_ONEENTRY;
-
- return 0;
}
/*
diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp
index 917ec58..d1e57e1 100644
--- a/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -920,7 +920,6 @@ Instruction *WidenIV::CloneIVUser(NarrowIVDefUse DU) {
}
return WideBO;
}
- llvm_unreachable(0);
}
/// No-wrap operations can transfer sign extension of their result to their
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index d113aca..11fd5b6 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/lib/VMCore/Instructions.cpp
@@ -2559,9 +2559,8 @@ CastInst::getCastOpcode(
assert(DestBits == SrcBits &&
"Casting vector to floating point of different width");
return BitCast; // same size, no-op cast
- } else {
- llvm_unreachable("Casting pointer or non-first class to float");
}
+ llvm_unreachable("Casting pointer or non-first class to float");
} else if (DestTy->isVectorTy()) {
assert(DestBits == SrcBits &&
"Illegal cast to vector (wrong type or size)");
@@ -2571,24 +2570,16 @@ CastInst::getCastOpcode(
return BitCast; // ptr -> ptr
} else if (SrcTy->isIntegerTy()) {
return IntToPtr; // int -> ptr
- } else {
- llvm_unreachable("Casting pointer to other than pointer or int");
}
+ llvm_unreachable("Casting pointer to other than pointer or int");
} else if (DestTy->isX86_MMXTy()) {
if (SrcTy->isVectorTy()) {
assert(DestBits == SrcBits && "Casting vector of wrong width to X86_MMX");
return BitCast; // 64-bit vector to MMX
- } else {
- llvm_unreachable("Illegal cast to X86_MMX");
}
- } else {
- llvm_unreachable("Casting to type that is not first-class");
+ llvm_unreachable("Illegal cast to X86_MMX");
}
-
- // If we fall through to here we probably hit an assertion cast above
- // and assertions are not turned on. Anything we return is an error, so
- // BitCast is as good a choice as any.
- return BitCast;
+ llvm_unreachable("Casting to type that is not first-class");
}
//===----------------------------------------------------------------------===//
diff --git a/tools/llvm-ld/llvm-ld.cpp b/tools/llvm-ld/llvm-ld.cpp
index f1ee4ad..ecf0476 100644
--- a/tools/llvm-ld/llvm-ld.cpp
+++ b/tools/llvm-ld/llvm-ld.cpp
@@ -423,7 +423,7 @@ static void EmitShellScript(char **argv, Module *M) {
PrintAndExit(ErrMsg, M);
return;
-#endif
+#else
// Output the script to start the program...
std::string ErrorInfo;
@@ -469,6 +469,7 @@ static void EmitShellScript(char **argv, Module *M) {
}
Out2.os() << " " << BitcodeOutputFilename << " ${1+\"$@\"}\n";
Out2.keep();
+#endif
}
// BuildLinkItems -- This function generates a LinkItemList for the LinkItems
diff --git a/utils/KillTheDoctor/KillTheDoctor.cpp b/utils/KillTheDoctor/KillTheDoctor.cpp
index 1ddae0b..70713b2 100644
--- a/utils/KillTheDoctor/KillTheDoctor.cpp
+++ b/utils/KillTheDoctor/KillTheDoctor.cpp
@@ -211,19 +211,6 @@ static error_code GetFileNameFromHandle(HANDLE FileHandle,
}
}
-static std::string QuoteProgramPathIfNeeded(StringRef Command) {
- if (Command.find_first_of(' ') == StringRef::npos)
- return Command;
- else {
- std::string ret;
- ret.reserve(Command.size() + 3);
- ret.push_back('"');
- ret.append(Command.begin(), Command.end());
- ret.push_back('"');
- return ret;
- }
-}
-
/// @brief Find program using shell lookup rules.
/// @param Program This is either an absolute path, relative path, or simple a
/// program name. Look in PATH for any programs that match. If no
@@ -269,39 +256,6 @@ static std::string FindProgram(const std::string &Program, error_code &ec) {
return PathName;
}
-static error_code EnableDebugPrivileges() {
- HANDLE TokenHandle;
- BOOL success = ::OpenProcessToken(::GetCurrentProcess(),
- TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY,
- &TokenHandle);
- if (!success)
- return windows_error(::GetLastError());
-
- TokenScopedHandle Token(TokenHandle);
- TOKEN_PRIVILEGES TokenPrivileges;
- LUID LocallyUniqueID;
-
- success = ::LookupPrivilegeValueA(NULL,
- SE_DEBUG_NAME,
- &LocallyUniqueID);
- if (!success)
- return windows_error(::GetLastError());
-
- TokenPrivileges.PrivilegeCount = 1;
- TokenPrivileges.Privileges[0].Luid = LocallyUniqueID;
- TokenPrivileges.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
-
- success = ::AdjustTokenPrivileges(Token,
- FALSE,
- &TokenPrivileges,
- sizeof(TOKEN_PRIVILEGES),
- NULL,
- NULL);
- // The value of success is basically useless. Either way we are just returning
- // the value of ::GetLastError().
- return windows_error(::GetLastError());
-}
-
static StringRef ExceptionCodeToString(DWORD ExceptionCode) {
switch(ExceptionCode) {
case EXCEPTION_ACCESS_VIOLATION: return "EXCEPTION_ACCESS_VIOLATION";
diff --git a/utils/TableGen/X86DisassemblerTables.cpp b/utils/TableGen/X86DisassemblerTables.cpp
index b22aedd..33cc017 100644
--- a/utils/TableGen/X86DisassemblerTables.cpp
+++ b/utils/TableGen/X86DisassemblerTables.cpp
@@ -140,8 +140,6 @@ static inline const char* stringForContext(InstructionContext insnContext) {
INSTRUCTION_CONTEXTS
#undef ENUM_ENTRY
}
-
- return 0;
}
/// stringForOperandType - Like stringForContext, but for OperandTypes.