mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
Remove unnecessary default cases in switches that cover all enum values.
llvm-svn: 147855
This commit is contained in:
parent
969b8a6903
commit
8d47bb30e3
@ -114,7 +114,6 @@ public:
|
|||||||
bool hasEncodingData() const { return hasEncodingData(getEncoding()); }
|
bool hasEncodingData() const { return hasEncodingData(getEncoding()); }
|
||||||
static bool hasEncodingData(Encoding E) {
|
static bool hasEncodingData(Encoding E) {
|
||||||
switch (E) {
|
switch (E) {
|
||||||
default: assert(0 && "Unknown encoding");
|
|
||||||
case Fixed:
|
case Fixed:
|
||||||
case VBR:
|
case VBR:
|
||||||
return true;
|
return true;
|
||||||
|
@ -107,8 +107,6 @@ public:
|
|||||||
|
|
||||||
static ISD::NodeType getExtendForContent(BooleanContent Content) {
|
static ISD::NodeType getExtendForContent(BooleanContent Content) {
|
||||||
switch (Content) {
|
switch (Content) {
|
||||||
default:
|
|
||||||
assert(false && "Unknown BooleanContent!");
|
|
||||||
case UndefinedBooleanContent:
|
case UndefinedBooleanContent:
|
||||||
// Extend by adding rubbish bits.
|
// Extend by adding rubbish bits.
|
||||||
return ISD::ANY_EXTEND;
|
return ISD::ANY_EXTEND;
|
||||||
|
@ -129,7 +129,6 @@ AliasAnalysisCounter::alias(const Location &LocA, const Location &LocB) {
|
|||||||
|
|
||||||
const char *AliasString;
|
const char *AliasString;
|
||||||
switch (R) {
|
switch (R) {
|
||||||
default: llvm_unreachable("Unknown alias type!");
|
|
||||||
case NoAlias: No++; AliasString = "No alias"; break;
|
case NoAlias: No++; AliasString = "No alias"; break;
|
||||||
case MayAlias: May++; AliasString = "May alias"; break;
|
case MayAlias: May++; AliasString = "May alias"; break;
|
||||||
case PartialAlias: Partial++; AliasString = "Partial alias"; break;
|
case PartialAlias: Partial++; AliasString = "Partial alias"; break;
|
||||||
@ -156,7 +155,6 @@ AliasAnalysisCounter::getModRefInfo(ImmutableCallSite CS,
|
|||||||
|
|
||||||
const char *MRString;
|
const char *MRString;
|
||||||
switch (R) {
|
switch (R) {
|
||||||
default: llvm_unreachable("Unknown mod/ref type!");
|
|
||||||
case NoModRef: NoMR++; MRString = "NoModRef"; break;
|
case NoModRef: NoMR++; MRString = "NoModRef"; break;
|
||||||
case Ref: JustRef++; MRString = "JustRef"; break;
|
case Ref: JustRef++; MRString = "JustRef"; break;
|
||||||
case Mod: JustMod++; MRString = "JustMod"; break;
|
case Mod: JustMod++; MRString = "JustMod"; break;
|
||||||
|
@ -193,8 +193,6 @@ bool AAEval::runOnFunction(Function &F) {
|
|||||||
case AliasAnalysis::MustAlias:
|
case AliasAnalysis::MustAlias:
|
||||||
PrintResults("MustAlias", PrintMustAlias, *I1, *I2, F.getParent());
|
PrintResults("MustAlias", PrintMustAlias, *I1, *I2, F.getParent());
|
||||||
++MustAlias; break;
|
++MustAlias; break;
|
||||||
default:
|
|
||||||
errs() << "Unknown alias query result!\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -223,8 +221,6 @@ bool AAEval::runOnFunction(Function &F) {
|
|||||||
case AliasAnalysis::ModRef:
|
case AliasAnalysis::ModRef:
|
||||||
PrintModRefResults("Both ModRef", PrintModRef, I, *V, F.getParent());
|
PrintModRefResults("Both ModRef", PrintModRef, I, *V, F.getParent());
|
||||||
++ModRef; break;
|
++ModRef; break;
|
||||||
default:
|
|
||||||
errs() << "Unknown alias query result!\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,6 @@ TransformImpl(const SCEV *S, Instruction *User, Value *OperandValToReplace) {
|
|||||||
// Conservatively use AnyWrap until/unless we need FlagNW.
|
// Conservatively use AnyWrap until/unless we need FlagNW.
|
||||||
const SCEV *Result = SE.getAddRecExpr(Operands, L, SCEV::FlagAnyWrap);
|
const SCEV *Result = SE.getAddRecExpr(Operands, L, SCEV::FlagAnyWrap);
|
||||||
switch (Kind) {
|
switch (Kind) {
|
||||||
default: llvm_unreachable("Unexpected transform name!");
|
|
||||||
case NormalizeAutodetect:
|
case NormalizeAutodetect:
|
||||||
if (IVUseShouldUsePostIncValue(User, OperandValToReplace, L, &DT)) {
|
if (IVUseShouldUsePostIncValue(User, OperandValToReplace, L, &DT)) {
|
||||||
const SCEV *TransformedStep =
|
const SCEV *TransformedStep =
|
||||||
|
@ -2438,7 +2438,6 @@ bool LLParser::ConvertValIDToValue(Type *Ty, ValID &ID, Value *&V,
|
|||||||
return Error(ID.Loc, "functions are not values, refer to them as pointers");
|
return Error(ID.Loc, "functions are not values, refer to them as pointers");
|
||||||
|
|
||||||
switch (ID.Kind) {
|
switch (ID.Kind) {
|
||||||
default: llvm_unreachable("Unknown ValID!");
|
|
||||||
case ValID::t_LocalID:
|
case ValID::t_LocalID:
|
||||||
if (!PFS) return Error(ID.Loc, "invalid use of function-local name");
|
if (!PFS) return Error(ID.Loc, "invalid use of function-local name");
|
||||||
V = PFS->GetVal(ID.UIntVal, Ty, ID.Loc);
|
V = PFS->GetVal(ID.UIntVal, Ty, ID.Loc);
|
||||||
|
@ -126,7 +126,6 @@ static unsigned GetEncodedRMWOperation(AtomicRMWInst::BinOp Op) {
|
|||||||
|
|
||||||
static unsigned GetEncodedOrdering(AtomicOrdering Ordering) {
|
static unsigned GetEncodedOrdering(AtomicOrdering Ordering) {
|
||||||
switch (Ordering) {
|
switch (Ordering) {
|
||||||
default: llvm_unreachable("Unknown atomic ordering");
|
|
||||||
case NotAtomic: return bitc::ORDERING_NOTATOMIC;
|
case NotAtomic: return bitc::ORDERING_NOTATOMIC;
|
||||||
case Unordered: return bitc::ORDERING_UNORDERED;
|
case Unordered: return bitc::ORDERING_UNORDERED;
|
||||||
case Monotonic: return bitc::ORDERING_MONOTONIC;
|
case Monotonic: return bitc::ORDERING_MONOTONIC;
|
||||||
@ -139,7 +138,6 @@ static unsigned GetEncodedOrdering(AtomicOrdering Ordering) {
|
|||||||
|
|
||||||
static unsigned GetEncodedSynchScope(SynchronizationScope SynchScope) {
|
static unsigned GetEncodedSynchScope(SynchronizationScope SynchScope) {
|
||||||
switch (SynchScope) {
|
switch (SynchScope) {
|
||||||
default: llvm_unreachable("Unknown synchronization scope");
|
|
||||||
case SingleThread: return bitc::SYNCHSCOPE_SINGLETHREAD;
|
case SingleThread: return bitc::SYNCHSCOPE_SINGLETHREAD;
|
||||||
case CrossThread: return bitc::SYNCHSCOPE_CROSSTHREAD;
|
case CrossThread: return bitc::SYNCHSCOPE_CROSSTHREAD;
|
||||||
}
|
}
|
||||||
@ -357,7 +355,6 @@ static void WriteTypeTable(const ValueEnumerator &VE, BitstreamWriter &Stream) {
|
|||||||
|
|
||||||
static unsigned getEncodedLinkage(const GlobalValue *GV) {
|
static unsigned getEncodedLinkage(const GlobalValue *GV) {
|
||||||
switch (GV->getLinkage()) {
|
switch (GV->getLinkage()) {
|
||||||
default: llvm_unreachable("Invalid linkage!");
|
|
||||||
case GlobalValue::ExternalLinkage: return 0;
|
case GlobalValue::ExternalLinkage: return 0;
|
||||||
case GlobalValue::WeakAnyLinkage: return 1;
|
case GlobalValue::WeakAnyLinkage: return 1;
|
||||||
case GlobalValue::AppendingLinkage: return 2;
|
case GlobalValue::AppendingLinkage: return 2;
|
||||||
@ -379,7 +376,6 @@ static unsigned getEncodedLinkage(const GlobalValue *GV) {
|
|||||||
|
|
||||||
static unsigned getEncodedVisibility(const GlobalValue *GV) {
|
static unsigned getEncodedVisibility(const GlobalValue *GV) {
|
||||||
switch (GV->getVisibility()) {
|
switch (GV->getVisibility()) {
|
||||||
default: llvm_unreachable("Invalid visibility!");
|
|
||||||
case GlobalValue::DefaultVisibility: return 0;
|
case GlobalValue::DefaultVisibility: return 0;
|
||||||
case GlobalValue::HiddenVisibility: return 1;
|
case GlobalValue::HiddenVisibility: return 1;
|
||||||
case GlobalValue::ProtectedVisibility: return 2;
|
case GlobalValue::ProtectedVisibility: return 2;
|
||||||
|
@ -143,7 +143,6 @@ void Printer::getAnalysisUsage(AnalysisUsage &AU) const {
|
|||||||
|
|
||||||
static const char *DescKind(GC::PointKind Kind) {
|
static const char *DescKind(GC::PointKind Kind) {
|
||||||
switch (Kind) {
|
switch (Kind) {
|
||||||
default: llvm_unreachable("Unknown GC point kind");
|
|
||||||
case GC::Loop: return "loop";
|
case GC::Loop: return "loop";
|
||||||
case GC::Return: return "return";
|
case GC::Return: return "return";
|
||||||
case GC::PreCall: return "pre-call";
|
case GC::PreCall: return "pre-call";
|
||||||
|
@ -92,7 +92,6 @@ AsmVerbose("asm-verbose", cl::desc("Add comments to directives."),
|
|||||||
|
|
||||||
static bool getVerboseAsm() {
|
static bool getVerboseAsm() {
|
||||||
switch (AsmVerbose) {
|
switch (AsmVerbose) {
|
||||||
default:
|
|
||||||
case cl::BOU_UNSET: return TargetMachine::getAsmVerbosityDefault();
|
case cl::BOU_UNSET: return TargetMachine::getAsmVerbosityDefault();
|
||||||
case cl::BOU_TRUE: return true;
|
case cl::BOU_TRUE: return true;
|
||||||
case cl::BOU_FALSE: return false;
|
case cl::BOU_FALSE: return false;
|
||||||
@ -141,7 +140,6 @@ bool LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
|
|||||||
OwningPtr<MCStreamer> AsmStreamer;
|
OwningPtr<MCStreamer> AsmStreamer;
|
||||||
|
|
||||||
switch (FileType) {
|
switch (FileType) {
|
||||||
default: return true;
|
|
||||||
case CGFT_AssemblyFile: {
|
case CGFT_AssemblyFile: {
|
||||||
MCInstPrinter *InstPrinter =
|
MCInstPrinter *InstPrinter =
|
||||||
getTarget().createMCInstPrinter(MAI.getAssemblerDialect(), MAI, STI);
|
getTarget().createMCInstPrinter(MAI.getAssemblerDialect(), MAI, STI);
|
||||||
|
@ -192,7 +192,6 @@ bool MachineOperand::isIdenticalTo(const MachineOperand &Other) const {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
switch (getType()) {
|
switch (getType()) {
|
||||||
default: llvm_unreachable("Unrecognized operand type");
|
|
||||||
case MachineOperand::MO_Register:
|
case MachineOperand::MO_Register:
|
||||||
return getReg() == Other.getReg() && isDef() == Other.isDef() &&
|
return getReg() == Other.getReg() && isDef() == Other.isDef() &&
|
||||||
getSubReg() == Other.getSubReg();
|
getSubReg() == Other.getSubReg();
|
||||||
@ -332,8 +331,6 @@ void MachineOperand::print(raw_ostream &OS, const TargetMachine *TM) const {
|
|||||||
case MachineOperand::MO_MCSymbol:
|
case MachineOperand::MO_MCSymbol:
|
||||||
OS << "<MCSym=" << *getMCSymbol() << '>';
|
OS << "<MCSym=" << *getMCSymbol() << '>';
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
llvm_unreachable("Unrecognized operand type");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unsigned TF = getTargetFlags())
|
if (unsigned TF = getTargetFlags())
|
||||||
|
@ -140,8 +140,6 @@ ScoreboardHazardRecognizer::getHazardType(SUnit *SU, int Stalls) {
|
|||||||
|
|
||||||
unsigned freeUnits = IS->getUnits();
|
unsigned freeUnits = IS->getUnits();
|
||||||
switch (IS->getReservationKind()) {
|
switch (IS->getReservationKind()) {
|
||||||
default:
|
|
||||||
assert(0 && "Invalid FU reservation");
|
|
||||||
case InstrStage::Required:
|
case InstrStage::Required:
|
||||||
// Required FUs conflict with both reserved and required ones
|
// Required FUs conflict with both reserved and required ones
|
||||||
freeUnits &= ~ReservedScoreboard[StageCycle];
|
freeUnits &= ~ReservedScoreboard[StageCycle];
|
||||||
@ -194,8 +192,6 @@ void ScoreboardHazardRecognizer::EmitInstruction(SUnit *SU) {
|
|||||||
|
|
||||||
unsigned freeUnits = IS->getUnits();
|
unsigned freeUnits = IS->getUnits();
|
||||||
switch (IS->getReservationKind()) {
|
switch (IS->getReservationKind()) {
|
||||||
default:
|
|
||||||
assert(0 && "Invalid FU reservation");
|
|
||||||
case InstrStage::Required:
|
case InstrStage::Required:
|
||||||
// Required FUs conflict with both reserved and required ones
|
// Required FUs conflict with both reserved and required ones
|
||||||
freeUnits &= ~ReservedScoreboard[cycle + i];
|
freeUnits &= ~ReservedScoreboard[cycle + i];
|
||||||
|
@ -212,9 +212,6 @@ SDValue DAGTypeLegalizer::PromoteIntRes_BITCAST(SDNode *N) {
|
|||||||
DebugLoc dl = N->getDebugLoc();
|
DebugLoc dl = N->getDebugLoc();
|
||||||
|
|
||||||
switch (getTypeAction(InVT)) {
|
switch (getTypeAction(InVT)) {
|
||||||
default:
|
|
||||||
assert(false && "Unknown type action!");
|
|
||||||
break;
|
|
||||||
case TargetLowering::TypeLegal:
|
case TargetLowering::TypeLegal:
|
||||||
break;
|
break;
|
||||||
case TargetLowering::TypePromoteInteger:
|
case TargetLowering::TypePromoteInteger:
|
||||||
|
@ -222,8 +222,6 @@ bool DAGTypeLegalizer::run() {
|
|||||||
for (unsigned i = 0, NumResults = N->getNumValues(); i < NumResults; ++i) {
|
for (unsigned i = 0, NumResults = N->getNumValues(); i < NumResults; ++i) {
|
||||||
EVT ResultVT = N->getValueType(i);
|
EVT ResultVT = N->getValueType(i);
|
||||||
switch (getTypeAction(ResultVT)) {
|
switch (getTypeAction(ResultVT)) {
|
||||||
default:
|
|
||||||
assert(false && "Unknown action!");
|
|
||||||
case TargetLowering::TypeLegal:
|
case TargetLowering::TypeLegal:
|
||||||
break;
|
break;
|
||||||
// The following calls must take care of *all* of the node's results,
|
// The following calls must take care of *all* of the node's results,
|
||||||
@ -275,8 +273,6 @@ ScanOperands:
|
|||||||
|
|
||||||
EVT OpVT = N->getOperand(i).getValueType();
|
EVT OpVT = N->getOperand(i).getValueType();
|
||||||
switch (getTypeAction(OpVT)) {
|
switch (getTypeAction(OpVT)) {
|
||||||
default:
|
|
||||||
assert(false && "Unknown action!");
|
|
||||||
case TargetLowering::TypeLegal:
|
case TargetLowering::TypeLegal:
|
||||||
continue;
|
continue;
|
||||||
// The following calls must either replace all of the node's results
|
// The following calls must either replace all of the node's results
|
||||||
|
@ -45,8 +45,6 @@ void DAGTypeLegalizer::ExpandRes_BITCAST(SDNode *N, SDValue &Lo, SDValue &Hi) {
|
|||||||
|
|
||||||
// Handle some special cases efficiently.
|
// Handle some special cases efficiently.
|
||||||
switch (getTypeAction(InVT)) {
|
switch (getTypeAction(InVT)) {
|
||||||
default:
|
|
||||||
assert(false && "Unknown type action!");
|
|
||||||
case TargetLowering::TypeLegal:
|
case TargetLowering::TypeLegal:
|
||||||
case TargetLowering::TypePromoteInteger:
|
case TargetLowering::TypePromoteInteger:
|
||||||
break;
|
break;
|
||||||
|
@ -1565,9 +1565,6 @@ SDValue DAGTypeLegalizer::WidenVecRes_BITCAST(SDNode *N) {
|
|||||||
DebugLoc dl = N->getDebugLoc();
|
DebugLoc dl = N->getDebugLoc();
|
||||||
|
|
||||||
switch (getTypeAction(InVT)) {
|
switch (getTypeAction(InVT)) {
|
||||||
default:
|
|
||||||
assert(false && "Unknown type action!");
|
|
||||||
break;
|
|
||||||
case TargetLowering::TypeLegal:
|
case TargetLowering::TypeLegal:
|
||||||
break;
|
break;
|
||||||
case TargetLowering::TypePromoteInteger:
|
case TargetLowering::TypePromoteInteger:
|
||||||
|
@ -3006,7 +3006,6 @@ TargetLowering::AsmOperandInfoVector TargetLowering::ParseConstraints(
|
|||||||
/// is.
|
/// is.
|
||||||
static unsigned getConstraintGenerality(TargetLowering::ConstraintType CT) {
|
static unsigned getConstraintGenerality(TargetLowering::ConstraintType CT) {
|
||||||
switch (CT) {
|
switch (CT) {
|
||||||
default: llvm_unreachable("Unknown constraint type!");
|
|
||||||
case TargetLowering::C_Other:
|
case TargetLowering::C_Other:
|
||||||
case TargetLowering::C_Unknown:
|
case TargetLowering::C_Unknown:
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -191,7 +191,6 @@ llvm::Spiller* llvm::createSpiller(MachineFunctionPass &pass,
|
|||||||
MachineFunction &mf,
|
MachineFunction &mf,
|
||||||
VirtRegMap &vrm) {
|
VirtRegMap &vrm) {
|
||||||
switch (spillerOpt) {
|
switch (spillerOpt) {
|
||||||
default: assert(0 && "unknown spiller");
|
|
||||||
case trivial: return new TrivialSpiller(pass, mf, vrm);
|
case trivial: return new TrivialSpiller(pass, mf, vrm);
|
||||||
case inline_: return createInlineSpiller(pass, mf, vrm);
|
case inline_: return createInlineSpiller(pass, mf, vrm);
|
||||||
}
|
}
|
||||||
|
@ -340,7 +340,6 @@ void MCAsmStreamer::EmitLabel(MCSymbol *Symbol) {
|
|||||||
|
|
||||||
void MCAsmStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag) {
|
void MCAsmStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag) {
|
||||||
switch (Flag) {
|
switch (Flag) {
|
||||||
default: assert(0 && "Invalid flag!");
|
|
||||||
case MCAF_SyntaxUnified: OS << "\t.syntax unified"; break;
|
case MCAF_SyntaxUnified: OS << "\t.syntax unified"; break;
|
||||||
case MCAF_SubsectionsViaSymbols: OS << ".subsections_via_symbols"; break;
|
case MCAF_SubsectionsViaSymbols: OS << ".subsections_via_symbols"; break;
|
||||||
case MCAF_Code16: OS << '\t'<< MAI.getCode16Directive(); break;
|
case MCAF_Code16: OS << '\t'<< MAI.getCode16Directive(); break;
|
||||||
|
@ -75,8 +75,6 @@ static const char *tripleFromArch(Triple::ArchType arch) {
|
|||||||
static int getLLVMSyntaxVariant(Triple::ArchType arch,
|
static int getLLVMSyntaxVariant(Triple::ArchType arch,
|
||||||
EDDisassembler::AssemblySyntax syntax) {
|
EDDisassembler::AssemblySyntax syntax) {
|
||||||
switch (syntax) {
|
switch (syntax) {
|
||||||
default:
|
|
||||||
return -1;
|
|
||||||
// Mappings below from X86AsmPrinter.cpp
|
// Mappings below from X86AsmPrinter.cpp
|
||||||
case EDDisassembler::kEDAssemblySyntaxX86ATT:
|
case EDDisassembler::kEDAssemblySyntaxX86ATT:
|
||||||
if (arch == Triple::x86 || arch == Triple::x86_64)
|
if (arch == Triple::x86 || arch == Triple::x86_64)
|
||||||
|
@ -70,7 +70,6 @@ void MCExpr::print(raw_ostream &OS) const {
|
|||||||
case MCExpr::Unary: {
|
case MCExpr::Unary: {
|
||||||
const MCUnaryExpr &UE = cast<MCUnaryExpr>(*this);
|
const MCUnaryExpr &UE = cast<MCUnaryExpr>(*this);
|
||||||
switch (UE.getOpcode()) {
|
switch (UE.getOpcode()) {
|
||||||
default: assert(0 && "Invalid opcode!");
|
|
||||||
case MCUnaryExpr::LNot: OS << '!'; break;
|
case MCUnaryExpr::LNot: OS << '!'; break;
|
||||||
case MCUnaryExpr::Minus: OS << '-'; break;
|
case MCUnaryExpr::Minus: OS << '-'; break;
|
||||||
case MCUnaryExpr::Not: OS << '~'; break;
|
case MCUnaryExpr::Not: OS << '~'; break;
|
||||||
@ -91,7 +90,6 @@ void MCExpr::print(raw_ostream &OS) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (BE.getOpcode()) {
|
switch (BE.getOpcode()) {
|
||||||
default: assert(0 && "Invalid opcode!");
|
|
||||||
case MCBinaryExpr::Add:
|
case MCBinaryExpr::Add:
|
||||||
// Print "X-42" instead of "X+-42".
|
// Print "X-42" instead of "X+-42".
|
||||||
if (const MCConstantExpr *RHSC = dyn_cast<MCConstantExpr>(BE.getRHS())) {
|
if (const MCConstantExpr *RHSC = dyn_cast<MCConstantExpr>(BE.getRHS())) {
|
||||||
@ -171,7 +169,6 @@ const MCSymbolRefExpr *MCSymbolRefExpr::Create(StringRef Name, VariantKind Kind,
|
|||||||
|
|
||||||
StringRef MCSymbolRefExpr::getVariantKindName(VariantKind Kind) {
|
StringRef MCSymbolRefExpr::getVariantKindName(VariantKind Kind) {
|
||||||
switch (Kind) {
|
switch (Kind) {
|
||||||
default:
|
|
||||||
case VK_Invalid: return "<<invalid>>";
|
case VK_Invalid: return "<<invalid>>";
|
||||||
case VK_None: return "<<none>>";
|
case VK_None: return "<<none>>";
|
||||||
|
|
||||||
|
@ -150,8 +150,6 @@ void MCMachOStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag) {
|
|||||||
case MCAF_SubsectionsViaSymbols:
|
case MCAF_SubsectionsViaSymbols:
|
||||||
getAssembler().setSubsectionsViaSymbols(true);
|
getAssembler().setSubsectionsViaSymbols(true);
|
||||||
return;
|
return;
|
||||||
default:
|
|
||||||
llvm_unreachable("invalid assembler flag!");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1150,9 +1150,6 @@ APFloat::roundAwayFromZero(roundingMode rounding_mode,
|
|||||||
assert(lost_fraction != lfExactlyZero);
|
assert(lost_fraction != lfExactlyZero);
|
||||||
|
|
||||||
switch (rounding_mode) {
|
switch (rounding_mode) {
|
||||||
default:
|
|
||||||
llvm_unreachable(0);
|
|
||||||
|
|
||||||
case rmNearestTiesToAway:
|
case rmNearestTiesToAway:
|
||||||
return lost_fraction == lfExactlyHalf || lost_fraction == lfMoreThanHalf;
|
return lost_fraction == lfExactlyHalf || lost_fraction == lfMoreThanHalf;
|
||||||
|
|
||||||
|
@ -817,7 +817,6 @@ static MCSymbol *getPICLabel(const char *Prefix, unsigned FunctionNumber,
|
|||||||
static MCSymbolRefExpr::VariantKind
|
static MCSymbolRefExpr::VariantKind
|
||||||
getModifierVariantKind(ARMCP::ARMCPModifier Modifier) {
|
getModifierVariantKind(ARMCP::ARMCPModifier Modifier) {
|
||||||
switch (Modifier) {
|
switch (Modifier) {
|
||||||
default: llvm_unreachable("Unknown modifier!");
|
|
||||||
case ARMCP::no_modifier: return MCSymbolRefExpr::VK_None;
|
case ARMCP::no_modifier: return MCSymbolRefExpr::VK_None;
|
||||||
case ARMCP::TLSGD: return MCSymbolRefExpr::VK_ARM_TLSGD;
|
case ARMCP::TLSGD: return MCSymbolRefExpr::VK_ARM_TLSGD;
|
||||||
case ARMCP::TPOFF: return MCSymbolRefExpr::VK_ARM_TPOFF;
|
case ARMCP::TPOFF: return MCSymbolRefExpr::VK_ARM_TPOFF;
|
||||||
|
@ -67,7 +67,6 @@ namespace ARMCC {
|
|||||||
|
|
||||||
inline static const char *ARMCondCodeToString(ARMCC::CondCodes CC) {
|
inline static const char *ARMCondCodeToString(ARMCC::CondCodes CC) {
|
||||||
switch (CC) {
|
switch (CC) {
|
||||||
default: llvm_unreachable("Unknown condition code");
|
|
||||||
case ARMCC::EQ: return "eq";
|
case ARMCC::EQ: return "eq";
|
||||||
case ARMCC::NE: return "ne";
|
case ARMCC::NE: return "ne";
|
||||||
case ARMCC::HS: return "hs";
|
case ARMCC::HS: return "hs";
|
||||||
@ -237,7 +236,6 @@ namespace ARMII {
|
|||||||
|
|
||||||
inline static const char *AddrModeToString(AddrMode addrmode) {
|
inline static const char *AddrModeToString(AddrMode addrmode) {
|
||||||
switch (addrmode) {
|
switch (addrmode) {
|
||||||
default: llvm_unreachable("Unknown memory operation");
|
|
||||||
case AddrModeNone: return "AddrModeNone";
|
case AddrModeNone: return "AddrModeNone";
|
||||||
case AddrMode1: return "AddrMode1";
|
case AddrMode1: return "AddrMode1";
|
||||||
case AddrMode2: return "AddrMode2";
|
case AddrMode2: return "AddrMode2";
|
||||||
|
@ -177,7 +177,6 @@ public:
|
|||||||
///
|
///
|
||||||
unsigned getShiftOp(ARM_AM::ShiftOpc ShOpc) const {
|
unsigned getShiftOp(ARM_AM::ShiftOpc ShOpc) const {
|
||||||
switch (ShOpc) {
|
switch (ShOpc) {
|
||||||
default: llvm_unreachable("Unknown shift opc!");
|
|
||||||
case ARM_AM::no_shift:
|
case ARM_AM::no_shift:
|
||||||
case ARM_AM::lsl: return 0;
|
case ARM_AM::lsl: return 0;
|
||||||
case ARM_AM::lsr: return 1;
|
case ARM_AM::lsr: return 1;
|
||||||
|
@ -301,7 +301,6 @@ void CppWriter::printLinkageType(GlobalValue::LinkageTypes LT) {
|
|||||||
|
|
||||||
void CppWriter::printVisibilityType(GlobalValue::VisibilityTypes VisType) {
|
void CppWriter::printVisibilityType(GlobalValue::VisibilityTypes VisType) {
|
||||||
switch (VisType) {
|
switch (VisType) {
|
||||||
default: llvm_unreachable("Unknown GVar visibility");
|
|
||||||
case GlobalValue::DefaultVisibility:
|
case GlobalValue::DefaultVisibility:
|
||||||
Out << "GlobalValue::DefaultVisibility";
|
Out << "GlobalValue::DefaultVisibility";
|
||||||
break;
|
break;
|
||||||
@ -2049,8 +2048,6 @@ bool CppWriter::runOnModule(Module &M) {
|
|||||||
fname = "makeLLVMType";
|
fname = "makeLLVMType";
|
||||||
printType(fname,tgtname);
|
printType(fname,tgtname);
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
error("Invalid generation option");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -59,7 +59,6 @@ std::string PTXSubtarget::getTargetString() const {
|
|||||||
|
|
||||||
std::string PTXSubtarget::getPTXVersionString() const {
|
std::string PTXSubtarget::getPTXVersionString() const {
|
||||||
switch(PTXVersion) {
|
switch(PTXVersion) {
|
||||||
default: llvm_unreachable("Unknown PTX version");
|
|
||||||
case PTX_VERSION_2_0: return "2.0";
|
case PTX_VERSION_2_0: return "2.0";
|
||||||
case PTX_VERSION_2_1: return "2.1";
|
case PTX_VERSION_2_1: return "2.1";
|
||||||
case PTX_VERSION_2_2: return "2.2";
|
case PTX_VERSION_2_2: return "2.2";
|
||||||
|
@ -136,7 +136,6 @@ bool PTXTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
|
|||||||
OwningPtr<MCStreamer> AsmStreamer;
|
OwningPtr<MCStreamer> AsmStreamer;
|
||||||
|
|
||||||
switch (FileType) {
|
switch (FileType) {
|
||||||
default: return true;
|
|
||||||
case CGFT_AssemblyFile: {
|
case CGFT_AssemblyFile: {
|
||||||
MCInstPrinter *InstPrinter =
|
MCInstPrinter *InstPrinter =
|
||||||
getTarget().createMCInstPrinter(MAI.getAssemblerDialect(), MAI, STI);
|
getTarget().createMCInstPrinter(MAI.getAssemblerDialect(), MAI, STI);
|
||||||
|
@ -94,7 +94,6 @@ void PPCInstPrinter::printPredicateOperand(const MCInst *MI, unsigned OpNo,
|
|||||||
unsigned Code = MI->getOperand(OpNo).getImm();
|
unsigned Code = MI->getOperand(OpNo).getImm();
|
||||||
if (StringRef(Modifier) == "cc") {
|
if (StringRef(Modifier) == "cc") {
|
||||||
switch ((PPC::Predicate)Code) {
|
switch ((PPC::Predicate)Code) {
|
||||||
default: assert(0 && "Invalid predicate");
|
|
||||||
case PPC::PRED_ALWAYS: return; // Don't print anything for always.
|
case PPC::PRED_ALWAYS: return; // Don't print anything for always.
|
||||||
case PPC::PRED_LT: O << "lt"; return;
|
case PPC::PRED_LT: O << "lt"; return;
|
||||||
case PPC::PRED_LE: O << "le"; return;
|
case PPC::PRED_LE: O << "le"; return;
|
||||||
|
@ -74,7 +74,6 @@ namespace llvm {
|
|||||||
|
|
||||||
inline static const char *SPARCCondCodeToString(SPCC::CondCodes CC) {
|
inline static const char *SPARCCondCodeToString(SPCC::CondCodes CC) {
|
||||||
switch (CC) {
|
switch (CC) {
|
||||||
default: llvm_unreachable("Unknown condition code");
|
|
||||||
case SPCC::ICC_NE: return "ne";
|
case SPCC::ICC_NE: return "ne";
|
||||||
case SPCC::ICC_E: return "e";
|
case SPCC::ICC_E: return "e";
|
||||||
case SPCC::ICC_G: return "g";
|
case SPCC::ICC_G: return "g";
|
||||||
|
@ -79,7 +79,6 @@ static bool IsIntegerCC(unsigned CC)
|
|||||||
static SPCC::CondCodes GetOppositeBranchCondition(SPCC::CondCodes CC)
|
static SPCC::CondCodes GetOppositeBranchCondition(SPCC::CondCodes CC)
|
||||||
{
|
{
|
||||||
switch(CC) {
|
switch(CC) {
|
||||||
default: llvm_unreachable("Unknown condition code");
|
|
||||||
case SPCC::ICC_NE: return SPCC::ICC_E;
|
case SPCC::ICC_NE: return SPCC::ICC_E;
|
||||||
case SPCC::ICC_E: return SPCC::ICC_NE;
|
case SPCC::ICC_E: return SPCC::ICC_NE;
|
||||||
case SPCC::ICC_G: return SPCC::ICC_LE;
|
case SPCC::ICC_G: return SPCC::ICC_LE;
|
||||||
|
@ -160,7 +160,6 @@ SectionKind TargetLoweringObjectFile::getKindForGlobal(const GlobalValue *GV,
|
|||||||
// relocation, then we may have to drop this into a wriable data section
|
// relocation, then we may have to drop this into a wriable data section
|
||||||
// even though it is marked const.
|
// even though it is marked const.
|
||||||
switch (C->getRelocationInfo()) {
|
switch (C->getRelocationInfo()) {
|
||||||
default: assert(0 && "unknown relocation info kind");
|
|
||||||
case Constant::NoRelocation:
|
case Constant::NoRelocation:
|
||||||
// If the global is required to have a unique address, it can't be put
|
// If the global is required to have a unique address, it can't be put
|
||||||
// into a mergable section: just drop it into the general read-only
|
// into a mergable section: just drop it into the general read-only
|
||||||
@ -234,7 +233,6 @@ SectionKind TargetLoweringObjectFile::getKindForGlobal(const GlobalValue *GV,
|
|||||||
return SectionKind::getDataNoRel();
|
return SectionKind::getDataNoRel();
|
||||||
|
|
||||||
switch (C->getRelocationInfo()) {
|
switch (C->getRelocationInfo()) {
|
||||||
default: assert(0 && "unknown relocation info kind");
|
|
||||||
case Constant::NoRelocation:
|
case Constant::NoRelocation:
|
||||||
return SectionKind::getDataNoRel();
|
return SectionKind::getDataNoRel();
|
||||||
case Constant::LocalRelocation:
|
case Constant::LocalRelocation:
|
||||||
|
@ -106,9 +106,6 @@ static InstrUID decode(OpcodeType type,
|
|||||||
const struct ModRMDecision* dec;
|
const struct ModRMDecision* dec;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
default:
|
|
||||||
debug("Unknown opcode type");
|
|
||||||
return 0;
|
|
||||||
case ONEBYTE:
|
case ONEBYTE:
|
||||||
dec = &ONEBYTE_SYM.opcodeDecisions[insnContext].modRMDecisions[opcode];
|
dec = &ONEBYTE_SYM.opcodeDecisions[insnContext].modRMDecisions[opcode];
|
||||||
break;
|
break;
|
||||||
|
@ -89,7 +89,6 @@ enum PrefixType {
|
|||||||
static void PrintLLVMName(raw_ostream &OS, StringRef Name, PrefixType Prefix) {
|
static void PrintLLVMName(raw_ostream &OS, StringRef Name, PrefixType Prefix) {
|
||||||
assert(!Name.empty() && "Cannot get empty name!");
|
assert(!Name.empty() && "Cannot get empty name!");
|
||||||
switch (Prefix) {
|
switch (Prefix) {
|
||||||
default: llvm_unreachable("Bad prefix!");
|
|
||||||
case NoPrefix: break;
|
case NoPrefix: break;
|
||||||
case GlobalPrefix: OS << '@'; break;
|
case GlobalPrefix: OS << '@'; break;
|
||||||
case LabelPrefix: break;
|
case LabelPrefix: break;
|
||||||
@ -1167,7 +1166,6 @@ void AssemblyWriter::writeAtomic(AtomicOrdering Ordering,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
switch (SynchScope) {
|
switch (SynchScope) {
|
||||||
default: Out << " <bad scope " << int(SynchScope) << ">"; break;
|
|
||||||
case SingleThread: Out << " singlethread"; break;
|
case SingleThread: Out << " singlethread"; break;
|
||||||
case CrossThread: break;
|
case CrossThread: break;
|
||||||
}
|
}
|
||||||
|
@ -1059,8 +1059,6 @@ LLVMBool LLVMIsDeclaration(LLVMValueRef Global) {
|
|||||||
|
|
||||||
LLVMLinkage LLVMGetLinkage(LLVMValueRef Global) {
|
LLVMLinkage LLVMGetLinkage(LLVMValueRef Global) {
|
||||||
switch (unwrap<GlobalValue>(Global)->getLinkage()) {
|
switch (unwrap<GlobalValue>(Global)->getLinkage()) {
|
||||||
default:
|
|
||||||
assert(false && "Unhandled Linkage Type.");
|
|
||||||
case GlobalValue::ExternalLinkage:
|
case GlobalValue::ExternalLinkage:
|
||||||
return LLVMExternalLinkage;
|
return LLVMExternalLinkage;
|
||||||
case GlobalValue::AvailableExternallyLinkage:
|
case GlobalValue::AvailableExternallyLinkage:
|
||||||
@ -1103,8 +1101,6 @@ void LLVMSetLinkage(LLVMValueRef Global, LLVMLinkage Linkage) {
|
|||||||
GlobalValue *GV = unwrap<GlobalValue>(Global);
|
GlobalValue *GV = unwrap<GlobalValue>(Global);
|
||||||
|
|
||||||
switch (Linkage) {
|
switch (Linkage) {
|
||||||
default:
|
|
||||||
assert(false && "Unhandled Linkage Type.");
|
|
||||||
case LLVMExternalLinkage:
|
case LLVMExternalLinkage:
|
||||||
GV->setLinkage(GlobalValue::ExternalLinkage);
|
GV->setLinkage(GlobalValue::ExternalLinkage);
|
||||||
break;
|
break;
|
||||||
|
@ -225,7 +225,6 @@ namespace {
|
|||||||
if (!Broken) return false;
|
if (!Broken) return false;
|
||||||
MessagesStr << "Broken module found, ";
|
MessagesStr << "Broken module found, ";
|
||||||
switch (action) {
|
switch (action) {
|
||||||
default: llvm_unreachable("Unknown action");
|
|
||||||
case AbortProcessAction:
|
case AbortProcessAction:
|
||||||
MessagesStr << "compilation aborted!\n";
|
MessagesStr << "compilation aborted!\n";
|
||||||
dbgs() << MessagesStr.str();
|
dbgs() << MessagesStr.str();
|
||||||
|
@ -209,9 +209,6 @@ bool BugDriver::initializeExecutionEnvironment() {
|
|||||||
Interpreter =
|
Interpreter =
|
||||||
AbstractInterpreter::createCustomExecutor(Message, CustomExecCommand);
|
AbstractInterpreter::createCustomExecutor(Message, CustomExecCommand);
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
Message = "Sorry, this back-end is not supported by bugpoint right now!\n";
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
if (!Interpreter)
|
if (!Interpreter)
|
||||||
errs() << Message;
|
errs() << Message;
|
||||||
|
@ -296,7 +296,6 @@ static tool_output_file *GetOutputStream(const char *TargetName,
|
|||||||
OutputFilename = GetFileNameRoot(InputFilename);
|
OutputFilename = GetFileNameRoot(InputFilename);
|
||||||
|
|
||||||
switch (FileType) {
|
switch (FileType) {
|
||||||
default: assert(0 && "Unknown file type");
|
|
||||||
case TargetMachine::CGFT_AssemblyFile:
|
case TargetMachine::CGFT_AssemblyFile:
|
||||||
if (TargetName[0] == 'c') {
|
if (TargetName[0] == 'c') {
|
||||||
if (TargetName[1] == 0)
|
if (TargetName[1] == 0)
|
||||||
@ -324,7 +323,6 @@ static tool_output_file *GetOutputStream(const char *TargetName,
|
|||||||
// Decide if we need "binary" output.
|
// Decide if we need "binary" output.
|
||||||
bool Binary = false;
|
bool Binary = false;
|
||||||
switch (FileType) {
|
switch (FileType) {
|
||||||
default: assert(0 && "Unknown file type");
|
|
||||||
case TargetMachine::CGFT_AssemblyFile:
|
case TargetMachine::CGFT_AssemblyFile:
|
||||||
break;
|
break;
|
||||||
case TargetMachine::CGFT_ObjectFile:
|
case TargetMachine::CGFT_ObjectFile:
|
||||||
|
@ -534,7 +534,6 @@ static int AnalyzeBitcode() {
|
|||||||
errs() << "\n";
|
errs() << "\n";
|
||||||
errs() << " Stream type: ";
|
errs() << " Stream type: ";
|
||||||
switch (CurStreamType) {
|
switch (CurStreamType) {
|
||||||
default: assert(0 && "Unknown bitstream type");
|
|
||||||
case UnknownBitstream: errs() << "unknown\n"; break;
|
case UnknownBitstream: errs() << "unknown\n"; break;
|
||||||
case LLVMIRBitstream: errs() << "LLVM IR\n"; break;
|
case LLVMIRBitstream: errs() << "LLVM IR\n"; break;
|
||||||
}
|
}
|
||||||
|
@ -295,7 +295,6 @@ int Disassembler::disassembleEnhanced(const std::string &TS,
|
|||||||
Out << operandIndex << "-";
|
Out << operandIndex << "-";
|
||||||
|
|
||||||
switch (token->type()) {
|
switch (token->type()) {
|
||||||
default: Out << "?"; break;
|
|
||||||
case EDToken::kTokenWhitespace: Out << "w"; break;
|
case EDToken::kTokenWhitespace: Out << "w"; break;
|
||||||
case EDToken::kTokenPunctuation: Out << "p"; break;
|
case EDToken::kTokenPunctuation: Out << "p"; break;
|
||||||
case EDToken::kTokenOpcode: Out << "o"; break;
|
case EDToken::kTokenOpcode: Out << "o"; break;
|
||||||
|
@ -517,7 +517,6 @@ int main(int argc, char **argv) {
|
|||||||
setDwarfDebugFlags(argc, argv);
|
setDwarfDebugFlags(argc, argv);
|
||||||
|
|
||||||
switch (Action) {
|
switch (Action) {
|
||||||
default:
|
|
||||||
case AC_AsLex:
|
case AC_AsLex:
|
||||||
return AsLexInput(argv[0]);
|
return AsLexInput(argv[0]);
|
||||||
case AC_Assemble:
|
case AC_Assemble:
|
||||||
|
@ -142,7 +142,6 @@ int main(int argc, char **argv) {
|
|||||||
cl::ParseCommandLineOptions(argc, argv, "llvm MC-JIT tool\n");
|
cl::ParseCommandLineOptions(argc, argv, "llvm MC-JIT tool\n");
|
||||||
|
|
||||||
switch (Action) {
|
switch (Action) {
|
||||||
default:
|
|
||||||
case AC_Execute:
|
case AC_Execute:
|
||||||
return executeInput();
|
return executeInput();
|
||||||
}
|
}
|
||||||
|
@ -1482,7 +1482,6 @@ void MatchableInfo::BuildAliasResultOperands() {
|
|||||||
// Find out what operand from the asmparser that this MCInst operand
|
// Find out what operand from the asmparser that this MCInst operand
|
||||||
// comes from.
|
// comes from.
|
||||||
switch (CGA.ResultOperands[AliasOpNo].Kind) {
|
switch (CGA.ResultOperands[AliasOpNo].Kind) {
|
||||||
default: assert(0 && "unexpected InstAlias operand kind");
|
|
||||||
case CodeGenInstAlias::ResultOperand::K_Record: {
|
case CodeGenInstAlias::ResultOperand::K_Record: {
|
||||||
StringRef Name = CGA.ResultOperands[AliasOpNo].getName();
|
StringRef Name = CGA.ResultOperands[AliasOpNo].getName();
|
||||||
int SrcOperand = FindAsmOperand(Name, SubIdx);
|
int SrcOperand = FindAsmOperand(Name, SubIdx);
|
||||||
|
@ -858,7 +858,6 @@ void AsmWriterEmitter::EmitPrintAliasInstruction(raw_ostream &O) {
|
|||||||
const CodeGenInstAlias::ResultOperand &RO = CGA->ResultOperands[i];
|
const CodeGenInstAlias::ResultOperand &RO = CGA->ResultOperands[i];
|
||||||
|
|
||||||
switch (RO.Kind) {
|
switch (RO.Kind) {
|
||||||
default: assert(0 && "unexpected InstAlias operand kind");
|
|
||||||
case CodeGenInstAlias::ResultOperand::K_Record: {
|
case CodeGenInstAlias::ResultOperand::K_Record: {
|
||||||
const Record *Rec = RO.getRecord();
|
const Record *Rec = RO.getRecord();
|
||||||
StringRef ROName = RO.getName();
|
StringRef ROName = RO.getName();
|
||||||
|
@ -839,7 +839,6 @@ bool SDTypeConstraint::ApplyTypeConstraint(TreePatternNode *N,
|
|||||||
TreePatternNode *NodeToApply = getOperandNum(OperandNo, N, NodeInfo, ResNo);
|
TreePatternNode *NodeToApply = getOperandNum(OperandNo, N, NodeInfo, ResNo);
|
||||||
|
|
||||||
switch (ConstraintType) {
|
switch (ConstraintType) {
|
||||||
default: assert(0 && "Unknown constraint type!");
|
|
||||||
case SDTCisVT:
|
case SDTCisVT:
|
||||||
// Operand must be a particular type.
|
// Operand must be a particular type.
|
||||||
return NodeToApply->UpdateNodeType(ResNo, x.SDTCisVT_Info.VT, TP);
|
return NodeToApply->UpdateNodeType(ResNo, x.SDTCisVT_Info.VT, TP);
|
||||||
|
@ -176,8 +176,6 @@ void PseudoLoweringEmitter::emitLoweringEmitter(raw_ostream &o) {
|
|||||||
for (unsigned i = 0, e = Dest.Operands[OpNo].MINumOperands;
|
for (unsigned i = 0, e = Dest.Operands[OpNo].MINumOperands;
|
||||||
i != e; ++i) {
|
i != e; ++i) {
|
||||||
switch (Expansion.OperandMap[MIOpNo + i].Kind) {
|
switch (Expansion.OperandMap[MIOpNo + i].Kind) {
|
||||||
default:
|
|
||||||
llvm_unreachable("Unknown operand type?!");
|
|
||||||
case OpData::Operand:
|
case OpData::Operand:
|
||||||
o << " lowerOperand(MI->getOperand("
|
o << " lowerOperand(MI->getOperand("
|
||||||
<< Source.Operands[Expansion.OperandMap[MIOpNo].Data
|
<< Source.Operands[Expansion.OperandMap[MIOpNo].Data
|
||||||
|
Loading…
x
Reference in New Issue
Block a user