llvm.org GIT mirror llvm / c25e758
assert(0) -> LLVM_UNREACHABLE. Make llvm_unreachable take an optional string, thus moving the cerr<< out of line. LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for NDEBUG builds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75379 91177308-0d34-0410-b5e6-96231b3b80d8 Torok Edwin 10 years ago
153 changed file(s) with 695 addition(s) and 610 deletion(s). Raw diff Collapse all Expand all
1414 #define LLVM_ANALYSIS_SCALAREVOLUTION_EXPRESSIONS_H
1515
1616 #include "llvm/Analysis/ScalarEvolution.h"
17 #include "llvm/Support/ErrorHandling.h"
1718
1819 namespace llvm {
1920 class ConstantInt;
583584 case scCouldNotCompute:
584585 return ((SC*)this)->visitCouldNotCompute((const SCEVCouldNotCompute*)S);
585586 default:
586 assert(0 && "Unknown SCEV type!");
587 abort();
587 LLVM_UNREACHABLE("Unknown SCEV type!");
588588 }
589589 }
590590
591591 RetVal visitCouldNotCompute(const SCEVCouldNotCompute *S) {
592 assert(0 && "Invalid use of SCEVCouldNotCompute!");
593 abort();
592 LLVM_UNREACHABLE("Invalid use of SCEVCouldNotCompute!");
594593 return RetVal();
595594 }
596595 };
2424 #include "llvm/Type.h"
2525 #include "llvm/ADT/FoldingSet.h"
2626 #include "llvm/ADT/SmallVector.h"
27 #include "llvm/Support/ErrorHandling.h"
2728 #include "llvm/Support/ValueHandle.h"
2829
2930 namespace llvm {
118119
119120 virtual void destroyConstant();
120121 virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U) {
121 assert(0 && "This should never be called because MDNodes have no ops");
122 abort();
122 LLVM_UNREACHABLE("This should never be called because MDNodes have no ops");
123123 }
124124
125125 /// Methods for support type inquiry through isa, cast, and dyn_cast:
4545 /// This function calls abort().
4646 /// Call this after assert(0), so that compiler knows the path is not
4747 /// reachable.
48 void llvm_unreachable(void) NORETURN;
48 void llvm_unreachable(const char *msg=0) NORETURN;
4949 }
5050
5151 #ifndef NDEBUG
52 #define LLVM_UNREACHABLE(msg) do {cerr<)
52 #define LLVM_UNREACHABLE(msg) llvm_unreachable(msg)
5353 #else
5454 #define LLVM_UNREACHABLE(msg) llvm_unreachable()
5555 #endif
1313 #include "llvm/Function.h"
1414 #include "llvm/Instructions.h"
1515 #include "llvm/Module.h"
16 #include "llvm/Support/ErrorHandling.h"
1617
1718 namespace llvm {
1819
112113 //
113114 RetTy visit(Instruction &I) {
114115 switch (I.getOpcode()) {
115 default: assert(0 && "Unknown instruction type encountered!");
116 abort();
116 default: LLVM_UNREACHABLE("Unknown instruction type encountered!");
117117 // Build the switch statement using the Instruction.def file...
118118 #define HANDLE_INST(NUM, OPCODE, CLASS) \
119119 case Instruction::OPCODE: return \
2323 #define LLVM_SUPPORT_PASS_NAME_PARSER_H
2424
2525 #include "llvm/Support/CommandLine.h"
26 #include "llvm/Support/ErrorHandling.h"
2627 #include "llvm/Pass.h"
2728 #include
2829 #include
6667 if (findOption(P->getPassArgument()) != getNumOptions()) {
6768 cerr << "Two passes with the same argument (-"
6869 << P->getPassArgument() << ") attempted to be registered!\n";
69 abort();
70 llvm_unreachable();
7071 }
7172 addLiteralOption(P->getPassArgument(), P, P->getPassName());
7273 }
2121
2222 #include "llvm/Pass.h"
2323 #include "llvm/Support/DataTypes.h"
24 #include "llvm/Support/ErrorHandling.h"
2425 #include "llvm/ADT/SmallVector.h"
2526 #include
2627
110111 /// @note This has to exist, because this is a pass, but it should never be
111112 /// used.
112113 TargetData() : ImmutablePass(&ID) {
113 assert(0 && "ERROR: Bad TargetData ctor used. "
114 "Tool did not specify a TargetData to use?");
115 abort();
114 llvm_report_error("ERROR: Bad TargetData ctor used. "
115 "Tool did not specify a TargetData to use?");
116116 }
117117
118118 /// Constructs a TargetData from a specification string. See init().
1313 #ifndef LLVM_TARGET_TARGETINSTRINFO_H
1414 #define LLVM_TARGET_TARGETINSTRINFO_H
1515
16 #include "llvm/Support/ErrorHandling.h"
1617 #include "llvm/Target/TargetInstrDesc.h"
1718 #include "llvm/CodeGen/MachineFunction.h"
1819
427428 /// point.
428429 virtual void insertNoop(MachineBasicBlock &MBB,
429430 MachineBasicBlock::iterator MI) const {
430 assert(0 && "Target didn't implement insertNoop!");
431 abort();
431 LLVM_UNREACHABLE("Target didn't implement insertNoop!");
432432 }
433433
434434 /// isPredicated - Returns true if the instruction is already predicated.
1717 #include "llvm/Assembly/Writer.h"
1818 #include "llvm/Support/CommandLine.h"
1919 #include "llvm/Support/Compiler.h"
20 #include "llvm/Support/ErrorHandling.h"
2021 #include "llvm/Support/Streams.h"
2122 using namespace llvm;
2223
130131
131132 const char *AliasString;
132133 switch (R) {
133 default: assert(0 && "Unknown alias type!");
134 default: LLVM_UNREACHABLE("Unknown alias type!");
134135 case NoAlias: No++; AliasString = "No alias"; break;
135136 case MayAlias: May++; AliasString = "May alias"; break;
136137 case MustAlias: Must++; AliasString = "Must alias"; break;
155156
156157 const char *MRString;
157158 switch (R) {
158 default: assert(0 && "Unknown mod/ref type!");
159 default: LLVM_UNREACHABLE("Unknown mod/ref type!");
159160 case NoModRef: NoMR++; MRString = "NoModRef"; break;
160161 case Ref: JustRef++; MRString = "JustRef"; break;
161162 case Mod: JustMod++; MRString = "JustMod"; break;
1919 #include "llvm/Target/TargetData.h"
2020 #include "llvm/Assembly/Writer.h"
2121 #include "llvm/Support/Compiler.h"
22 #include "llvm/Support/ErrorHandling.h"
2223 #include "llvm/Support/InstIterator.h"
2324 #include "llvm/Support/Streams.h"
2425 using namespace llvm;
538539 case Refs : OS << "Ref "; break;
539540 case Mods : OS << "Mod "; break;
540541 case ModRef : OS << "Mod/Ref "; break;
541 default: assert(0 && "Bad value for AccessTy!");
542 default: LLVM_UNREACHABLE("Bad value for AccessTy!");
542543 }
543544 if (isVolatile()) OS << "[volatile] ";
544545 if (Forward)
2727 #include "llvm/ADT/SmallVector.h"
2828 #include "llvm/ADT/STLExtras.h"
2929 #include "llvm/Support/Compiler.h"
30 #include "llvm/Support/ErrorHandling.h"
3031 #include "llvm/Support/GetElementPtrTypeIterator.h"
3132 #include
3233 using namespace llvm;
156157
157158 virtual void getArgumentAccesses(Function *F, CallSite CS,
158159 std::vector &Info) {
159 assert(0 && "This method may not be called on this function!");
160 LLVM_UNREACHABLE("This method may not be called on this function!");
160161 }
161162
162163 virtual void getMustAliases(Value *P, std::vector &RetVals) { }
2222 #include "llvm/ADT/SmallVector.h"
2323 #include "llvm/ADT/StringMap.h"
2424 #include "llvm/Target/TargetData.h"
25 #include "llvm/Support/ErrorHandling.h"
2526 #include "llvm/Support/GetElementPtrTypeIterator.h"
2627 #include "llvm/Support/MathExtras.h"
2728 #include
364365 return 0;
365366 case Instruction::ICmp:
366367 case Instruction::FCmp:
367 assert(0 &&"This function is invalid for compares: no predicate specified");
368 LLVM_UNREACHABLE("This function is invalid for compares: no predicate specified");
368369 case Instruction::PtrToInt:
369370 // If the input is a inttoptr, eliminate the pair. This requires knowing
370371 // the width of a pointer, so it can't be done in ConstantExpr::getCast.
689690 return Context->getConstantFP(APFloat((float)V));
690691 if (Ty == Type::DoubleTy)
691692 return Context->getConstantFP(APFloat(V));
692 assert(0 && "Can only constant fold float/double");
693 LLVM_UNREACHABLE("Can only constant fold float/double");
693694 return 0; // dummy return to suppress warning
694695 }
695696
708709 return Context->getConstantFP(APFloat((float)V));
709710 if (Ty == Type::DoubleTy)
710711 return Context->getConstantFP(APFloat(V));
711 assert(0 && "Can only constant fold float/double");
712 LLVM_UNREACHABLE("Can only constant fold float/double");
712713 return 0; // dummy return to suppress warning
713714 }
714715
507507 #ifndef NDEBUG
508508 V->dump();
509509 #endif
510 assert(0 && "Value does not have a node in the points-to graph!");
510 LLVM_UNREACHABLE("Value does not have a node in the points-to graph!");
511511 }
512512 return I->second;
513513 }
826826 return getNodeForConstantPointer(CE->getOperand(0));
827827 default:
828828 cerr << "Constant Expr not yet handled: " << *CE << "\n";
829 assert(0);
829 llvm_unreachable();
830830 }
831831 } else {
832 assert(0 && "Unknown constant pointer!");
832 LLVM_UNREACHABLE("Unknown constant pointer!");
833833 }
834834 return 0;
835835 }
853853 return getNodeForConstantPointerTarget(CE->getOperand(0));
854854 default:
855855 cerr << "Constant Expr not yet handled: " << *CE << "\n";
856 assert(0);
856 llvm_unreachable();
857857 }
858858 } else {
859 assert(0 && "Unknown constant pointer!");
859 LLVM_UNREACHABLE("Unknown constant pointer!");
860860 }
861861 return 0;
862862 }
12431243 }
12441244
12451245 void Andersens::visitVAArg(VAArgInst &I) {
1246 assert(0 && "vaarg not handled yet!");
1246 LLVM_UNREACHABLE("vaarg not handled yet!");
12471247 }
12481248
12491249 /// AddConstraintsForCall - Add constraints for a call with actual arguments
2323 #include "llvm/Analysis/ScalarEvolution.h"
2424 #include "llvm/Instructions.h"
2525 #include "llvm/Support/Debug.h"
26 #include "llvm/Support/ErrorHandling.h"
2627 #include "llvm/Target/TargetData.h"
2728 using namespace llvm;
2829
6263 return i->getPointerOperand();
6364 if (StoreInst *i = dyn_cast(I))
6465 return i->getPointerOperand();
65 assert(0 && "Value is no load or store instruction!");
66 LLVM_UNREACHABLE("Value is no load or store instruction!");
6667 // Never reached.
6768 return 0;
6869 }
7474 #include "llvm/Support/CommandLine.h"
7575 #include "llvm/Support/Compiler.h"
7676 #include "llvm/Support/ConstantRange.h"
77 #include "llvm/Support/ErrorHandling.h"
7778 #include "llvm/Support/GetElementPtrTypeIterator.h"
7879 #include "llvm/Support/InstIterator.h"
7980 #include "llvm/Support/MathExtras.h"
146147 SCEV(scCouldNotCompute) {}
147148
148149 void SCEVCouldNotCompute::Profile(FoldingSetNodeID &ID) const {
149 assert(0 && "Attempt to use a SCEVCouldNotCompute object!");
150 LLVM_UNREACHABLE("Attempt to use a SCEVCouldNotCompute object!");
150151 }
151152
152153 bool SCEVCouldNotCompute::isLoopInvariant(const Loop *L) const {
153 assert(0 && "Attempt to use a SCEVCouldNotCompute object!");
154 LLVM_UNREACHABLE("Attempt to use a SCEVCouldNotCompute object!");
154155 return false;
155156 }
156157
157158 const Type *SCEVCouldNotCompute::getType() const {
158 assert(0 && "Attempt to use a SCEVCouldNotCompute object!");
159 LLVM_UNREACHABLE("Attempt to use a SCEVCouldNotCompute object!");
159160 return 0;
160161 }
161162
162163 bool SCEVCouldNotCompute::hasComputableLoopEvolution(const Loop *L) const {
163 assert(0 && "Attempt to use a SCEVCouldNotCompute object!");
164 LLVM_UNREACHABLE("Attempt to use a SCEVCouldNotCompute object!");
164165 return false;
165166 }
166167
295296 else if (isa(this))
296297 return SE.getUMaxExpr(NewOps);
297298 else
298 assert(0 && "Unknown commutative expr!");
299 LLVM_UNREACHABLE("Unknown commutative expr!");
299300 }
300301 }
301302 return this;
542543 return operator()(LC->getOperand(), RC->getOperand());
543544 }
544545
545 assert(0 && "Unknown SCEV kind!");
546 LLVM_UNREACHABLE("Unknown SCEV kind!");
546547 return false;
547548 }
548549 };
34873488 if (Idx >= ATy->getNumElements()) return 0; // Bogus program
34883489 Init = Constant::getNullValue(ATy->getElementType());
34893490 } else {
3490 assert(0 && "Unknown constant aggregate type!");
3491 LLVM_UNREACHABLE("Unknown constant aggregate type!");
34913492 }
34923493 return 0;
34933494 } else {
38973898 return getSMaxExpr(NewOps);
38983899 if (isa(Comm))
38993900 return getUMaxExpr(NewOps);
3900 assert(0 && "Unknown commutative SCEV type!");
3901 LLVM_UNREACHABLE("Unknown commutative SCEV type!");
39013902 }
39023903 }
39033904 // If we got here, all operands are loop invariant.
39483949 return getTruncateExpr(Op, Cast->getType());
39493950 }
39503951
3951 assert(0 && "Unknown SCEV type!");
3952 LLVM_UNREACHABLE("Unknown SCEV type!");
39523953 return 0;
39533954 }
39543955
42594260
42604261 switch (Pred) {
42614262 default:
4262 assert(0 && "Unexpected ICmpInst::Predicate value!");
4263 LLVM_UNREACHABLE("Unexpected ICmpInst::Predicate value!");
42634264 break;
42644265 case ICmpInst::ICMP_SGT:
42654266 Pred = ICmpInst::ICMP_SLT;
1414 #include "llvm/DerivedTypes.h"
1515 #include "llvm/Instruction.h"
1616 #include "llvm/LLVMContext.h"
17 #include "llvm/Support/ErrorHandling.h"
1718 #include "llvm/Support/MemoryBuffer.h"
1819 #include "llvm/Support/MathExtras.h"
1920 #include "llvm/Support/SourceMgr.h"
698699
699700 uint64_t Pair[2];
700701 switch (Kind) {
701 default: assert(0 && "Unknown kind!");
702 default: LLVM_UNREACHABLE("Unknown kind!");
702703 case 'K':
703704 // F80HexFPConstant - x87 long double in hexadecimal format (10 bytes)
704705 FP80HexToIntPair(TokStart+3, CurPtr, Pair);
2323 #include "llvm/ValueSymbolTable.h"
2424 #include "llvm/ADT/SmallPtrSet.h"
2525 #include "llvm/ADT/StringExtras.h"
26 #include "llvm/Support/ErrorHandling.h"
2627 #include "llvm/Support/raw_ostream.h"
2728 using namespace llvm;
2829
20392040 return Error(ID.Loc, "functions are not values, refer to them as pointers");
20402041
20412042 switch (ID.Kind) {
2042 default: assert(0 && "Unknown ValID!");
2043 default: LLVM_UNREACHABLE("Unknown ValID!");
20432044 case ValID::t_LocalID:
20442045 case ValID::t_LocalName:
20452046 return Error(ID.Loc, "invalid use of function-local name");
28342835
28352836 bool Valid;
28362837 switch (OperandType) {
2837 default: assert(0 && "Unknown operand type!");
2838 default: LLVM_UNREACHABLE("Unknown operand type!");
28382839 case 0: // int or FP.
28392840 Valid = LHS->getType()->isIntOrIntVector() ||
28402841 LHS->getType()->isFPOrFPVector();
2222 #include "llvm/Module.h"
2323 #include "llvm/TypeSymbolTable.h"
2424 #include "llvm/ValueSymbolTable.h"
25 #include "llvm/Support/ErrorHandling.h"
2526 #include "llvm/Support/MathExtras.h"
2627 #include "llvm/Support/Streams.h"
2728 #include "llvm/Support/raw_ostream.h"
5758
5859 static unsigned GetEncodedCastOpcode(unsigned Opcode) {
5960 switch (Opcode) {
60 default: assert(0 && "Unknown cast instruction!");
61 default: LLVM_UNREACHABLE("Unknown cast instruction!");
6162 case Instruction::Trunc : return bitc::CAST_TRUNC;
6263 case Instruction::ZExt : return bitc::CAST_ZEXT;
6364 case Instruction::SExt : return bitc::CAST_SEXT;
7576
7677 static unsigned GetEncodedBinaryOpcode(unsigned Opcode) {
7778 switch (Opcode) {
78 default: assert(0 && "Unknown binary instruction!");
79 default: LLVM_UNREACHABLE("Unknown binary instruction!");
7980 case Instruction::Add:
8081 case Instruction::FAdd: return bitc::BINOP_ADD;
8182 case Instruction::Sub:
199200 unsigned Code = 0;
200201
201202 switch (T->getTypeID()) {
202 default: assert(0 && "Unknown type!");
203 default: LLVM_UNREACHABLE("Unknown type!");
203204 case Type::VoidTyID: Code = bitc::TYPE_CODE_VOID; break;
204205 case Type::FloatTyID: Code = bitc::TYPE_CODE_FLOAT; break;
205206 case Type::DoubleTyID: Code = bitc::TYPE_CODE_DOUBLE; break;
277278
278279 static unsigned getEncodedLinkage(const GlobalValue *GV) {
279280 switch (GV->getLinkage()) {
280 default: assert(0 && "Invalid linkage!");
281 default: LLVM_UNREACHABLE("Invalid linkage!");
281282 case GlobalValue::GhostLinkage: // Map ghost linkage onto external.
282283 case GlobalValue::ExternalLinkage: return 0;
283284 case GlobalValue::WeakAnyLinkage: return 1;
297298
298299 static unsigned getEncodedVisibility(const GlobalValue *GV) {
299300 switch (GV->getVisibility()) {
300 default: assert(0 && "Invalid visibility!");
301 default: LLVM_UNREACHABLE("Invalid visibility!");
301302 case GlobalValue::DefaultVisibility: return 0;
302303 case GlobalValue::HiddenVisibility: return 1;
303304 case GlobalValue::ProtectedVisibility: return 2;
711712 }
712713 }
713714 } else {
714 assert(0 && "Unknown constant!");
715 LLVM_UNREACHABLE("Unknown constant!");
715716 }
716717 Stream.EmitRecord(Code, Record, AbbrevToUse);
717718 Record.clear();
11251126 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 8));
11261127 if (Stream.EmitBlockInfoAbbrev(bitc::VALUE_SYMTAB_BLOCK_ID,
11271128 Abbv) != VST_ENTRY_8_ABBREV)
1128 assert(0 && "Unexpected abbrev ordering!");
1129 LLVM_UNREACHABLE("Unexpected abbrev ordering!");
11291130 }
11301131
11311132 { // 7-bit fixed width VST_ENTRY strings.
11361137 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 7));
11371138 if (Stream.EmitBlockInfoAbbrev(bitc::VALUE_SYMTAB_BLOCK_ID,
11381139 Abbv) != VST_ENTRY_7_ABBREV)
1139 assert(0 && "Unexpected abbrev ordering!");
1140 LLVM_UNREACHABLE("Unexpected abbrev ordering!");
11401141 }
11411142 { // 6-bit char6 VST_ENTRY strings.
11421143 BitCodeAbbrev *Abbv = new BitCodeAbbrev();
11461147 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Char6));
11471148 if (Stream.EmitBlockInfoAbbrev(bitc::VALUE_SYMTAB_BLOCK_ID,
11481149 Abbv) != VST_ENTRY_6_ABBREV)
1149 assert(0 && "Unexpected abbrev ordering!");
1150 LLVM_UNREACHABLE("Unexpected abbrev ordering!");
11501151 }
11511152 { // 6-bit char6 VST_BBENTRY strings.
11521153 BitCodeAbbrev *Abbv = new BitCodeAbbrev();
11561157 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Char6));
11571158 if (Stream.EmitBlockInfoAbbrev(bitc::VALUE_SYMTAB_BLOCK_ID,
11581159 Abbv) != VST_BBENTRY_6_ABBREV)
1159 assert(0 && "Unexpected abbrev ordering!");
1160 LLVM_UNREACHABLE("Unexpected abbrev ordering!");
11601161 }
11611162
11621163
11681169 Log2_32_Ceil(VE.getTypes().size()+1)));
11691170 if (Stream.EmitBlockInfoAbbrev(bitc::CONSTANTS_BLOCK_ID,
11701171 Abbv) != CONSTANTS_SETTYPE_ABBREV)
1171 assert(0 && "Unexpected abbrev ordering!");
1172 LLVM_UNREACHABLE("Unexpected abbrev ordering!");
11721173 }
11731174
11741175 { // INTEGER abbrev for CONSTANTS_BLOCK.
11771178 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8));
11781179 if (Stream.EmitBlockInfoAbbrev(bitc::CONSTANTS_BLOCK_ID,
11791180 Abbv) != CONSTANTS_INTEGER_ABBREV)
1180 assert(0 && "Unexpected abbrev ordering!");
1181 LLVM_UNREACHABLE("Unexpected abbrev ordering!");
11811182 }
11821183
11831184 { // CE_CAST abbrev for CONSTANTS_BLOCK.
11901191
11911192 if (Stream.EmitBlockInfoAbbrev(bitc::CONSTANTS_BLOCK_ID,
11921193 Abbv) != CONSTANTS_CE_CAST_Abbrev)
1193 assert(0 && "Unexpected abbrev ordering!");
1194 LLVM_UNREACHABLE("Unexpected abbrev ordering!");
11941195 }
11951196 { // NULL abbrev for CONSTANTS_BLOCK.
11961197 BitCodeAbbrev *Abbv = new BitCodeAbbrev();
11971198 Abbv->Add(BitCodeAbbrevOp(bitc::CST_CODE_NULL));
11981199 if (Stream.EmitBlockInfoAbbrev(bitc::CONSTANTS_BLOCK_ID,
11991200 Abbv) != CONSTANTS_NULL_Abbrev)
1200 assert(0 && "Unexpected abbrev ordering!");
1201 LLVM_UNREACHABLE("Unexpected abbrev ordering!");
12011202 }
12021203
12031204 // FIXME: This should only use space for first class types!
12101211 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // volatile
12111212 if (Stream.EmitBlockInfoAbbrev(bitc::FUNCTION_BLOCK_ID,
12121213 Abbv) != FUNCTION_INST_LOAD_ABBREV)
1213 assert(0 && "Unexpected abbrev ordering!");
1214 LLVM_UNREACHABLE("Unexpected abbrev ordering!");
12141215 }
12151216 { // INST_BINOP abbrev for FUNCTION_BLOCK.
12161217 BitCodeAbbrev *Abbv = new BitCodeAbbrev();
12201221 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 4)); // opc
12211222 if (Stream.EmitBlockInfoAbbrev(bitc::FUNCTION_BLOCK_ID,
12221223 Abbv) != FUNCTION_INST_BINOP_ABBREV)
1223 assert(0 && "Unexpected abbrev ordering!");
1224 LLVM_UNREACHABLE("Unexpected abbrev ordering!");
12241225 }
12251226 { // INST_CAST abbrev for FUNCTION_BLOCK.
12261227 BitCodeAbbrev *Abbv = new BitCodeAbbrev();
12311232 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 4)); // opc
12321233 if (Stream.EmitBlockInfoAbbrev(bitc::FUNCTION_BLOCK_ID,
12331234 Abbv) != FUNCTION_INST_CAST_ABBREV)
1234 assert(0 && "Unexpected abbrev ordering!");
1235 LLVM_UNREACHABLE("Unexpected abbrev ordering!");
12351236 }
12361237
12371238 { // INST_RET abbrev for FUNCTION_BLOCK.
12391240 Abbv->Add(BitCodeAbbrevOp(bitc::FUNC_CODE_INST_RET));
12401241 if (Stream.EmitBlockInfoAbbrev(bitc::FUNCTION_BLOCK_ID,
12411242 Abbv) != FUNCTION_INST_RET_VOID_ABBREV)
1242 assert(0 && "Unexpected abbrev ordering!");
1243 LLVM_UNREACHABLE("Unexpected abbrev ordering!");
12431244 }
12441245 { // INST_RET abbrev for FUNCTION_BLOCK.
12451246 BitCodeAbbrev *Abbv = new BitCodeAbbrev();
12471248 Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // ValID
12481249 if (Stream.EmitBlockInfoAbbrev(bitc::FUNCTION_BLOCK_ID,
12491250 Abbv) != FUNCTION_INST_RET_VAL_ABBREV)
1250 assert(0 && "Unexpected abbrev ordering!");
1251 LLVM_UNREACHABLE("Unexpected abbrev ordering!");
12511252 }
12521253 { // INST_UNREACHABLE abbrev for FUNCTION_BLOCK.
12531254 BitCodeAbbrev *Abbv = new BitCodeAbbrev();
12541255 Abbv->Add(BitCodeAbbrevOp(bitc::FUNC_CODE_INST_UNREACHABLE));
12551256 if (Stream.EmitBlockInfoAbbrev(bitc::FUNCTION_BLOCK_ID,
12561257 Abbv) != FUNCTION_INST_UNREACHABLE_ABBREV)
1257 assert(0 && "Unexpected abbrev ordering!");
1258 LLVM_UNREACHABLE("Unexpected abbrev ordering!");
12581259 }
12591260
12601261 Stream.ExitBlock();
236236 else if (I->hasWeakLinkage())
237237 O << TAI->getWeakRefDirective() << Name << '\n';
238238 else if (!I->hasLocalLinkage())
239 assert(0 && "Invalid alias linkage");
239 LLVM_UNREACHABLE("Invalid alias linkage");
240240
241241 printVisibility(Name, I->getVisibility());
242242
900900 case Instruction::SIToFP:
901901 case Instruction::FPToUI:
902902 case Instruction::FPToSI:
903 assert(0 && "FIXME: Don't yet support this kind of constant cast expr");
903 LLVM_UNREACHABLE("FIXME: Don't yet support this kind of constant cast expr");
904904 break;
905905 case Instruction::BitCast:
906906 return EmitConstantValueOnly(CE->getOperand(0));
966966 O << ')';
967967 break;
968968 default:
969 assert(0 && "Unsupported operator!");
969 LLVM_UNREACHABLE("Unsupported operator!");
970970 }
971971 } else {
972 assert(0 && "Unknown constant value!");
972 LLVM_UNREACHABLE("Unknown constant value!");
973973 }
974974 }
975975
12081208 O << '\n';
12091209 }
12101210 return;
1211 } else assert(0 && "Floating point constant type not handled");
1211 } else LLVM_UNREACHABLE("Floating point constant type not handled");
12121212 }
12131213
12141214 void AsmPrinter::EmitGlobalConstantLargeInt(const ConstantInt *CI,
16591659 "Target cannot handle 64-bit constant exprs!");
16601660 O << TAI->getData64bitsDirective(AddrSpace);
16611661 } else {
1662 assert(0 && "Target cannot handle given data directive width!");
1662 LLVM_UNREACHABLE("Target cannot handle given data directive width!");
16631663 }
16641664 break;
16651665 }
1515 #include "llvm/CodeGen/AsmPrinter.h"
1616 #include "llvm/Target/TargetAsmInfo.h"
1717 #include "llvm/Target/TargetData.h"
18 #include "llvm/Support/ErrorHandling.h"
1819 #include
1920 using namespace llvm;
2021
205206 case dwarf::DW_FORM_data8: Asm->EmitInt64(Integer); break;
206207 case dwarf::DW_FORM_udata: Asm->EmitULEB128Bytes(Integer); break;
207208 case dwarf::DW_FORM_sdata: Asm->EmitSLEB128Bytes(Integer); break;
208 default: assert(0 && "DIE Value form not supported yet"); break;
209 default: LLVM_UNREACHABLE("DIE Value form not supported yet");
209210 }
210211 }
211212
224225 case dwarf::DW_FORM_data8: return sizeof(int64_t);
225226 case dwarf::DW_FORM_udata: return TargetAsmInfo::getULEB128Size(Integer);
226227 case dwarf::DW_FORM_sdata: return TargetAsmInfo::getSLEB128Size(Integer);
227 default: assert(0 && "DIE Value form not supported yet"); break;
228 default: LLVM_UNREACHABLE("DIE Value form not supported yet"); break;
228229 }
229230 return 0;
230231 }
480481 case dwarf::DW_FORM_block2: Asm->EmitInt16(Size); break;
481482 case dwarf::DW_FORM_block4: Asm->EmitInt32(Size); break;
482483 case dwarf::DW_FORM_block: Asm->EmitULEB128Bytes(Size); break;
483 default: assert(0 && "Improper form for block"); break;
484 default: LLVM_UNREACHABLE("Improper form for block"); break;
484485 }
485486
486487 const SmallVector &AbbrevData = Abbrev.getData();
498499 case dwarf::DW_FORM_block2: return Size + sizeof(int16_t);
499500 case dwarf::DW_FORM_block4: return Size + sizeof(int32_t);
500501 case dwarf::DW_FORM_block: return Size + TargetAsmInfo::getULEB128Size(Size);
501 default: assert(0 && "Improper form for block"); break;
502 default: LLVM_UNREACHABLE("Improper form for block"); break;
502503 }
503504 return 0;
504505 }
1616 #include "llvm/CodeGen/MachineFrameInfo.h"
1717 #include "llvm/CodeGen/MachineModuleInfo.h"
1818 #include "llvm/Support/Dwarf.h"
19 #include "llvm/Support/ErrorHandling.h"
1920 #include "llvm/Target/TargetAsmInfo.h"
2021 #include "llvm/Target/TargetData.h"
2122 #include "llvm/Target/TargetFrameInfo.h"
189190 Asm->EmitULEB128Bytes(Offset);
190191 Asm->EOL("Offset");
191192 } else {
192 assert(0 && "Machine move not supported yet.");
193 LLVM_UNREACHABLE("Machine move not supported yet.");
193194 }
194195 } else if (Src.isReg() &&
195196 Src.getReg() == MachineLocation::VirtualFP) {
199200 Asm->EmitULEB128Bytes(RI->getDwarfRegNum(Dst.getReg(), isEH));
200201 Asm->EOL("Register");
201202 } else {
202 assert(0 && "Machine move not supported yet.");
203 LLVM_UNREACHABLE("Machine move not supported yet.");
203204 }
204205 } else {
205206 unsigned Reg = RI->getDwarfRegNum(Src.getReg(), isEH);
2626 #include "llvm/Target/TargetRegisterInfo.h"
2727 #include "llvm/Support/CommandLine.h"
2828 #include "llvm/Support/Debug.h"
29 #include "llvm/Support/ErrorHandling.h"
2930 #include "llvm/ADT/SmallSet.h"
3031 #include "llvm/ADT/Statistic.h"
3132 #include "llvm/ADT/STLExtras.h"
460461 // _GLIBCXX_DEBUG checks strict weak ordering, which involves comparing
461462 // an object with itself.
462463 #ifndef _GLIBCXX_DEBUG
463 assert(0 && "Predecessor appears twice");
464 LLVM_UNREACHABLE("Predecessor appears twice");
464465 #endif
465466 return false;
466467 }
2222 #include "llvm/Target/TargetMachine.h"
2323 #include "llvm/Target/TargetAsmInfo.h"
2424 #include "llvm/Support/Debug.h"
25 #include "llvm/Support/ErrorHandling.h"
2526
2627 //===----------------------------------------------------------------------===//
2728 // ELFCodeEmitter Implementation
106107 MR.setResultPointer((void*)Addr);
107108 MR.setConstantVal(JumpTableSectionIdx);
108109 } else {
109 assert(0 && "Unhandled relocation type");
110 LLVM_UNREACHABLE("Unhandled relocation type");
110111 }
111112 ES->addRelocation(MR);
112113 }
5050 #include "llvm/Support/Streams.h"
5151 #include "llvm/Support/raw_ostream.h"
5252 #include "llvm/Support/Debug.h"
53 #include "llvm/Support/ErrorHandling.h"
5354
5455 using namespace llvm;
5556
146147 unsigned ELFWriter::getGlobalELFVisibility(const GlobalValue *GV) {
147148 switch (GV->getVisibility()) {
148149 default:
149 assert(0 && "unknown visibility type");
150 LLVM_UNREACHABLE("unknown visibility type");
150151 case GlobalValue::DefaultVisibility:
151152 return ELFSym::STV_DEFAULT;
152153 case GlobalValue::HiddenVisibility:
338339 else if (CFP->getType() == Type::FloatTy)
339340 GblS.emitWord32(Val);
340341 else if (CFP->getType() == Type::X86_FP80Ty) {
341 assert(0 && "X86_FP80Ty global emission not implemented");
342 LLVM_UNREACHABLE("X86_FP80Ty global emission not implemented");
342343 } else if (CFP->getType() == Type::PPC_FP128Ty)
343 assert(0 && "PPC_FP128Ty global emission not implemented");
344 LLVM_UNREACHABLE("PPC_FP128Ty global emission not implemented");
344345 return;
345346 } else if (const ConstantInt *CI = dyn_cast(CV)) {
346347 if (Size == 4)
348349 else if (Size == 8)
349350 GblS.emitWord64(CI->getZExtValue());
350351 else
351 assert(0 && "LargeInt global emission not implemented");
352 LLVM_UNREACHABLE("LargeInt global emission not implemented");
352353 return;
353354 } else if (const ConstantVector *CP = dyn_cast(CV)) {
354355 const VectorType *PTy = CP->getType();
356357 EmitGlobalConstant(CP->getOperand(I), GblS);
357358 return;
358359 }
359 assert(0 && "unknown global constant");
360 LLVM_UNREACHABLE("unknown global constant");
360361 }
361362
362363
143143
144144 static const char *DescKind(GC::PointKind Kind) {
145145 switch (Kind) {
146 default: assert(0 && "Unknown GC point kind");
146 default: LLVM_UNREACHABLE("Unknown GC point kind");
147147 case GC::Loop: return "loop";
148148 case GC::Return: return "return";
149149 case GC::PreCall: return "pre-call";
156156 IRBuilder<> Builder(IP->getParent(), IP);
157157
158158 switch(BitSize) {
159 default: assert(0 && "Unhandled type size of value to byteswap!");
159 default: LLVM_UNREACHABLE("Unhandled type size of value to byteswap!");
160160 case 16: {
161161 Value *Tmp1 = Builder.CreateShl(V, ConstantInt::get(V->getType(), 8),
162162 "bswap.2");
11011101 unsigned SrcReg, DstReg, SrcSubReg, DstSubReg;
11021102 if (tii_->isMoveInstr(*VNI->copy, SrcReg, DstReg, SrcSubReg, DstSubReg))
11031103 return SrcReg;
1104 assert(0 && "Unrecognized copy instruction!");
1104 LLVM_UNREACHABLE("Unrecognized copy instruction!");
11051105 return 0;
11061106 }
11071107
1818 #include "llvm/Target/TargetAsmInfo.h"
1919 #include "llvm/Target/TargetData.h"
2020 #include "llvm/Target/TargetMachine.h"
21 #include "llvm/Support/ErrorHandling.h"
2122 #include "llvm/Support/Mangler.h"
2223 #include "llvm/Support/OutputBuffer.h"
2324 #include
103104 // FIXME: This should be a set or something that uniques
104105 MOW.PendingGlobals.push_back(MR.getGlobalValue());
105106 } else {
106 assert(0 && "Unhandled relocation type");
107 LLVM_UNREACHABLE("Unhandled relocation type");
107108 }
108109 MOS->addRelocation(MR);
109110 }
668668 ptr[6] = val >> 48;
669669 ptr[7] = val >> 56;
670670 } else {
671 assert(0 && "Not implemented: bit widths > 64");
671 LLVM_UNREACHABLE("Not implemented: bit widths > 64");
672672 }
673673 break;
674674 }
732732 PA+SL->getElementOffset(i)));
733733 } else {
734734 cerr << "Bad Type: " << *PC->getType() << "\n";
735 assert(0 && "Unknown constant type to initialize memory with!");
735 LLVM_UNREACHABLE("Unknown constant type to initialize memory with!");
736736 }
737737 }
738738 }
748748
749749 switch (GV->getLinkage()) {
750750 default:
751 assert(0 && "Unexpected linkage type!");
751 LLVM_UNREACHABLE("Unexpected linkage type!");
752752 break;
753753 case GlobalValue::WeakAnyLinkage:
754754 case GlobalValue::WeakODRLinkage:
2222 #include "llvm/Target/TargetInstrDesc.h"
2323 #include "llvm/Target/TargetRegisterInfo.h"
2424 #include "llvm/Analysis/DebugInfo.h"
25 #include "llvm/Support/ErrorHandling.h"
2526 #include "llvm/Support/LeakDetector.h"
2627 #include "llvm/Support/MathExtras.h"
2728 #include "llvm/Support/Streams.h"
155156 return false;
156157
157158 switch (getType()) {
158 default: assert(0 && "Unrecognized operand type");
159 default: LLVM_UNREACHABLE("Unrecognized operand type");
159160 case MachineOperand::MO_Register:
160161 return getReg() == Other.getReg() && isDef() == Other.isDef() &&
161162 getSubReg() == Other.getSubReg();
273274 OS << '>';
274275 break;
275276 default:
276 assert(0 && "Unrecognized operand type");
277 LLVM_UNREACHABLE("Unrecognized operand type");
277278 }
278279
279280 if (unsigned TF = getTargetFlags())
2222 #include "llvm/Instructions.h"
2323 #include "llvm/Module.h"
2424 #include "llvm/Support/Dwarf.h"
25 #include "llvm/Support/ErrorHandling.h"
2526 #include "llvm/Support/Streams.h"
2627 using namespace llvm;
2728 using namespace llvm::dwarf;
289290 }
290291
291292 // This should never happen
292 assert(0 && "Personality function should be set!");
293 LLVM_UNREACHABLE("Personality function should be set!");
293294 return 0;
294295 }
295296
3333 #include "llvm/Target/TargetRegisterInfo.h"
3434 #include "llvm/Support/Compiler.h"
3535 #include "llvm/Support/Debug.h"
36 #include "llvm/Support/ErrorHandling.h"
3637 #include "llvm/ADT/Statistic.h"
3738 #include
3839 using namespace llvm;
792793 cerr << "*** Scheduling failed! ***\n";
793794 SuccSU->dump(this);
794795 cerr << " has been released too many times!\n";
795 assert(0);
796 llvm_unreachable();
796797 }
797798 #endif
798799
1414 #include "llvm/CodeGen/PseudoSourceValue.h"
1515 #include "llvm/DerivedTypes.h"
1616 #include "llvm/Support/Compiler.h"
17 #include "llvm/Support/ErrorHandling.h"
1718 #include "llvm/Support/ManagedStatic.h"
1819 #include "llvm/Support/raw_ostream.h"
1920 #include
8283 this == getConstantPool() ||
8384 this == getJumpTable())
8485 return true;
85 assert(0 && "Unknown PseudoSourceValue!");
86 LLVM_UNREACHABLE("Unknown PseudoSourceValue!");
8687 return false;
8788 }
8889
392392
393393 assert(Depth <= 6 && "GetNegatedExpression doesn't match isNegatibleForFree");
394394 switch (Op.getOpcode()) {
395 default: assert(0 && "Unknown code");
395 default: LLVM_UNREACHABLE("Unknown code");
396396 case ISD::ConstantFP: {
397397 APFloat V = cast(Op)->getValueAPF();
398398 V.changeSign();
50625062 if (Value.getOpcode() != ISD::TargetConstantFP) {
50635063 SDValue Tmp;
50645064 switch (CFP->getValueType(0).getSimpleVT()) {
5065 default: assert(0 && "Unknown FP type");
5065 default: LLVM_UNREACHABLE("Unknown FP type");
50665066 case MVT::f80: // We don't do this for these yet.
50675067 case MVT::f128:
50685068 case MVT::ppcf128:
61066106 SrcValue = ST->getSrcValue();
61076107 SrcValueOffset = ST->getSrcValueOffset();
61086108 } else {
6109 assert(0 && "FindAliasInfo expected a memory operand");
6109 LLVM_UNREACHABLE("FindAliasInfo expected a memory operand");
61106110 }
61116111
61126112 return false;
982982 return Tmp2;
983983 case ISD::BUILD_VECTOR:
984984 switch (TLI.getOperationAction(ISD::BUILD_VECTOR, Node->getValueType(0))) {
985 default: assert(0 && "This action is not supported yet!");
985 default: LLVM_UNREACHABLE("This action is not supported yet!");
986986 case TargetLowering::Custom:
987987 Tmp3 = TLI.LowerOperation(Result, DAG);
988988 if (Tmp3.getNode()) {
10991099 Tmp4 = Result.getValue(1);
11001100
11011101 switch (TLI.getOperationAction(Node->getOpcode(), VT)) {
1102 default: assert(0 && "This action is not supported yet!");
1102 default: LLVM_UNREACHABLE("This action is not supported yet!");
11031103 case TargetLowering::Legal:
11041104 // If this is an unaligned load and the target doesn't support it,
11051105 // expand it.
12691269 Tmp2 = LegalizeOp(Ch);
12701270 } else {
12711271 switch (TLI.getLoadExtAction(ExtType, SrcVT)) {
1272 default: assert(0 && "This action is not supported yet!");
1272 default: LLVM_UNREACHABLE("This action is not supported yet!");
12731273 case TargetLowering::Custom:
12741274 isCustom = true;
12751275 // FALLTHROUGH
13621362
13631363 MVT VT = Tmp3.getValueType();
13641364 switch (TLI.getOperationAction(ISD::STORE, VT)) {
1365 default: assert(0 && "This action is not supported yet!");
1365 default: LLVM_UNREACHABLE("This action is not supported yet!");
13661366 case TargetLowering::Legal:
13671367 // If this is an unaligned store and the target doesn't support it,
13681368 // expand it.
14621462 ST->getOffset());
14631463
14641464 switch (TLI.getTruncStoreAction(ST->getValue().getValueType(), StVT)) {
1465 default: assert(0 && "This action is not supported yet!");
1465 default: LLVM_UNREACHABLE("This action is not supported yet!");
14661466 case TargetLowering::Legal:
14671467 // If this is an unaligned store and the target doesn't support it,
14681468 // expand it.
16901690 MVT OpVT = LHS.getValueType();
16911691 ISD::CondCode CCCode = cast(CC)->get();
16921692 switch (TLI.getCondCodeAction(CCCode, OpVT)) {
1693 default: assert(0 && "Unknown condition code action!");
1693 default: LLVM_UNREACHABLE("Unknown condition code action!");
16941694 case TargetLowering::Legal:
16951695 // Nothing to do.
16961696 break;
19251925 RTLIB::Libcall Call_PPCF128) {
19261926 RTLIB::Libcall LC;
19271927 switch (Node->getValueType(0).getSimpleVT()) {
1928 default: assert(0 && "Unexpected request for libcall!");
1928 default: LLVM_UNREACHABLE("Unexpected request for libcall!");
19291929 case MVT::f32: LC = Call_F32; break;
19301930 case MVT::f64: LC = Call_F64; break;
19311931 case MVT::f80: LC = Call_F80; break;
19411941 RTLIB::Libcall Call_I128) {
19421942 RTLIB::Libcall LC;
19431943 switch (Node->getValueType(0).getSimpleVT()) {
1944 default: assert(0 && "Unexpected request for libcall!");
1944 default: LLVM_UNREACHABLE("Unexpected request for libcall!");
19451945 case MVT::i16: LC = Call_I16; break;
19461946 case MVT::i32: LC = Call_I32; break;
19471947 case MVT::i64: LC = Call_I64; break;
20272027 // offset depending on the data type.
20282028 uint64_t FF;
20292029 switch (Op0.getValueType().getSimpleVT()) {
2030 default: assert(0 && "Unsupported integer type!");
2030 default: LLVM_UNREACHABLE("Unsupported integer type!");
20312031 case MVT::i8 : FF = 0x43800000ULL; break; // 2^8 (as a float)
20322032 case MVT::i16: FF = 0x47800000ULL; break; // 2^16 (as a float)
20332033 case MVT::i32: FF = 0x4F800000ULL; break; // 2^32 (as a float)
21912191 SDValue SelectionDAGLegalize::ExpandBitCount(unsigned Opc, SDValue Op,
21922192 DebugLoc dl) {
21932193 switch (Opc) {
2194 default: assert(0 && "Cannot expand this yet!");
2194 default: LLVM_UNREACHABLE("Cannot expand this yet!");
21952195 case ISD::CTPOP: {
21962196 static const uint64_t mask[6] = {
21972197 0x5555555555555555ULL, 0x3333333333333333ULL,
23052305 else if (VT.isFloatingPoint())
23062306 Results.push_back(DAG.getConstantFP(0, VT));
23072307 else
2308 assert(0 && "Unknown value type!");
2308 LLVM_UNREACHABLE("Unknown value type!");
23092309 break;
23102310 }
23112311 case ISD::TRAP: {
28092809 // type in some cases cases.
28102810 // Also, we can fall back to a division in some cases, but that's a big
28112811 // performance hit in the general case.
2812 assert(0 && "Don't know how to expand this operation yet!");
2812 LLVM_UNREACHABLE("Don't know how to expand this operation yet!");
28132813 }
28142814 if (isSigned) {
28152815 Tmp1 = DAG.getConstant(VT.getSizeInBits() - 1, TLI.getShiftAmountTy());
30903090 break;
30913091 }
30923092 if (NewInTy.isInteger())
3093 assert(0 && "Cannot promote Legal Integer SETCC yet");
3093 LLVM_UNREACHABLE("Cannot promote Legal Integer SETCC yet");
30943094 else {
30953095 Tmp1 = DAG.getNode(ISD::FP_EXTEND, dl, NewInTy, Tmp1);
30963096 Tmp2 = DAG.getNode(ISD::FP_EXTEND, dl, NewInTy, Tmp2);
490490 SDValue Res;
491491
492492 switch (getTypeAction(N->getOperand(0).getValueType())) {
493 default: assert(0 && "Unknown type action!");
493 default: LLVM_UNREACHABLE("Unknown type action!");
494494 case Legal:
495495 case ExpandInteger:
496496 Res = N->getOperand(0);
665665 // insert sign extends for ALL conditions, but zero extend is cheaper on
666666 // many machines (an AND instead of two shifts), so prefer it.
667667 switch (CCCode) {
668 default: assert(0 && "Unknown integer comparison!");
668 default: LLVM_UNREACHABLE("Unknown integer comparison!");
669669 case ISD::SETEQ:
670670 case ISD::SETNE:
671671 case ISD::SETUGE:
11031103 DAG.getConstant(~HighBitMask, ShTy));
11041104
11051105 switch (N->getOpcode()) {
1106 default: assert(0 && "Unknown shift");
1106 default: LLVM_UNREACHABLE("Unknown shift");
11071107 case ISD::SHL:
11081108 Lo = DAG.getConstant(0, NVT); // Low part is zero.
11091109 Hi = DAG.getNode(ISD::SHL, dl, NVT, InL, Amt); // High part from Lo part.
11311131 Amt);
11321132 unsigned Op1, Op2;
11331133 switch (N->getOpcode()) {
1134 default: assert(0 && "Unknown shift");
1134 default: LLVM_UNREACHABLE("Unknown shift");
11351135 case ISD::SHL: Op1 = ISD::SHL; Op2 = ISD::SRL; break;
11361136 case ISD::SRL:
11371137 case ISD::SRA: Op1 = ISD::SRL; Op2 = ISD::SHL; break;
11711171
11721172 SDValue Lo1, Hi1, Lo2, Hi2;
11731173 switch (N->getOpcode()) {
1174 default: assert(0 && "Unknown shift");
1174 default: LLVM_UNREACHABLE("Unknown shift");
11751175 case ISD::SHL:
11761176 // ShAmt < NVTBits
11771177 Lo1 = DAG.getConstant(0, NVT); // Low part is zero.
17911791 }
17921792
17931793 if (!ExpandShiftWithUnknownAmountBit(N, Lo, Hi))
1794 assert(0 && "Unsupported shift!");
1794 LLVM_UNREACHABLE("Unsupported shift!");
17951795 }
17961796
17971797 void DAGTypeLegalizer::ExpandIntRes_SIGN_EXTEND(SDNode *N,
20492049 // FIXME: This generated code sucks.
20502050 ISD::CondCode LowCC;
20512051 switch (CCCode) {
2052 default: assert(0 && "Unknown integer setcc!");
2052 default: LLVM_UNREACHABLE("Unknown integer setcc!");
20532053 case ISD::SETLT:
20542054 case ISD::SETULT: LowCC = ISD::SETULT; break;
20552055 case ISD::SETGT:
277277 cerr << "ScalarizeVectorOperand Op #" << OpNo << ": ";
278278 N->dump(&DAG); cerr << "\n";
279279 #endif
280 assert(0 && "Do not know how to scalarize this operator's operand!");
280 LLVM_UNREACHABLE("Do not know how to scalarize this operator's operand!");
281281 case ISD::BIT_CONVERT:
282282 Res = ScalarizeVecOp_BIT_CONVERT(N);
283283 break;
575575 SDValue VLo, VHi;
576576 MVT InVT = N->getOperand(0).getValueType();
577577 switch (getTypeAction(InVT)) {
578 default: assert(0 && "Unexpected type action!");
578 default: LLVM_UNREACHABLE("Unexpected type action!");
579579 case Legal: {
580580 MVT InNVT = MVT::getVectorVT(InVT.getVectorElementType(),
581581 LoVT.getVectorNumElements());
767767 // Split the input.
768768 MVT InVT = N->getOperand(0).getValueType();
769769 switch (getTypeAction(InVT)) {
770 default: assert(0 && "Unexpected type action!");
770 default: LLVM_UNREACHABLE("Unexpected type action!");
771771 case Legal: {
772772 MVT InNVT = MVT::getVectorVT(InVT.getVectorElementType(),
773773 LoVT.getVectorNumElements());
139139 cerr << "*** Scheduling failed! ***\n";
140140 PredSU->dump(this);
141141 cerr << " has been released too many times!\n";
142 assert(0);
142 llvm_unreachable();
143143 }
144144 #endif
145145
2828 #include "llvm/Target/TargetInstrInfo.h"
2929 #include "llvm/Support/Debug.h"
3030 #include "llvm/Support/Compiler.h"
31 #include "llvm/Support/ErrorHandling.h"
3132 #include "llvm/ADT/PriorityQueue.h"
3233 #include "llvm/ADT/Statistic.h"
3334 #include
112113 cerr << "*** Scheduling failed! ***\n";
113114 SuccSU->dump(this);
114115 cerr << " has been released too many times!\n";
115 assert(0);
116 llvm_unreachable();
116117 }
117118 #endif
118119
2424 #include "llvm/Target/TargetInstrInfo.h"
2525 #include "llvm/Support/Debug.h"
2626 #include "llvm/Support/Compiler.h"
27 #include "llvm/Support/ErrorHandling.h"
2728 #include "llvm/ADT/PriorityQueue.h"
2829 #include "llvm/ADT/SmallSet.h"
2930 #include "llvm/ADT/Statistic.h"
201202 cerr << "*** Scheduling failed! ***\n";
202203 PredSU->dump(this);
203204 cerr << " has been released too many times!\n";
204 assert(0);
205 llvm_unreachable();
205206 }
206207 #endif
207208
828829 cerr << "*** Scheduling failed! ***\n";
829830 SuccSU->dump(this);
830831 cerr << " has been released too many times!\n";
831 assert(0);
832 llvm_unreachable();
832833 }
833834 #endif
834835
2424 #include "llvm/ADT/Statistic.h"
2525 #include "llvm/Support/CommandLine.h"
2626 #include "llvm/Support/Debug.h"
27 #include "llvm/Support/ErrorHandling.h"
2728 #include "llvm/Support/MathExtras.h"
2829 using namespace llvm;
2930
429430 MI->addOperand(MachineOperand::CreateImm(SubIdx));
430431 BB->insert(InsertPos, MI);
431432 } else
432 assert(0 && "Node is not insert_subreg, extract_subreg, or subreg_to_reg");
433 LLVM_UNREACHABLE("Node is not insert_subreg, extract_subreg, or subreg_to_reg");
433434
434435 SDValue Op(Node, 0);
435436 bool isNew = VRBaseMap.insert(std::make_pair(Op, VRBase)).second;
550551 #ifndef NDEBUG
551552 Node->dump(DAG);
552553 #endif
553 assert(0 && "This target-independent node should have been selected!");
554 LLVM_UNREACHABLE("This target-independent node should have been selected!");
554555 break;
555556 case ISD::EntryToken:
556 assert(0 && "EntryToken should have been excluded from the schedule!");
557 LLVM_UNREACHABLE("EntryToken should have been excluded from the schedule!");
557558 break;
558559 case ISD::TokenFactor: // fall thru
559560 break;
617618 ++i; // Skip the ID value.
618619
619620 switch (Flags & 7) {
620 default: assert(0 && "Bad flags!");
621 default: LLVM_UNREACHABLE("Bad flags!");
621622 case 2: // Def of register.
622623 for (; NumVals; --NumVals, ++i) {
623624 unsigned Reg = cast(Node->getOperand(i))->getReg();
3030 #include "llvm/Target/TargetInstrInfo.h"
3131 #include "llvm/Target/TargetMachine.h"
3232 #include "llvm/Support/CommandLine.h"
33 #include "llvm/Support/ErrorHandling.h"
3334 #include "llvm/Support/ManagedStatic.h"
3435 #include "llvm/Support/MathExtras.h"
3536 #include "llvm/Support/raw_ostream.h"
5253
5354 static const fltSemantics *MVTToAPFloatSemantics(MVT VT) {
5455 switch (VT.getSimpleVT()) {
55 default: assert(0 && "Unknown FP format");
56 default: LLVM_UNREACHABLE("Unknown FP format");
5657 case MVT::f32: return &APFloat::IEEEsingle;
5758 case MVT::f64: return &APFloat::IEEEdouble;
5859 case MVT::f80: return &APFloat::x87DoubleExtended;
242243 /// if the operation does not depend on the sign of the input (setne and seteq).
243244 static int isSignedOp(ISD::CondCode Opcode) {
244245 switch (Opcode) {
245 default: assert(0 && "Illegal integer setcc operation!");
246 default: LLVM_UNREACHABLE("Illegal integer setcc operation!");
246247 case ISD::SETEQ:
247248 case ISD::SETNE: return 0;
248249 case ISD::SETLT:
362363 switch (N->getOpcode()) {
363364 case ISD::TargetExternalSymbol:
364365 case ISD::ExternalSymbol:
365 assert(0 && "Should only be used on nodes with operands");
366 LLVM_UNREACHABLE("Should only be used on nodes with operands");
366367 default: break; // Normal nodes don't need extra info.
367368 case ISD::ARG_FLAGS:
368369 ID.AddInteger(cast(N)->getArgFlags().getRawBits());
625626 bool Erased = false;
626627 switch (N->getOpcode()) {
627628 case ISD::EntryToken:
628 assert(0 && "EntryToken should not be in CSEMaps!");
629 LLVM_UNREACHABLE("EntryToken should not be in CSEMaps!");
629630 return false;
630631 case ISD::HANDLENODE: return false; // noop.
631632 case ISD::CONDCODE:
667668 !N->isMachineOpcode() && !doNotCSE(N)) {
668669 N->dump(this);
669670 cerr << "\n";
670 assert(0 && "Node is not in map!");
671 LLVM_UNREACHABLE("Node is not in map!");
671672 }
672673 #endif
673674 return Erased;
14411442 const APInt &C1 = N1C->getAPIntValue();
14421443
14431444 switch (Cond) {
1444 default: assert(0 && "Unknown integer setcc!");
1445 default: LLVM_UNREACHABLE("Unknown integer setcc!");
14451446 case ISD::SETEQ: return getConstant(C1 == C2, VT);
14461447 case ISD::SETNE: return getConstant(C1 != C2, VT);
14471448 case ISD::SETULT: return getConstant(C1.ult(C2), VT);
23702371 case ISD::MERGE_VALUES:
23712372 case ISD::CONCAT_VECTORS:
23722373 return Operand; // Factor, merge or concat of one node? No need.
2373 case ISD::FP_ROUND: assert(0 && "Invalid method to make FP_ROUND node");
2374 case ISD::FP_ROUND: LLVM_UNREACHABLE("Invalid method to make FP_ROUND node");
23742375 case ISD::FP_EXTEND:
23752376 assert(VT.isFloatingPoint() &&
23762377 Operand.getValueType().isFloatingPoint() && "Invalid FP cast!");
29452946 }
29462947 break;
29472948 case ISD::VECTOR_SHUFFLE:
2948 assert(0 && "should use getVectorShuffle constructor!");
2949 LLVM_UNREACHABLE("should use getVectorShuffle constructor!");
29492950 break;
29502951 case ISD::BIT_CONVERT:
29512952 // Fold bit_convert nodes from a type to themselves.
40594060
40604061 SDVTList SelectionDAG::getVTList(const MVT *VTs, unsigned NumVTs) {
40614062 switch (NumVTs) {
4062 case 0: assert(0 && "Cannot have nodes without results!");
4063 case 0: LLVM_UNREACHABLE("Cannot have nodes without results!");
40634064 case 1: return getVTList(VTs[0]);
40644065 case 2: return getVTList(VTs[0], VTs[1]);
40654066 case 3: return getVTList(VTs[0], VTs[1], VTs[2]);
53405341
53415342 case ISD::CONVERT_RNDSAT: {
53425343 switch (cast(this)->getCvtCode()) {
5343 default: assert(0 && "Unknown cvt code!");
5344 default: LLVM_UNREACHABLE("Unknown cvt code!");
53445345 case ISD::CVT_FF: return "cvt_ff";
53455346 case ISD::CVT_FS: return "cvt_fs";
53465347 case ISD::CVT_FU: return "cvt_fu";
53925393
53935394 case ISD::CONDCODE:
53945395 switch (cast(this)->get()) {
5395 default: assert(0 && "Unknown setcc condition!");
5396 default: LLVM_UNREACHABLE("Unknown setcc condition!");
53965397 case ISD::SETOEQ: return "setoeq";
53975398 case ISD::SETOGT: return "setogt";
53985399 case ISD::SETOGE: return "setoge";
555555 if (PartVT.getSizeInBits() == ValueVT.getSizeInBits())
556556 return DAG.getNode(ISD::BIT_CONVERT, dl, ValueVT, Val);
557557
558 assert(0 && "Unknown mismatch!");
558 LLVM_UNREACHABLE("Unknown mismatch!");
559559 return SDValue();
560560 }
561561
591591 ValueVT = MVT::getIntegerVT(NumParts * PartBits);
592592 Val = DAG.getNode(ExtendKind, dl, ValueVT, Val);
593593 } else {
594 assert(0 && "Unknown mismatch!");
594 LLVM_UNREACHABLE("Unknown mismatch!");
595595 }
596596 } else if (PartBits == ValueVT.getSizeInBits()) {
597597 // Different types of the same size.
603603 ValueVT = MVT::getIntegerVT(NumParts * PartBits);
604604 Val = DAG.getNode(ISD::TRUNCATE, dl, ValueVT, Val);
605605 } else {
606 assert(0 && "Unknown mismatch!");
606 LLVM_UNREACHABLE("Unknown mismatch!");
607607 }
608608 }
609609
10721072 case FCmpInst::FCMP_UNE: FOC = ISD::SETNE; FPC = ISD::SETUNE; break;
10731073 case FCmpInst::FCMP_TRUE: FOC = FPC = ISD::SETTRUE; break;
10741074 default:
1075 assert(0 && "Invalid FCmp predicate opcode!");
1075 LLVM_UNREACHABLE("Invalid FCmp predicate opcode!");
10761076 FOC = FPC = ISD::SETFALSE;
10771077 break;
10781078 }
10981098 case ICmpInst::ICMP_SGT: return ISD::SETGT;
10991099 case ICmpInst::ICMP_UGT: return ISD::SETUGT;
11001100 default:
1101 assert(0 && "Invalid ICmp predicate opcode!");
1101 LLVM_UNREACHABLE("Invalid ICmp predicate opcode!");
11021102 return ISD::SETNE;
11031103 }
11041104 }
11301130 Condition = getFCmpCondCode(FC->getPredicate());
11311131 } else {
11321132 Condition = ISD::SETEQ; // silence warning.
1133 assert(0 && "Unknown compare instruction");
1133 LLVM_UNREACHABLE("Unknown compare instruction");
11341134 }
11351135
11361136 CaseBlock CB(Condition, BOp->getOperand(0),
42624262
42634263 case Intrinsic::gcread:
42644264 case Intrinsic::gcwrite:
4265 assert(0 && "GC failed to lower gcread/gcwrite intrinsics!");
4265 LLVM_UNREACHABLE("GC failed to lower gcread/gcwrite intrinsics!");
42664266 return 0;
42674267
42684268 case Intrinsic::flt_rounds: {
2222 #include "llvm/CodeGen/SelectionDAGNodes.h"
2323 #include "llvm/CodeGen/ValueTypes.h"
2424 #include "llvm/Support/CallSite.h"
25 #include "llvm/Support/ErrorHandling.h"
2526 #include "llvm/Target/TargetMachine.h"
2627 #include
2728 #include
534535 void visitVACopy(CallInst &I);
535536
536537 void visitUserOp1(Instruction &I) {
537 assert(0 && "UserOp1 should not exist at instruction selection time!");
538 abort();
538 LLVM_UNREACHABLE("UserOp1 should not exist at instruction selection time!");
539539 }
540540 void visitUserOp2(Instruction &I) {
541 assert(0 && "UserOp2 should not exist at instruction selection time!");
542 abort();
541 LLVM_UNREACHABLE("UserOp2 should not exist at instruction selection time!");
543542 }
544543
545544 const char *implVisitBinaryAtomic(CallInst& I, ISD::NodeType Op);
831831 BI->dump();
832832 }
833833 if (EnableFastISelAbort)
834 assert(0 && "FastISel didn't handle a PHI in a successor");
834 LLVM_UNREACHABLE("FastISel didn't handle a PHI in a successor");
835835 break;
836836 }
837837
2222 #include "llvm/CodeGen/SelectionDAG.h"
2323 #include "llvm/ADT/StringExtras.h"
2424 #include "llvm/ADT/STLExtras.h"
25 #include "llvm/Support/ErrorHandling.h"
2526 #include "llvm/Support/MathExtras.h"
2627 using namespace llvm;
2728
18391840 if (CFP->getValueAPF().isNaN()) {
18401841 // If an operand is known to be a nan, we can fold it.
18411842 switch (ISD::getUnorderedFlavor(Cond)) {
1842 default: assert(0 && "Unknown flavor!");
1843 default: LLVM_UNREACHABLE("Unknown flavor!");
18431844 case 0: // Known false.
18441845 return DAG.getConstant(0, VT);
18451846 case 1: // Known true.
19992000 SDValue Temp;
20002001 if (N0.getValueType() == MVT::i1 && foldBooleans) {
20012002 switch (Cond) {
2002 default: assert(0 && "Unknown integer setcc!");
2003 default: LLVM_UNREACHABLE("Unknown integer setcc!");
20032004 case ISD::SETEQ: // X == Y -> ~(X^Y)
20042005 Temp = DAG.getNode(ISD::XOR, dl, MVT::i1, N0, N1);
20052006 N0 = DAG.getNOT(dl, Temp, MVT::i1);
23092310 /// is.
23102311 static unsigned getConstraintGenerality(TargetLowering::ConstraintType CT) {
23112312 switch (CT) {
2312 default: assert(0 && "Unknown constraint type!");
2313 default: LLVM_UNREACHABLE("Unknown constraint type!");
23132314 case TargetLowering::C_Other:
23142315 case TargetLowering::C_Unknown:
23152316 return 0;
2727 #include "llvm/Target/TargetOptions.h"
2828 #include "llvm/Support/CommandLine.h"
2929 #include "llvm/Support/Debug.h"
30 #include "llvm/Support/ErrorHandling.h"
3031 #include "llvm/ADT/SmallSet.h"
3132 #include "llvm/ADT/Statistic.h"
3233 #include "llvm/ADT/STLExtras.h"
13321333 DstSubIdx = CopyMI->getOperand(3).getImm();
13331334 SrcReg = CopyMI->getOperand(2).getReg();
13341335 } else if (!tii_->isMoveInstr(*CopyMI, SrcReg, DstReg, SrcSubIdx, DstSubIdx)){
1335 assert(0 && "Unrecognized copy instruction!");
1336 return false;
1336 LLVM_UNREACHABLE("Unrecognized copy instruction!");
13371337 }
13381338
13391339 // If they are already joined we continue.
20502050 *tri_->getSuperRegisters(LHS.reg))
20512051 // Imprecise sub-register information. Can't handle it.
20522052 return false;
2053 assert(0 && "No copies from the RHS?");
2053 LLVM_UNREACHABLE("No copies from the RHS?");
20542054 } else {
20552055 LHSValNo = EliminatedLHSVals[0];
20562056 }
99 #define DEBUG_TYPE "virtregrewriter"
1010 #include "VirtRegRewriter.h"
1111 #include "llvm/Support/Compiler.h"
12 #include "llvm/Support/ErrorHandling.h"
1213 #include "llvm/ADT/DepthFirstIterator.h"
1314 #include "llvm/ADT/Statistic.h"
1415 #include "llvm/ADT/STLExtras.h"
998999 // Unfold current MI.
9991000 SmallVector NewMIs;
10001001 if (!TII->unfoldMemoryOperand(MF, &MI, VirtReg, false, false, NewMIs))
1001 assert(0 && "Unable unfold the load / store folding instruction!");
1002 LLVM_UNREACHABLE("Unable unfold the load / store folding instruction!");
10021003 assert(NewMIs.size() == 1);
10031004 AssignPhysToVirtReg(NewMIs[0], VirtReg, PhysReg);
10041005 VRM.transferRestorePts(&MI, NewMIs[0]);
10141015 NextMII = next(NextMII);
10151016 NewMIs.clear();
10161017 if (!TII->unfoldMemoryOperand(MF, &NextMI, VirtReg, false, false, NewMIs))
1017 assert(0 && "Unable unfold the load / store folding instruction!");
1018 LLVM_UNREACHABLE("Unable unfold the load / store folding instruction!");
10181019 assert(NewMIs.size() == 1);
10191020 AssignPhysToVirtReg(NewMIs[0], VirtReg, PhysReg);
10201021 VRM.transferRestorePts(&NextMI, NewMIs[0]);
14501451 assert(RC && "Unable to determine register class!");
14511452 int SS = VRM.getEmergencySpillSlot(RC);
14521453 if (UsedSS.count(SS))
1453 assert(0 && "Need to spill more than one physical registers!");
1454 LLVM_UNREACHABLE("Need to spill more than one physical registers!");
14541455 UsedSS.insert(SS);
14551456 TII->storeRegToStackSlot(MBB, MII, PhysReg, true, SS, RC);
14561457 MachineInstr *StoreMI = prior(MII);
21752176
21762177 llvm::VirtRegRewriter* llvm::createVirtRegRewriter() {
21772178 switch (RewriterOpt) {
2178 default: assert(0 && "Unreachable!");
2179 default: LLVM_UNREACHABLE("Unreachable!");
21792180 case local:
21802181 return new LocalRewriter();
21812182 case trivial:
420420 const_cast(dyn_cast(GV)))
421421 EmitGlobalVariable(GVar);
422422 else
423 assert(0 && "Global hasn't had an address allocated yet!");
423 LLVM_UNREACHABLE("Global hasn't had an address allocated yet!");
424424 return state.getGlobalAddressMap(locked)[GV];
425425 }
426426
547547 GenericValue GV = getConstantValue(Op0);
548548 const Type* DestTy = CE->getType();
549549 switch (Op0->getType()->getTypeID()) {
550 default: assert(0 && "Invalid bitcast operand");
550 default: LLVM_UNREACHABLE("Invalid bitcast operand");
551551 case Type::IntegerTyID:
552552 assert(DestTy->isFloatingPoint() && "invalid bitcast");
553553 if (DestTy == Type::FloatTy)
589589 default: LLVM_UNREACHABLE("Bad add type!");
590590 case Type::IntegerTyID:
591591 switch (CE->getOpcode()) {
592 default: assert(0 && "Invalid integer opcode");
592 default: LLVM_UNREACHABLE("Invalid integer opcode");
593593 case Instruction::Add: GV.IntVal = LHS.IntVal + RHS.IntVal; break;
594594 case Instruction::Sub: GV.IntVal = LHS.IntVal - RHS.IntVal; break;
595595 case Instruction::Mul: GV.IntVal = LHS.IntVal * RHS.IntVal; break;
637637 case Type::FP128TyID: {
638638 APFloat apfLHS = APFloat(LHS.IntVal);
639639 switch (CE->getOpcode()) {
640 default: assert(0 && "Invalid long double opcode");llvm_unreachable();
640 default: LLVM_UNREACHABLE("Invalid long double opcode");llvm_unreachable();
641641 case Instruction::FAdd:
642642 apfLHS.add(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven);
643643 GV.IntVal = apfLHS.bitcastToAPInt();
697697 else if (const GlobalVariable* GV = dyn_cast(C))
698698 Result = PTOGV(getOrEmitGlobalVariable(const_cast(GV)));
699699 else
700 assert(0 && "Unknown constant pointer type!");
700 LLVM_UNREACHABLE("Unknown constant pointer type!");
701701 break;
702702 default:
703703 std::string msg;
880880 }
881881
882882 cerr << "Bad Type: " << *Init->getType() << "\n";
883 assert(0 && "Unknown constant type to initialize memory with!");
883 LLVM_UNREACHABLE("Unknown constant type to initialize memory with!");
884884 }
885885
886886 /// EmitGlobals - Emit all of the global variables to memory, storing their
1414 #include "llvm-c/ExecutionEngine.h"
1515 #include "llvm/ExecutionEngine/GenericValue.h"
1616 #include "llvm/ExecutionEngine/ExecutionEngine.h"
17 #include "llvm/Support/ErrorHandling.h"
1718 #include
1819
1920 using namespace llvm;
4445 GenVal->DoubleVal = N;
4546 break;
4647 default:
47 assert(0 && "LLVMGenericValueToFloat supports only float and double.");
48 break;
48 LLVM_UNREACHABLE("LLVMGenericValueToFloat supports only float and double.");
4949 }
5050 return wrap(GenVal);
5151 }
7474 case Type::DoubleTyID:
7575 return unwrap(GenVal)->DoubleVal;
7676 default:
77 assert(0 && "LLVMGenericValueToFloat supports only float and double.");
77 LLVM_UNREACHABLE("LLVMGenericValueToFloat supports only float and double.");
7878 break;
7979 }
8080 return 0; // Not reached
10781078 } else if (SrcTy->isInteger()) {
10791079 Dest.IntVal = Src.IntVal;
10801080 } else
1081 assert(0 && "Invalid BitCast");
1081 LLVM_UNREACHABLE("Invalid BitCast");
10821082 } else if (DstTy == Type::FloatTy) {
10831083 if (SrcTy->isInteger())
10841084 Dest.FloatVal = Src.IntVal.bitsToFloat();
10901090 else
10911091 Dest.DoubleVal = Src.DoubleVal;
10921092 } else
1093 assert(0 && "Invalid Bitcast");
1093 LLVM_UNREACHABLE("Invalid Bitcast");
10941094
10951095 return Dest;
10961096 }
13441344 DOUT << " --> ";
13451345 const GenericValue &Val = SF.Values[&I];
13461346 switch (I.getType()->getTypeID()) {
1347 default: assert(0 && "Invalid GenericValue Type");
1347 default: LLVM_UNREACHABLE("Invalid GenericValue Type");
13481348 case Type::VoidTyID: DOUT << "void"; break;
13491349 case Type::FloatTyID: DOUT << "float " << Val.FloatVal; break;
13501350 case Type::DoubleTyID: DOUT << "double " << Val.DoubleVal; break;
2020 #include "llvm/Support/CallSite.h"
2121 #include "llvm/Target/TargetData.h"
2222 #include "llvm/Support/DataTypes.h"
23 #include "llvm/Support/ErrorHandling.h"
2324
2425 namespace llvm {
2526
144145 void visitLoadInst(LoadInst &I);
145146 void visitStoreInst(StoreInst &I);
146147 void visitGetElementPtrInst(GetElementPtrInst &I);
147 void visitPHINode(PHINode &PN) { assert(0 && "PHI nodes already handled!"); }
148 void visitPHINode(PHINode &PN) {
149 LLVM_UNREACHABLE("PHI nodes already handled!");
150 }
148151 void visitTruncInst(TruncInst &I);
149152 void visitZExtInst(ZExtInst &I);
150153 void visitSExtInst(SExtInst &I);
173176 void visitVAArgInst(VAArgInst &I);
174177 void visitInstruction(Instruction &I) {
175178 cerr << I;
176 assert(0 && "Instruction not interpretable yet!");
179 LLVM_UNREACHABLE("Instruction not interpretable yet!");
177180 }
178181
179182 GenericValue callExternalFunction(Function *F,
409409 if (ArgValues.empty()) {
410410 GenericValue rv;
411411 switch (RetTy->getTypeID()) {
412 default: assert(0 && "Unknown return type for function call!");
412 default: LLVM_UNREACHABLE("Unknown return type for function call!");
413413 case Type::IntegerTyID: {
414414 unsigned BitWidth = cast(RetTy)->getBitWidth();
415415 if (BitWidth == 1)
423423 else if (BitWidth <= 64)
424424 rv.IntVal = APInt(BitWidth, ((int64_t(*)())(intptr_t)FPtr)());
425425 else
426 assert(0 && "Integer types > 64 bits not supported");
426 LLVM_UNREACHABLE("Integer types > 64 bits not supported");
427427 return rv;
428428 }
429429 case Type::VoidTyID:
438438 case Type::X86_FP80TyID:
439439 case Type::FP128TyID:
440440 case Type::PPC_FP128TyID:
441 assert(0 && "long double not supported yet");
441 LLVM_UNREACHABLE("long double not supported yet");
442442 return rv;
443443 case Type::PointerTyID:
444444 return PTOGV(((void*(*)())(intptr_t)FPtr)());
466466 const Type *ArgTy = FTy->getParamType(i);
467467 const GenericValue &AV = ArgValues[i];
468468 switch (ArgTy->getTypeID()) {
469 default: assert(0 && "Unknown argument type for function call!");
469 default: LLVM_UNREACHABLE("Unknown argument type for function call!");
470470 case Type::IntegerTyID:
471471 C = ConstantInt::get(AV.IntVal);
472472 break;
2020 #include "llvm/CodeGen/MachineLocation.h"
2121 #include "llvm/CodeGen/MachineModuleInfo.h"
2222 #include "llvm/ExecutionEngine/JITMemoryManager.h"
23 #include "llvm/Support/ErrorHandling.h"
2324 #include "llvm/Target/TargetAsmInfo.h"
2425 #include "llvm/Target/TargetData.h"
2526 #include "llvm/Target/TargetInstrInfo.h"
109110
110111 JCE->emitULEB128Bytes(Offset);
111112 } else {
112 assert(0 && "Machine move no supported yet.");
113 LLVM_UNREACHABLE("Machine move no supported yet.");
113114 }
114115 } else if (Src.isReg() &&
115116 Src.getReg() == MachineLocation::VirtualFP) {
117118 JCE->emitByte(dwarf::DW_CFA_def_cfa_register);
118119 JCE->emitULEB128Bytes(RI->getDwarfRegNum(Dst.getReg(), true));
119120 } else {
120 assert(0 && "Machine move no supported yet.");
121 LLVM_UNREACHABLE("Machine move no supported yet.");
121122 }
122123 } else {
123124 unsigned Reg = RI->getDwarfRegNum(Src.getReg(), true);
760761
761762 FinalSize += TargetAsmInfo::getULEB128Size(Offset);
762763 } else {
763 assert(0 && "Machine move no supported yet.");
764 LLVM_UNREACHABLE("Machine move no supported yet.");
764765 }
765766 } else if (Src.isReg() &&
766767 Src.getReg() == MachineLocation::VirtualFP) {
769770 unsigned RegNum = RI->getDwarfRegNum(Dst.getReg(), true);
770771 FinalSize += TargetAsmInfo::getULEB128Size(RegNum);
771772 } else {
772 assert(0 && "Machine move no supported yet.");
773 LLVM_UNREACHABLE("Machine move no supported yet.");
773774 }
774775 } else {
775776 unsigned Reg = RI->getDwarfRegNum(Src.getReg(), true);
1313
1414 #include "llvm/Linker.h"
1515 #include "llvm/Module.h"
16 #include "llvm/Support/ErrorHandling.h"
1617 #include "llvm/Support/MemoryBuffer.h"
1718 #include "llvm/Bitcode/ReaderWriter.h"
1819
7980 std::string Magic;
8081 Pathname.getMagicNumber(Magic, 64);
8182 switch (sys::IdentifyFileType(Magic.c_str(), 64)) {
82 default: assert(0 && "Bad file type identification");
83 default: LLVM_UNREACHABLE("Bad file type identification");
8384 case sys::Unknown_FileType:
8485 return warning("Supposed library '" + Lib + "' isn't a library.");
8586
177178 std::string Magic;
178179 File.getMagicNumber(Magic, 64);
179180 switch (sys::IdentifyFileType(Magic.c_str(), 64)) {
180 default: assert(0 && "Bad file type identification");
181 default: LLVM_UNREACHABLE("Bad file type identification");
181182 case sys::Unknown_FileType:
182183 return warning("Ignoring file '" + File.toString() +
183184 "' because does not contain bitcode.");
2525 #include "llvm/Instructions.h"
2626 #include "llvm/Assembly/Writer.h"
2727 #include "llvm/Support/Streams.h"
28 #include "llvm/Support/ErrorHandling.h"
2829 #include "llvm/System/Path.h"
2930 #include "llvm/ADT/DenseMap.h"
3031 #include
391392 Result = CE->getWithOperands(Ops);
392393 } else {
393394 assert(!isa(CPV) && "Unmapped global?");
394 assert(0 && "Unknown type of derived type constant value!");
395 LLVM_UNREACHABLE("Unknown type of derived type constant value!");
395396 }
396397 } else if (isa(In)) {
397398 Result = const_cast(In);
408409 PrintMap(ValueMap);
409410
410411 cerr << "Couldn't remap value: " << (void*)In << " " << *In << "\n";
411 assert(0 && "Couldn't remap value!");
412 LLVM_UNREACHABLE("Couldn't remap value!");
412413 #endif
413414 return 0;
414415 }
898899 // Nothing is required, mapped values will take the new global
899900 // automatically.
900901 } else if (DGVar->hasAppendingLinkage()) {
901 assert(0 && "Appending linkage unimplemented!");
902 LLVM_UNREACHABLE("Appending linkage unimplemented!");
902903 } else {
903 assert(0 && "Unknown linkage!");
904 LLVM_UNREACHABLE("Unknown linkage!");
904905 }
905906 } else {
906907 // Copy the initializer over now...
1313 #include "llvm/MC/MCSection.h"
1414 #include "llvm/MC/MCSymbol.h"
1515 #include "llvm/MC/MCValue.h"
16 #include "llvm/Support/ErrorHandling.h"
1617 #include "llvm/Support/raw_ostream.h"
18
1719 using namespace llvm;
1820
1921 namespace {
185187 // Need target hooks to know how to print this.
186188 switch (Size) {
187189 default:
188 assert(0 && "Invalid size for machine code value!");
190 LLVM_UNREACHABLE("Invalid size for machine code value!");
189191 case 1: OS << ".byte"; break;
190192 case 2: OS << ".short"; break;
191193 case 4: OS << ".long"; break;
206208
207209 switch (ValueSize) {
208210 default:
209 assert(0 && "Invalid size for machine code value!");
211 LLVM_UNREACHABLE("Invalid size for machine code value!");
210212 case 8:
211 assert(0 && "Unsupported alignment size!");
213 LLVM_UNREACHABLE("Unsupported alignment size!");
212214 case 1: OS << (IsPow2 ? ".p2align" : ".balign"); break;
213215 case 2: OS << (IsPow2 ? ".p2alignw" : ".balignw"); break;
214216 case 4: OS << (IsPow2 ? ".p2alignl" : ".balignl"); break;
1313
1414 #include "llvm/ADT/APFloat.h"
1515 #include "llvm/ADT/FoldingSet.h"
16 #include "llvm/Support/ErrorHandling.h"
1617 #include "llvm/Support/MathExtras.h"
1718 #include
1819
10671068
10681069 switch (rounding_mode) {
10691070 default:
1070 assert(0);
1071 llvm_unreachable();
10711072
10721073 case rmNearestTiesToAway:
10731074 return lost_fraction == lfExactlyHalf || lost_fraction == lfMoreThanHalf;
12061207 {
12071208 switch (convolve(category, rhs.category)) {
12081209 default:
1209 assert(0);
1210 llvm_unreachable();
12101211
12111212 case convolve(fcNaN, fcZero):
12121213 case convolve(fcNaN, fcNormal):
13301331 {
13311332 switch (convolve(category, rhs.category)) {
13321333 default:
1333 assert(0);
1334 llvm_unreachable();
13341335
13351336 case convolve(fcNaN, fcZero):
13361337 case convolve(fcNaN, fcNormal):
13721373 {
13731374 switch (convolve(category, rhs.category)) {
13741375 default:
1375 assert(0);
1376 llvm_unreachable();
13761377
13771378 case convolve(fcNaN, fcZero):
13781379 case convolve(fcNaN, fcNormal):
14141415 {
14151416 switch (convolve(category, rhs.category)) {
14161417 default:
1417 assert(0);
1418 llvm_unreachable();
14181419
14191420 case convolve(fcNaN, fcZero):
14201421 case convolve(fcNaN, fcNormal):
16911692
16921693 switch (convolve(category, rhs.category)) {
16931694 default:
1694 assert(0);
1695 llvm_unreachable();
16951696
16961697 case convolve(fcNaN, fcZero):
16971698 case convolve(fcNaN, fcNormal):
29282929 else if (api.getBitWidth()==128 && !isIEEE)
29292930 return initFromPPCDoubleDoubleAPInt(api);
29302931 else
2931 assert(0);
2932 llvm_unreachable();
29322933 }
29332934
29342935 APFloat::APFloat(const APInt& api, bool isIEEE)
1616 #include "llvm/ADT/FoldingSet.h"
1717 #include "llvm/ADT/SmallString.h"
1818 #include "llvm/Support/Debug.h"
19 #include "llvm/Support/ErrorHandling.h"
1920 #include "llvm/Support/MathExtras.h"
2021 #include "llvm/Support/raw_ostream.h"
2122 #include
13851386 else
13861387 return x_old + 1;
13871388 } else
1388 assert(0 && "Error in APInt::sqrt computation");
1389 LLVM_UNREACHABLE("Error in APInt::sqrt computation");
13891390 return x_old + 1;
13901391 }
13911392
20312032 char cdigit = str[i];
20322033 if (radix == 16) {
20332034 if (!isxdigit(cdigit))
2034 assert(0 && "Invalid hex digit in string");
2035 LLVM_UNREACHABLE("Invalid hex digit in string");
20352036 if (isdigit(cdigit))
20362037 digit = cdigit - '0';
20372038 else if (cdigit >= 'a')
20392040 else if (cdigit >= 'A')
20402041 digit = cdigit - 'A' + 10;
20412042 else
2042 assert(0 && "huh? we shouldn't get here");
2043 LLVM_UNREACHABLE("huh? we shouldn't get here");
20432044 } else if (isdigit(cdigit)) {
20442045 digit = cdigit - '0';
20452046 assert((radix == 10 ||
20472048 (radix == 2 && (digit == 0 || digit == 1))) &&
20482049 "Invalid digit in string for given radix");
20492050 } else {
2050 assert(0 && "Invalid character in digit string");
2051 LLVM_UNREACHABLE("Invalid character in digit string");
20512052 }
20522053
20532054 // Shift or multiply the value by the radix
692692 ValNo++;
693693 break;
694694 default:
695 assert(0 && "Internal error, unexpected NumOccurrences flag in "
695 LLVM_UNREACHABLE("Internal error, unexpected NumOccurrences flag in "
696696 "positional argument processing!");
697697 }
698698 }
1111 //===----------------------------------------------------------------------===//
1212
1313 #include "llvm/Support/Dwarf.h"
14 #include "llvm/Support/ErrorHandling.h"
1415
1516 #include
1617
8283 case DW_TAG_lo_user: return "DW_TAG_lo_user";
8384 case DW_TAG_hi_user: return "DW_TAG_hi_user";
8485 }
85 assert(0 && "Unknown Dwarf Tag");
86 LLVM_UNREACHABLE("Unknown Dwarf Tag");
8687 return "";
8788 }
8889
9394 case DW_CHILDREN_no: return "CHILDREN_no";
9495 case DW_CHILDREN_yes: return "CHILDREN_yes";
9596 }
96 assert(0 && "Unknown Dwarf ChildrenFlag");
97 LLVM_UNREACHABLE("Unknown Dwarf ChildrenFlag");
9798 return "";
9899 }
99100
204205 case DW_AT_APPLE_major_runtime_vers: return "DW_AT_APPLE_major_runtime_vers";
205206 case DW_AT_APPLE_runtime_class: return "DW_AT_APPLE_runtime_class";
206207 }
207 assert(0 && "Unknown Dwarf Attribute");
208 LLVM_UNREACHABLE("Unknown Dwarf Attribute");
208209 return "";
209210 }
210211
234235 case DW_FORM_ref_udata: return "FORM_ref_udata";
235236 case DW_FORM_indirect: return "FORM_indirect";
236237 }
237 assert(0 && "Unknown Dwarf Form Encoding");
238 LLVM_UNREACHABLE("Unknown Dwarf Form Encoding");
238239 return "";
239240 }
240241
309310 case DW_OP_lo_user: return "OP_lo_user";
310311 case DW_OP_hi_user: return "OP_hi_user";
311312 }
312 assert(0 && "Unknown Dwarf Operation Encoding");
313 LLVM_UNREACHABLE("Unknown Dwarf Operation Encoding");
313314 return "";
314315 }
315316
335336 case DW_ATE_lo_user: return "ATE_lo_user";
336337 case DW_ATE_hi_user: return "ATE_hi_user";
337338 }
338 assert(0 && "Unknown Dwarf Attribute Encoding");
339 LLVM_UNREACHABLE("Unknown Dwarf Attribute Encoding");
339340 return "";
340341 }
341342
349350 case DW_DS_leading_separate: return "DS_leading_separate";
350351 case DW_DS_trailing_separate: return "DS_trailing_separate";
351352 }
352 assert(0 && "Unknown Dwarf Decimal Sign Attribute");
353 LLVM_UNREACHABLE("Unknown Dwarf Decimal Sign Attribute");
353354 return "";
354355 }
355356
363364 case DW_END_lo_user: return "END_lo_user";
364365 case DW_END_hi_user: return "END_hi_user";
365366 }
366 assert(0 && "Unknown Dwarf Endianity");
367 LLVM_UNREACHABLE("Unknown Dwarf Endianity");
367368 return "";
368369 }
369370
376377 case DW_ACCESS_protected: return "ACCESS_protected";
377378 case DW_ACCESS_private: return "ACCESS_private";
378379 }
379 assert(0 && "Unknown Dwarf Accessibility");
380 LLVM_UNREACHABLE("Unknown Dwarf Accessibility");
380381 return "";
381382 }
382383
388389 case DW_VIS_exported: return "VIS_exported";
389390 case DW_VIS_qualified: return "VIS_qualified";
390391 }
391 assert(0 && "Unknown Dwarf Visibility");
392 LLVM_UNREACHABLE("Unknown Dwarf Visibility");
392393 return "";
393394 }
394395
400401 case DW_VIRTUALITY_virtual: return "VIRTUALITY_virtual";
401402 case DW_VIRTUALITY_pure_virtual: return "VIRTUALITY_pure_virtual";
402403 }
403 assert(0 && "Unknown Dwarf Virtuality");
404 LLVM_UNREACHABLE("Unknown Dwarf Virtuality");
404405 return "";
405406 }
406407
430431 case DW_LANG_lo_user: return "LANG_lo_user";
431432 case DW_LANG_hi_user: return "LANG_hi_user";
432433 }
433 assert(0 && "Unknown Dwarf Language");
434 LLVM_UNREACHABLE("Unknown Dwarf Language");
434435 return "";
435436 }
436437
443444 case DW_ID_down_case: return "ID_down_case";
444445 case DW_ID_case_insensitive: return "ID_case_insensitive";
445446 }
446 assert(0 && "Unknown Dwarf Identifier Case");
447 LLVM_UNREACHABLE("Unknown Dwarf Identifier Case");
447448 return "";
448449 }
449450
457458 case DW_CC_lo_user: return "CC_lo_user";
458459 case DW_CC_hi_user: return "CC_hi_user";
459460 }
460 assert(0 && "Unknown Dwarf Calling Convention");
461 LLVM_UNREACHABLE("Unknown Dwarf Calling Convention");
461462 return "";
462463 }
463464
470471 case DW_INL_declared_not_inlined: return "INL_declared_not_inlined";
471472 case DW_INL_declared_inlined: return "INL_declared_inlined";
472473 }
473 assert(0 && "Unknown Dwarf Inline Code");
474 LLVM_UNREACHABLE("Unknown Dwarf Inline Code");
474475 return "";
475476 }
476477
481482 case DW_ORD_row_major: return "ORD_row_major";
482483 case DW_ORD_col_major: return "ORD_col_major";
483484 }
484 assert(0 && "Unknown Dwarf Array Order");
485 LLVM_UNREACHABLE("Unknown Dwarf Array Order");
485486 return "";
486487 }
487488
492493 case DW_DSC_label: return "DSC_label";
493494 case DW_DSC_range: return "DSC_range";
494495 }
495 assert(0 && "Unknown Dwarf Discriminant Descriptor");
496 LLVM_UNREACHABLE("Unknown Dwarf Discriminant Descriptor");
496497 return "";
497498 }
498499
513514 case DW_LNS_set_epilogue_begin: return "LNS_set_epilogue_begin";
514515 case DW_LNS_set_isa: return "LNS_set_isa";
515516 }
516 assert(0 && "Unknown Dwarf Line Number Standard");
517 LLVM_UNREACHABLE("Unknown Dwarf Line Number Standard");
517518 return "";
518519 }
519520
528529 case DW_LNE_lo_user: return "LNE_lo_user";
529530 case DW_LNE_hi_user: return "LNE_hi_user";
530531 }
531 assert(0 && "Unknown Dwarf Line Number Extended Opcode Encoding");
532 LLVM_UNREACHABLE("Unknown Dwarf Line Number Extended Opcode Encoding");
532533 return "";
533534 }
534535
543544 case DW_MACINFO_end_file: return "MACINFO_end_file";
544545 case DW_MACINFO_vendor_ext: return "MACINFO_vendor_ext";
545546 }
546 assert(0 && "Unknown Dwarf Macinfo Type Encodings");
547 LLVM_UNREACHABLE("Unknown Dwarf Macinfo Type Encodings");
547548 return "";
548549 }
549550
579580 case DW_CFA_lo_user: return "CFA_lo_user";
580581 case DW_CFA_hi_user: return "CFA_hi_user";
581582 }
582 assert(0 && "Unknown Dwarf Call Frame Instruction Encodings");
583 LLVM_UNREACHABLE("Unknown Dwarf Call Frame Instruction Encodings");
583584 return "";
584585 }
585586
4343 exit(1);
4444 }
4545
46 void llvm_unreachable(void) {
46 void llvm_unreachable(const char *msg) {
47 if (msg)
48 errs() << msg << "\n";
4749 abort();
4850 }
4951 }
1414 //===----------------------------------------------------------------------===//
1515
1616 #include "llvm/ADT/FoldingSet.h"
17 #include "llvm/Support/ErrorHandling.h"
1718 #include "llvm/Support/MathExtras.h"
1819 #include
1920 #include
4950 else if (sizeof(long) == sizeof(long long)) {
5051 AddInteger((unsigned long long)I);
5152 } else {
52 assert(0 && "unexpected sizeof(long)");
53 LLVM_UNREACHABLE("unexpected sizeof(long)");
5354 }
5455 }
5556 void FoldingSetNodeID::AddInteger(long long I) {
1414 #ifndef TARGET_ARM_H
1515 #define TARGET_ARM_H
1616
17 #include "llvm/Support/ErrorHandling.h"
1718 #include "llvm/Target/TargetMachine.h"
1819 #include
1920
5051
5152 inline static CondCodes getOppositeCondition(CondCodes CC){
5253 switch (CC) {
53 default: assert(0 && "Unknown condition code");
54 default: LLVM_UNREACHABLE("Unknown condition code");
5455 case EQ: return NE;
5556 case NE: return EQ;
5657 case HS: return LO;
7172
7273 inline static const char *ARMCondCodeToString(ARMCC::CondCodes CC) {
7374 switch (CC) {
74 default: assert(0 && "Unknown condition code");
75 default: LLVM_UNREACHABLE("Unknown condition code");
7576 case ARMCC::EQ: return "eq";
7677 case ARMCC::NE: return "ne";
7778 case ARMCC::HS: return "hs";
1414 #define LLVM_TARGET_ARM_ARMADDRESSINGMODES_H
1515
1616 #include "llvm/CodeGen/SelectionDAGNodes.h"
17 #include "llvm/Support/ErrorHandling.h"
1718 #include "llvm/Support/MathExtras.h"
1819 #include
1920
3637
3738 static inline const char *getShiftOpcStr(ShiftOpc Op) {
3839 switch (Op) {
39 default: assert(0 && "Unknown shift opc!");
40 default: LLVM_UNREACHABLE("Unknown shift opc!");
4041 case ARM_AM::asr: return "asr";
4142 case ARM_AM::lsl: return "lsl";
4243 case ARM_AM::lsr: return "lsr";
6970
7071 static inline const char *getAMSubModeStr(AMSubMode Mode) {
7172 switch (Mode) {
72 default: assert(0 && "Unknown addressing sub-mode!");
73 default: LLVM_UNREACHABLE("Unknown addressing sub-mode!");
7374 case ARM_AM::ia: return "ia";
7475 case ARM_AM::ib: return "ib";
7576 case ARM_AM::da: return "da";
7980
8081 static inline const char *getAMSubModeAltStr(AMSubMode Mode, bool isLD) {
8182 switch (Mode) {
82 default: assert(0 && "Unknown addressing sub-mode!");
83 default: LLVM_UNREACHABLE("Unknown addressing sub-mode!");
8384 case ARM_AM::ia: return isLD ? "fd" : "ea";
8485 case ARM_AM::ib: return isLD ? "ed" : "fa";
8586 case ARM_AM::da: return isLD ? "fa" : "ed";
2222 #include "llvm/CodeGen/MachineJumpTableInfo.h"
2323 #include "llvm/Target/TargetAsmInfo.h"
2424 #include "llvm/Support/CommandLine.h"
25 #include "llvm/Support/ErrorHandling.h"
2526 using namespace llvm;
2627
2728 static cl::opt
432433 return 0;
433434 switch (MI->getOpcode()) {
434435 default:
435 assert(0 && "Unknown or unset size field for instr!");
436 break;
436 LLVM_UNREACHABLE("Unknown or unset size field for instr!");
437437 case TargetInstrInfo::IMPLICIT_DEF:
438438 case TargetInstrInfo::DECLARE:
439439 case TargetInstrInfo::DBG_LABEL:
706706 }
707707
708708 unsigned ARMBaseRegisterInfo::getEHExceptionRegister() const {
709 assert(0 && "What is the exception register");
709 LLVM_UNREACHABLE("What is the exception register");
710710 return 0;
711711 }
712712
713713 unsigned ARMBaseRegisterInfo::getEHHandlerRegister() const {
714 assert(0 && "What is the exception handler register");
714 LLVM_UNREACHABLE("What is the exception handler register");
715715 return 0;
716716 }
717717
2323 #include "llvm/Target/TargetMachine.h"
2424 #include "llvm/Support/Compiler.h"
2525 #include "llvm/Support/Debug.h"
26 #include "llvm/Support/ErrorHandling.h"
2627 #include "llvm/ADT/SmallVector.h"
2728 #include "llvm/ADT/STLExtras.h"
2829 #include "llvm/ADT/Statistic.h"
447448 Bits = 8; // Taking the address of a CP entry.
448449 break;
449450 }
450 assert(0 && "Unknown addressing mode for CP reference!");
451 LLVM_UNREACHABLE("Unknown addressing mode for CP reference!");
451452 case ARMII::AddrMode1: // AM1: 8 bits << 2
452453 Bits = 8;
453454 Scale = 4; // Taking the address of a CP entry.
469469 /// IntCCToARMCC - Convert a DAG integer condition code to an ARM CC
470470 static ARMCC::CondCodes IntCCToARMCC(ISD::CondCode CC) {
471471 switch (CC) {
472 default: assert(0 && "Unknown condition code!");
472 default: LLVM_UNREACHABLE("Unknown condition code!");
473473 case ISD::SETNE: return ARMCC::NE;
474474 case ISD::SETEQ: return ARMCC::EQ;
475475 case ISD::SETGT: return ARMCC::GT;
491491 bool Invert = false;
492492 CondCode2 = ARMCC::AL;
493493 switch (CC) {
494 default: assert(0 && "Unknown FP condition!");
494 default: LLVM_UNREACHABLE("Unknown FP condition!");
495495 case ISD::SETEQ:
496496 case ISD::SETOEQ: CondCode = ARMCC::EQ; break;
497497 case ISD::SETGT:
660660 bool Return) const {
661661 switch (CC) {
662662 default:
663 assert(0 && "Unsupported calling convention");
663 LLVM_UNREACHABLE("Unsupported calling convention");
664664 case CallingConv::C:
665665 case CallingConv::Fast:
666666 // Use target triple & subtarget features to do actual dispatch.
744744 }
745745
746746 switch (VA.getLocInfo()) {
747 default: assert(0 && "Unknown loc info!");
747 default: LLVM_UNREACHABLE("Unknown loc info!");
748748 case CCValAssign::Full: break;
749749 case CCValAssign::BCvt:
750750 Val = DAG.getNode(ISD::BIT_CONVERT, dl, VA.getValVT(), Val);
857857
858858 // Promote the value if needed.
859859 switch (VA.getLocInfo()) {
860 default: assert(0 && "Unknown loc info!");
860 default: LLVM_UNREACHABLE("Unknown loc info!");
861861 case CCValAssign::Full: break;
862862 case CCValAssign::SExt:
863863 Arg = DAG.getNode(ISD::SIGN_EXTEND, dl, VA.getLocVT(), Arg);
10591059 SDValue Arg = Op.getOperand(realRVLocIdx*2+1);
10601060
10611061 switch (VA.getLocInfo()) {
1062 default: assert(0 && "Unknown loc info!");
1062 default: LLVM_UNREACHABLE("Unknown loc info!");
10631063 case CCValAssign::Full: break;
10641064 case CCValAssign::BCvt:
10651065 Arg = DAG.getNode(ISD::BIT_CONVERT, dl, VA.getLocVT(), Arg);
14411441 // to 32 bits. Insert an assert[sz]ext to capture this, then
14421442 // truncate to the right size.
14431443 switch (VA.getLocInfo()) {
1444 default: assert(0 && "Unknown loc info!");
1444 default: LLVM_UNREACHABLE("Unknown loc info!");
14451445 case CCValAssign::Full: break;
14461446 case CCValAssign::BCvt:
14471447 ArgValue = DAG.getNode(ISD::BIT_CONVERT, dl, VA.getValVT(), ArgValue);
20052005
20062006 if (Op.getOperand(1).getValueType().isFloatingPoint()) {
20072007 switch (SetCCOpcode) {
2008 default: assert(0 && "Illegal FP comparison"); break;
2008 default: LLVM_UNREACHABLE("Illegal FP comparison"); break;
20092009 case ISD::SETUNE:
20102010 case ISD::SETNE: Invert = true; // Fallthrough
20112011 case ISD::SETOEQ:
20442044 } else {
20452045 // Integer comparisons.
20462046 switch (SetCCOpcode) {
2047 default: assert(0 && "Illegal integer comparison"); break;
2047 default: LLVM_UNREACHABLE("Illegal integer comparison"); break;
20482048 case ISD::SETNE: Invert = true;
20492049 case ISD::SETEQ: Opc = ARMISD::VCEQ; break;
20502050 case ISD::SETLT: Swap = true;
21482148 }
21492149
21502150 default:
2151 assert(0 && "unexpected size for isVMOVSplat");
2151 LLVM_UNREACHABLE("unexpected size for isVMOVSplat");
21522152 break;
21532153 }
21542154
21902190 case 16: CanonicalVT = MVT::v4i16; break;
21912191 case 32: CanonicalVT = MVT::v2i32; break;
21922192 case 64: CanonicalVT = MVT::v1i64; break;
2193 default: assert(0 && "unexpected splat element type"); break;
2193 default: LLVM_UNREACHABLE("unexpected splat element type"); break;
21942194 }
21952195 } else {
21962196 assert(VT.is128BitVector() && "unknown splat vector size");
21992199 case 16: CanonicalVT = MVT::v8i16; break;
22002200 case 32: CanonicalVT = MVT::v4i32; break;
22012201 case 64: CanonicalVT = MVT::v2i64; break;
2202 default: assert(0 && "unexpected splat element type"); break;
2202 default: LLVM_UNREACHABLE("unexpected splat element type"); break;
22032203 }
22042204 }
22052205
23022302 SelectionDAG &DAG) {
23032303 switch (N->getOpcode()) {
23042304 default:
2305 assert(0 && "Don't know how to custom expand this!");
2305 LLVM_UNREACHABLE("Don't know how to custom expand this!");
23062306 return;
23072307 case ISD::BIT_CONVERT:
23082308 Results.push_back(ExpandBIT_CONVERT(N, DAG));
26272627 LLVM_UNREACHABLE("invalid shift count for narrowing vector shift intrinsic");
26282628
26292629 default:
2630 assert(0 && "unhandled vector shift");
2630 LLVM_UNREACHABLE("unhandled vector shift");
26312631 }
26322632
26332633 switch (IntNo) {
27192719 int64_t Cnt;
27202720
27212721 switch (N->getOpcode()) {
2722 default: assert(0 && "unexpected shift opcode");
2722 default: LLVM_UNREACHABLE("unexpected shift opcode");
27232723
27242724 case ISD::SHL:
27252725 if (isVShiftLImm(N->getOperand(1), VT, false, Cnt))
27622762
27632763 unsigned Opc = 0;
27642764 switch (N->getOpcode()) {
2765 default: assert(0 && "unexpected opcode");
2765 default: LLVM_UNREACHABLE("unexpected opcode");
27662766 case ISD::SIGN_EXTEND:
27672767 Opc = ARMISD::VGETLANEs;
27682768 break;
337337 bool rev = false;
338338 bool inv = false;
339339 switch(CC) {
340 default: DEBUG(N->dump(CurDAG)); assert(0 && "Unknown FP comparison!");
340 default: DEBUG(N->dump(CurDAG)); LLVM_UNREACHABLE("Unknown FP comparison!");
341341 case ISD::SETEQ: case ISD::SETOEQ: case ISD::SETUEQ:
342342 Opc = Alpha::CMPTEQ; break;
343343 case ISD::SETLT: case ISD::SETOLT: case ISD::SETULT:
471471 } else if (TypeOperands[i] == MVT::f64) {
472472 Opc = Alpha::STT;
473473 } else
474 assert(0 && "Unknown operand");
474 LLVM_UNREACHABLE("Unknown operand");
475475
476476 SDValue Ops[] = { CallOperands[i], getI64Imm((i - 6) * 8),
477477 CurDAG->getCopyFromReg(Chain, dl, Alpha::R30, MVT::i64),
488488 CallOperands[i], InFlag);
489489 InFlag = Chain.getValue(1);
490490 } else
491 assert(0 && "Unknown operand");
491 LLVM_UNREACHABLE("Unknown operand");
492492 }
493493
494494 // Finally, once everything is in registers to pass to the call, emit the
511511 std::vector CallResults;
512512
513513 switch (N->getValueType(0).getSimpleVT()) {
514 default: assert(0 && "Unexpected ret value!");
514 default: LLVM_UNREACHABLE("Unexpected ret value!");
515515 case MVT::Other: break;
516516 case MVT::i64:
517517 Chain = CurDAG->getCopyFromReg(Chain, dl,
379379 for (unsigned i = 0, e = Args.size(); i != e; ++i)
380380 {
381381 switch (getValueType(Args[i].Ty).getSimpleVT()) {
382 default: assert(0 && "Unexpected ValueType for argument!");
382 default: LLVM_UNREACHABLE("Unexpected ValueType for argument!");
383383 case MVT::i1:
384384 case MVT::i8:
385385 case MVT::i16:
475475 SDValue AlphaTargetLowering::LowerOperation(SDValue Op, SelectionDAG &DAG) {
476476 DebugLoc dl = Op.getDebugLoc();
477477 switch (Op.getOpcode()) {
478 default: assert(0 && "Wasn't expecting to be able to lower this!");
478 default: LLVM_UNREACHABLE("Wasn't expecting to be able to lower this!");
479479 case ISD::FORMAL_ARGUMENTS: return LowerFORMAL_ARGUMENTS(Op, DAG,
480480 VarArgsBase,
481481 VarArgsOffset);
526526 return Lo;
527527 }
528528 case ISD::GlobalTLSAddress:
529 assert(0 && "TLS not implemented for Alpha.");
529 LLVM_UNREACHABLE("TLS not implemented for Alpha.");
530530 case ISD::GlobalAddress: {
531531 GlobalAddressSDNode *GSDN = cast(Op);
532532 GlobalValue *GV = GSDN->getGlobal();
331331 case Alpha::FBLE: return Alpha::FBGT;
332332 case Alpha::FBLT: return Alpha::FBGE;
333333 default:
334 assert(0 && "Unknown opcode");
334 LLVM_UNREACHABLE("Unknown opcode");
335335 }
336336 return 0; // Not reached
337337 }
7171
7272 void AlphaJITInfo::replaceMachineCodeForFunction(void *Old, void *New) {
7373 //FIXME
74 assert(0);
74 llvm_unreachable();
7575 }
7676
7777 static TargetJITInfo::JITCompilerFn JITCompilerFunction;
240240 long idx = 0;
241241 bool doCommon = true;
242242 switch ((Alpha::RelocationType)MR->getRelocationType()) {
243 default: assert(0 && "Unknown relocation type!");
243 default: LLVM_UNREACHABLE("Unknown relocation type!");
244244 case Alpha::reloc_literal:
245245 //This is a LDQl
246246 idx = MR->getGOTIndex();
280280 DOUT << "LDA: " << idx << "\n";
281281 break;
282282 default:
283 assert(0 && "Cannot handle gpdist yet");
283 LLVM_UNREACHABLE("Cannot handle gpdist yet");
284284 }
285285 break;
286286 case Alpha::reloc_bsr: {
306306 }
307307
308308 unsigned AlphaRegisterInfo::getRARegister() const {
309 assert(0 && "What is the return address register");
309 LLVM_UNREACHABLE("What is the return address register");
310310 return 0;
311311 }
312312
315315 }
316316
317317 unsigned AlphaRegisterInfo::getEHExceptionRegister() const {
318 assert(0 && "What is the exception register");
318 LLVM_UNREACHABLE("What is the exception register");
319319 return 0;
320320 }
321321
322322 unsigned AlphaRegisterInfo::getEHHandlerRegister() const {
323 assert(0 && "What is the exception handler register");
323 LLVM_UNREACHABLE("What is the exception handler register");
324324 return 0;
325325 }
326326
327327 int AlphaRegisterInfo::getDwarfRegNum(unsigned RegNum, bool isEH) const {
328 assert(0 && "What is the dwarf register number");
328 LLVM_UNREACHABLE("What is the dwarf register number");
329329 return -1;
330330 }
331331
154154
155155 EmitAlignment(MF.getAlignment(), F);
156156 switch (F->getLinkage()) {
157 default: assert(0 && "Unknown linkage type!");
157 default: LLVM_UNREACHABLE( "Unknown linkage type!");
158158 case Function::InternalLinkage: // Symbols default to internal.
159159 case Function::PrivateLinkage:
160160 break;
286286 void visitBranchInst(BranchInst &I);
287287 void visitSwitchInst(SwitchInst &I);
288288 void visitInvokeInst(InvokeInst &I) {
289 assert(0 && "Lowerinvoke pass didn't work!");
289 LLVM_UNREACHABLE("Lowerinvoke pass didn't work!");
290290 }
291291
292292 void visitUnwindInst(UnwindInst &I) {
293 assert(0 && "Lowerinvoke pass didn't work!");
293 LLVM_UNREACHABLE("Lowerinvoke pass didn't work!");
294294 }
295295 void visitUnreachableInst(UnreachableInst &I);
296296
920920 Out << ')';
921921 break;
922922 default:
923 assert(0 && "Invalid cast opcode");
923 LLVM_UNREACHABLE("Invalid cast opcode");
924924 }
925925
926926 // Print the source type cast
950950 case Instruction::FPToUI:
951951 break; // These don't need a source cast.
952952 default:
953 assert(0 && "Invalid cast opcode");
953 LLVM_UNREACHABLE("Invalid cast opcode");
954954 break;
955955 }
956956 }
10591059 case ICmpInst::ICMP_UGT: Out << " > "; break;
10601060 case ICmpInst::ICMP_SGE:
10611061 case ICmpInst::ICMP_UGE: Out << " >= "; break;
1062 default: assert(0 && "Illegal ICmp predicate");
1062 default: LLVM_UNREACHABLE("Illegal ICmp predicate");
10631063 }
10641064 break;
1065 default: assert(0 && "Illegal opcode here!");
1065 default: LLVM_UNREACHABLE("Illegal opcode here!");
10661066 }
10671067 printConstantWithCast(CE->getOperand(1), CE->getOpcode());
10681068 if (NeedsClosingParens)
10801080 else {
10811081 const char* op = 0;
10821082 switch (CE->getPredicate()) {
1083 default: assert(0 && "Illegal FCmp predicate");
1083 default: LLVM_UNREACHABLE("Illegal FCmp predicate");
10841084 case FCmpInst::FCMP_ORD: op = "ord"; break;
10851085 case FCmpInst::FCMP_UNO: op = "uno"; break;
10861086 case FCmpInst::FCMP_UEQ: op = "ueq"; break;
21222122 << "}; /* Long double constant */\n";
21232123
21242124 } else {
2125 assert(0 && "Unknown float type!");
2125 LLVM_UNREACHABLE("Unknown float type!");
21262126 }
21272127 }
21282128
27392739
27402740 const char* op = 0;
27412741 switch (I.getPredicate()) {
2742 default: assert(0 && "Illegal FCmp predicate");
2742 default: LLVM_UNREACHABLE("Illegal FCmp predicate");
27432743 case FCmpInst::FCMP_ORD: op = "ord"; break;
27442744 case FCmpInst::FCMP_UNO: op = "uno"; break;
27452745 case FCmpInst::FCMP_UEQ: op = "ueq"; break;
27672767
27682768 static const char * getFloatBitCastField(const Type *Ty) {
27692769 switch (Ty->getTypeID()) {
2770 default: assert(0 && "Invalid Type");
2770 default: LLVM_UNREACHABLE("Invalid Type");
27712771 case Type::FloatTyID: return "Float";
27722772 case Type::DoubleTyID: return "Double";
27732773 case Type::IntegerTyID: {
31303130 Out << ')';
31313131 // Multiple GCC builtins multiplex onto this intrinsic.
31323132 switch (cast(I.getOperand(3))->getZExtValue()) {
3133 default: assert(0 && "Invalid llvm.x86.sse.cmp!");
3133 default: LLVM_UNREACHABLE("Invalid llvm.x86.sse.cmp!");
31343134 case 0: Out << "__builtin_ia32_cmpeq"; break;
31353135 case 1: Out << "__builtin_ia32_cmplt"; break;
31363136 case 2: Out << "__builtin_ia32_cmple"; break;
33423342 }
33433343
33443344 void CWriter::visitMallocInst(MallocInst &I) {
3345 assert(0 && "lowerallocations pass didn't work!");
3345 LLVM_UNREACHABLE("lowerallocations pass didn't work!");
33463346 }
33473347
33483348 void CWriter::visitAllocaInst(AllocaInst &I) {
33593359 }
33603360
33613361 void CWriter::visitFreeInst(FreeInst &I) {
3362 assert(0 && "lowerallocations pass didn't work!");
3362 LLVM_UNREACHABLE("lowerallocations pass didn't work!");
33633363 }
33643364
33653365 void CWriter::printGEPExpression(Value *Ptr, gep_type_iterator I,
264264 && "Invalid negated immediate rotate 7-bit argument");
265265 O << -value;
266266 } else {
267 assert(0 &&"Invalid/non-immediate rotate amount in printRotateNeg7Imm");
267 LLVM_UNREACHABLE("Invalid/non-immediate rotate amount in printRotateNeg7Imm");
268268 }
269269 }
270270
275275 && "Invalid negated immediate rotate 7-bit argument");
276276 O << -value;
277277 } else {
278 assert(0 &&"Invalid/non-immediate rotate amount in printRotateNeg7Imm");
278 LLVM_UNREACHABLE("Invalid/non-immediate rotate amount in printRotateNeg7Imm");
279279 }
280280 }
281281
433433 EmitAlignment(MF.getAlignment(), F);
434434
435435 switch (F->getLinkage()) {
436 default: assert(0 && "Unknown linkage type!");
436 default: LLVM_UNREACHABLE( "Unknown linkage type!");
437437 case Function::PrivateLinkage:
438438 case Function::InternalLinkage: // Symbols default to internal.
439439 break;
377377 break;
378378 case 'v': // not offsetable
379379 #if 1
380 assert(0 && "InlineAsmMemoryOperand 'v' constraint not handled.");
380 LLVM_UNREACHABLE("InlineAsmMemoryOperand 'v' constraint not handled.");
381381 #else
382382 SelectAddrIdxOnly(Op, Op, Op0, Op1);
383383 #endif
874874 }
875875 }
876876
877 assert(0 &&
877 LLVM_UNREACHABLE(
878878 "LowerConstantPool: Relocation model other than static"
879879 " not supported.");
880880 return SDValue();
906906 }
907907 }
908908
909 assert(0 &&
909 LLVM_UNREACHABLE(
910910 "LowerJumpTable: Relocation model other than static not supported.");
911911 return SDValue();
912912 }
11381138 PtrOff = DAG.getNode(ISD::ADD, dl, PtrVT, StackPtr, PtrOff);
11391139
11401140 switch (Arg.getValueType().getSimpleVT()) {
1141 default: assert(0 && "Unexpected ValueType for argument!");
1141 default: LLVM_UNREACHABLE("Unexpected ValueType for argument!");
11421142 case MVT::i8:
11431143 case MVT::i16:
11441144 case MVT::i32:
12701270
12711271 // If the call has results, copy the values out of the ret val registers.
12721272 switch (TheCall->getValueType(0).getSimpleVT()) {
1273 default: assert(0 && "Unexpected ret value!");
1273 default: LLVM_UNREACHABLE("Unexpected ret value!");
12741274 case MVT::Other: break;
12751275 case MVT::i32:
12761276 if (TheCall->getValueType(1) == MVT::i32) {
17381738 } else if (EltVT == MVT::i64 || EltVT == MVT::f64) {
17391739 V2EltIdx0 = 2;
17401740 } else
1741 assert(0 && "Unhandled vector type in LowerVECTOR_SHUFFLE");
1741 LLVM_UNREACHABLE("Unhandled vector type in LowerVECTOR_SHUFFLE");
17421742
17431743 for (unsigned i = 0; i != MaxElts; ++i) {
17441744 if (SVN->getMaskElt(i) < 0)
18341834
18351835 // Create a constant vector:
18361836 switch (Op.getValueType().getSimpleVT()) {
1837 default: assert(0 && "Unexpected constant value type in "
1837 default: LLVM_UNREACHABLE("Unexpected constant value type in "
18381838 "LowerSCALAR_TO_VECTOR");
18391839 case MVT::v16i8: n_copies = 16; VT = MVT::i8; break;
18401840 case MVT::v8i16: n_copies = 8; VT = MVT::i16; break;
18531853 } else {
18541854 // Otherwise, copy the value from one register to another:
18551855 switch (Op0.getValueType().getSimpleVT()) {
1856 default: assert(0 && "Unexpected value type in LowerSCALAR_TO_VECTOR");
1856 default: LLVM_UNREACHABLE("Unexpected value type in LowerSCALAR_TO_VECTOR");
18571857 case MVT::i8:
18581858 case MVT::i16:
18591859 case MVT::i32:
18801880
18811881 // sanity checks:
18821882 if (VT == MVT::i8 && EltNo >= 16)
1883 assert(0 && "SPU LowerEXTRACT_VECTOR_ELT: i8 extraction slot > 15");
1883 LLVM_UNREACHABLE("SPU LowerEXTRACT_VECTOR_ELT: i8 extraction slot > 15");
18841884 else if (VT == MVT::i16 && EltNo >= 8)
1885 assert(0 && "SPU LowerEXTRACT_VECTOR_ELT: i16 extraction slot > 7");
1885 LLVM_UNREACHABLE("SPU LowerEXTRACT_VECTOR_ELT: i16 extraction slot > 7");
18861886 else if (VT == MVT::i32 && EltNo >= 4)
1887 assert(0 && "SPU LowerEXTRACT_VECTOR_ELT: i32 extraction slot > 4");
1887 LLVM_UNREACHABLE("SPU LowerEXTRACT_VECTOR_ELT: i32 extraction slot > 4");
18881888 else if (VT == MVT::i64 && EltNo >= 2)
1889 assert(0 && "SPU LowerEXTRACT_VECTOR_ELT: i64 extraction slot > 2");
1889 LLVM_UNREACHABLE("SPU LowerEXTRACT_VECTOR_ELT: i64 extraction slot > 2");
18901890
18911891 if (EltNo == 0 && (VT == MVT::i32 || VT == MVT::i64)) {
18921892 // i32 and i64: Element 0 is the preferred slot
20652065 assert(Op.getValueType() == MVT::i8);
20662066 switch (Opc) {
20672067 default:
2068 assert(0 && "Unhandled i8 math operator");
2068 LLVM_UNREACHABLE("Unhandled i8 math operator");
20692069 /*NOTREACHED*/
20702070 break;
20712071 case ISD::ADD: {
324324
325325 void CppWriter::printVisibilityType(GlobalValue::VisibilityTypes VisType) {
326326 switch (VisType) {
327 default: assert(0 && "Unknown GVar visibility");
327 default: LLVM_UNREACHABLE("Unknown GVar visibility");
328328 case GlobalValue::DefaultVisibility:
329329 Out << "GlobalValue::DefaultVisibility";
330330 break;
843843 printConstant(CE->getOperand(0));
844844 Out << "Constant* " << constName << " = ConstantExpr::getCast(";
845845 switch (CE->getOpcode()) {
846 default: assert(0 && "Invalid cast opcode");
846 default: LLVM_UNREACHABLE("Invalid cast opcode");
847847 case Instruction::Trunc: Out << "Instruction::Trunc"; break;
848848 case Instruction::ZExt: Out << "Instruction::ZExt"; break;
849849 case Instruction::SExt: Out << "Instruction::SExt"; break;
1616 #include "llvm/Function.h"
1717 #include "llvm/GlobalVariable.h"
1818 #include "llvm/ADT/StringExtras.h"
19 #include "llvm/Support/ErrorHandling.h"
1920 #include "llvm/Support/Mangler.h"
2021 #include "llvm/Target/DarwinTargetAsmInfo.h"
2122 #include "llvm/Target/TargetMachine.h"
150151 ConstDataCoalSection:
151152 MergeableConstSection(cast(GV)));
152153 default:
153 assert(0 && "Unsuported section kind for global");
154 LLVM_UNREACHABLE("Unsuported section kind for global");
154155 }
155156
156157 // FIXME: Do we have any extra special weird cases?
210211 std::string
211212 DarwinTargetAsmInfo::UniqueSectionForGlobal(const GlobalValue* GV,
212213 SectionKind::Kind kind) const {
213 assert(0 && "Darwin does not use unique sections");
214 LLVM_UNREACHABLE("Darwin does not use unique sections");
214215 return "";
215216 }
1717 #include "llvm/GlobalVariable.h"
1818 #include "llvm/ADT/StringExtras.h"
1919 #include "llvm/CodeGen/MachineConstantPool.h"
20 #include "llvm/Support/ErrorHandling.h"
2021 #include "llvm/Target/ELFTargetAsmInfo.h"
2122 #include "llvm/Target/TargetMachine.h"
2223 #include "llvm/Target/TargetData.h"
7374
7475 if (const Function *F = dyn_cast(GV)) {
7576 switch (F->getLinkage()) {
76 default: assert(0 && "Unknown linkage type!");
77 default: LLVM_UNREACHABLE("Unknown linkage type!");
7778 case Function::PrivateLinkage:
7879 case Function::InternalLinkage:
7980 case Function::DLLExportLinkage:
122123 case SectionKind::ThreadBSS:
123124 return TLSBSSSection;
124125 default:
125 assert(0 && "Unsuported section kind for global");
126 LLVM_UNREACHABLE("Unsuported section kind for global");
126127 }
127128 }
128129 } else
129 assert(0 && "Unsupported global");
130 LLVM_UNREACHABLE("Unsupported global");
130131
131132 return NULL;
132133 }
214214
215215 if(isFP) { // if this is an FP divide, we finish up here and exit early
216216 if(isModulus)
217 assert(0 && "Sorry, try another FORTRAN compiler.");
217 LLVM_UNREACHABLE("Sorry, try another FORTRAN compiler.");
218218
219219 SDValue TmpE2, TmpY3, TmpQ0, TmpR0;
220220
405405 APFloat(+1.0f) : APFloat(+1.0))) {
406406 V = CurDAG->getCopyFromReg(Chain, dl, IA64::F1, MVT::f64);
407407 } else
408 assert(0 && "Unexpected FP constant!");
408 LLVM_UNREACHABLE("Unexpected FP constant!");
409409
410410 ReplaceUses(SDValue(N, 0), V);
411411 return 0;
467467 #ifndef NDEBUG
468468 N->dump(CurDAG);
469469 #endif
470 assert(0 && "Cannot load this type!");
470 LLVM_UNREACHABLE("Cannot load this type!");
471471 case MVT::i1: { // this is a bool
472472 Opc = IA64::LD1; // first we load a byte, then compare for != 0
473473 if(N->getValueType(0) == MVT::i1) { // XXX: early exit!
503503 unsigned Opc;
504504 if (ISD::isNON_TRUNCStore(N)) {
505505 switch (N->getOperand(1).getValueType().getSimpleVT()) {
506 default: assert(0 && "unknown type in store");
506 default: LLVM_UNREACHABLE("unknown type in store");
507507 case MVT::i1: { // this is a bool
508508 Opc = IA64::ST1; // we store either 0 or 1 as a byte
509509 // first load zero!
523523 }
524524 } else { // Truncating store
525525 switch(ST->getMemoryVT().getSimpleVT()) {
526 default: assert(0 && "unknown type in truncstore");
526 default: LLVM_UNREACHABLE("unknown type in truncstore");
527527 case MVT::i8: Opc = IA64::ST1; break;
528528 case MVT::i16: Opc = IA64::ST2; break;
529529 case MVT::i32: Opc = IA64::ST4; break;
193193
194194 switch (getValueType(I->getType()).getSimpleVT()) {
195195 default:
196 assert(0 && "ERROR in LowerArgs: can't lower this type of arg.\n");
196 LLVM_UNREACHABLE("ERROR in LowerArgs: can't lower this type of arg.\n");
197197 case MVT::f32:
198198 // fixme? (well, will need to for weird FP structy stuff,
199199 // see intel ABI docs)
297297 // Finally, inform the code generator which regs we return values in.
298298 // (see the ISD::RET: case in the instruction selector)
299299 switch (getValueType(F.getReturnType()).getSimpleVT()) {
300 default: assert(0 && "i have no idea where to return this type!");
300 default: LLVM_UNREACHABLE("i have no idea where to return this type!");
301301 case MVT::isVoid: break;
302302 case MVT::i1:
303303 case MVT::i8:
361361 SDValue ValToStore(0, 0), ValToConvert(0, 0);
362362 unsigned ObjSize=8;
363363 switch (ObjectVT.getSimpleVT()) {
364 default: assert(0 && "unexpected argument type!");
364 default: LLVM_UNREACHABLE("unexpected argument type!");
365365 case MVT::i1:
366366 case MVT::i8:
367367 case MVT::i16:
492492 if (InFlag.getNode())
493493 CallOperands.push_back(InFlag);
494494 else
495 assert(0 && "this should never happen!\n");
495 LLVM_UNREACHABLE("this should never happen!\n");
496496
497497 // to make way for a hack:
498498 Chain = DAG.getNode(IA64ISD::BRCALL, dl, NodeTys,
515515 SDValue RetVal;
516516 if (RetTyVT != MVT::isVoid) {
517517 switch (RetTyVT.getSimpleVT()) {
518 default: assert(0 && "Unknown value type to return!");
518 default: LLVM_UNREACHABLE("Unknown value type to return!");
519519 case MVT::i1: { // bools are just like other integers (returned in r8)
520520 // we *could* fall through to the truncate below, but this saves a
521521 // few redundant predicate ops
572572 LowerOperation(SDValue Op, SelectionDAG &DAG) {
573573 DebugLoc dl = Op.getDebugLoc();
574574 switch (Op.getOpcode()) {
575 default: assert(0 && "Should not custom lower this!");
575 default: LLVM_UNREACHABLE("Should not custom lower this!");
576576 case ISD::GlobalTLSAddress:
577 assert(0 && "TLS not implemented for IA64.");
577 LLVM_UNREACHABLE("TLS not implemented for IA64.");
578578 case ISD::RET: {
579579 SDValue AR_PFSVal, Copy;
580580
1515 #include "IA64InstrBuilder.h"
1616 #include "llvm/CodeGen/MachineInstrBuilder.h"
1717 #include "llvm/ADT/SmallVector.h"
18 #include "llvm/Support/ErrorHandling.h"
1819 #include "IA64GenInstrInfo.inc"
1920 using namespace llvm;
2021
110111 BuildMI(MBB, MI, DL, get(IA64::ST8))
111112 .addFrameIndex(FrameIdx)
112113 .addReg(IA64::r2);
113 } else assert(0 &&
114 "sorry, I don't know how to store this sort of reg in the stack\n");
114 } else
115 LLVM_UNREACHABLE("sorry, I don't know how to store this sort of reg in the stack");
115116 }
116117
117118 void IA64InstrInfo::storeRegToAddr(MachineFunction &MF, unsigned SrcReg,
127128 } else if (RC == IA64::PRRegisterClass) {
128129 Opc = IA64::ST1;
129130 } else {
130 assert(0 &&
131 LLVM_UNREACHABLE(
131132 "sorry, I don't know how to store this sort of reg\n");
132133 }
133134
162163 .addReg(IA64::r2)
163164 .addReg(IA64::r0);
164165 } else {
165 assert(0 &&
166 LLVM_UNREACHABLE(
166167 "sorry, I don't know how to load this sort of reg from the stack\n");
167168 }
168169 }
179180 } else if (RC == IA64::PRRegisterClass) {
180181 Opc = IA64::LD1;
181182 } else {
182 assert(0 &&
183 LLVM_UNREACHABLE(
183184 "sorry, I don't know how to load this sort of reg\n");
184185 }
185186
2424 #include "llvm/CodeGen/MachineFrameInfo.h"
2525 #include "llvm/CodeGen/MachineLocation.h"
2626 #include "llvm/CodeGen/MachineRegisterInfo.h"
27 #include "llvm/Support/ErrorHandling.h"
2728 #include "llvm/Target/TargetFrameInfo.h"
2829 #include "llvm/Target/TargetMachine.h"
2930 #include "llvm/Target/TargetOptions.h"
291292 }
292293
293294 unsigned IA64RegisterInfo::getRARegister() const {
294 assert(0 && "What is the return address register");
295 LLVM_UNREACHABLE("What is the return address register");
295296 return 0;
296297 }
297298
300301 }
301302
302303 unsigned IA64RegisterInfo::getEHExceptionRegister() const {
303 assert(0 && "What is the exception register");
304 LLVM_UNREACHABLE("What is the exception register");
304305 return 0;
305306 }
306307
307308 unsigned IA64RegisterInfo::getEHHandlerRegister() const {
308 assert(0 && "What is the exception handler register");
309 LLVM_UNREACHABLE("What is the exception handler register");
309310 return 0;
310311 }
311312
312313 int IA64RegisterInfo::getDwarfRegNum(unsigned RegNum, bool isEH) const {
313 assert(0 && "What is the dwarf register number");
314 LLVM_UNREACHABLE("What is the dwarf register number");
314315 return -1;
315316 }
316317
1818 #include "llvm/TypeSymbolTable.h"
1919 #include "llvm/Analysis/ConstantsScanner.h"
2020 #include "llvm/Support/CallSite.h"
21 #include "llvm/Support/ErrorHandling.h"
2122 #include "llvm/Support/InstVisitor.h"
2223 #include "llvm/Support/MathExtras.h"
2324 #include "llvm/Transforms/Scalar.h"
272273 return "modopt([mscorlib]System.Runtime.CompilerServices.CallConvStdcall) ";
273274 default:
274275 cerr << "CallingConvID = " << CallingConvID << '\n';
275 assert(0 && "Unsupported calling convention");
276 LLVM_UNREACHABLE("Unsupported calling convention");
276277 }
277278 return ""; // Not reached
278279 }
318319 return "float64 ";
319320 default:
320321 cerr << "Type = " << *Ty << '\n';
321 assert(0 && "Invalid primitive type");
322 LLVM_UNREACHABLE("Invalid primitive type");
322323 }
323324 return ""; // Not reached
324325 }
346347 return "valuetype '"+getArrayTypeName(Ty->getTypeID(),Ty)+"' ";
347348 default:
348349 cerr << "Type = " << *Ty << '\n';
349 assert(0 && "Invalid type in getTypeName()");
350 LLVM_UNREACHABLE("Invalid type in getTypeName()");
350351 }
351352 return ""; // Not reached
352353 }
390391 return "i"+utostr(TD->getTypeAllocSize(Ty));
391392 default:
392393 cerr << "TypeID = " << Ty->getTypeID() << '\n';
393 assert(0 && "Invalid type in TypeToPostfix()");
394 LLVM_UNREACHABLE("Invalid type in TypeToPostfix()");
394395 }
395396 return ""; // Not reached
396397 }
405406 printSimpleInstruction("conv.u8");
406407 break;
407408 default:
408 assert(0 && "Module use not supporting pointer size");
409 LLVM_UNREACHABLE("Module use not supporting pointer size");
409410 }