blob: 58f2656559c5342c2d09d18e5aee642841407c1a [file] [log] [blame]
Chris Lattner05950c32001-10-13 06:47:01 +00001//===- ReadInst.cpp - Code to read an instruction from bytecode -----------===//
Chris Lattner00950542001-06-06 20:29:01 +00002//
3// This file defines the mechanism to read an instruction from a bytecode
4// stream.
5//
6// Note that this library should be as fast as possible, reentrant, and
7// threadsafe!!
8//
9// TODO: Change from getValue(Raw.Arg1) etc, to getArg(Raw, 1)
10// Make it check type, so that casts are checked.
11//
Chris Lattner05950c32001-10-13 06:47:01 +000012//===----------------------------------------------------------------------===//
Chris Lattner00950542001-06-06 20:29:01 +000013
14#include "llvm/iOther.h"
15#include "llvm/iTerminators.h"
16#include "llvm/iMemory.h"
17#include "llvm/DerivedTypes.h"
18#include "ReaderInternals.h"
19
20bool BytecodeParser::ParseRawInst(const uchar *&Buf, const uchar *EndBuf,
21 RawInst &Result) {
22 unsigned Op, Typ;
Chris Lattner3d3f2892001-07-28 17:50:18 +000023 if (read(Buf, EndBuf, Op)) return failure(true);
Chris Lattner00950542001-06-06 20:29:01 +000024
25 Result.NumOperands = Op >> 30;
26 Result.Opcode = (Op >> 24) & 63;
27
28 switch (Result.NumOperands) {
29 case 1:
30 Result.Ty = getType((Op >> 12) & 4095);
31 Result.Arg1 = Op & 4095;
32 if (Result.Arg1 == 4095) // Handle special encoding for 0 operands...
33 Result.NumOperands = 0;
34 break;
35 case 2:
36 Result.Ty = getType((Op >> 16) & 255);
37 Result.Arg1 = (Op >> 8 ) & 255;
38 Result.Arg2 = (Op >> 0 ) & 255;
39 break;
40 case 3:
41 Result.Ty = getType((Op >> 18) & 63);
42 Result.Arg1 = (Op >> 12) & 63;
43 Result.Arg2 = (Op >> 6 ) & 63;
44 Result.Arg3 = (Op >> 0 ) & 63;
45 break;
46 case 0:
47 Buf -= 4; // Hrm, try this again...
Chris Lattner3d3f2892001-07-28 17:50:18 +000048 if (read_vbr(Buf, EndBuf, Result.Opcode)) return failure(true);
49 if (read_vbr(Buf, EndBuf, Typ)) return failure(true);
Chris Lattner00950542001-06-06 20:29:01 +000050 Result.Ty = getType(Typ);
Chris Lattner3d3f2892001-07-28 17:50:18 +000051 if (read_vbr(Buf, EndBuf, Result.NumOperands)) return failure(true);
Chris Lattner00950542001-06-06 20:29:01 +000052
53 switch (Result.NumOperands) {
54 case 0:
55 cerr << "Zero Arg instr found!\n";
Chris Lattner3d3f2892001-07-28 17:50:18 +000056 return failure(true); // This encoding is invalid!
Chris Lattner00950542001-06-06 20:29:01 +000057 case 1:
Chris Lattner3d3f2892001-07-28 17:50:18 +000058 if (read_vbr(Buf, EndBuf, Result.Arg1)) return failure(true);
Chris Lattner00950542001-06-06 20:29:01 +000059 break;
60 case 2:
61 if (read_vbr(Buf, EndBuf, Result.Arg1) ||
Chris Lattner3d3f2892001-07-28 17:50:18 +000062 read_vbr(Buf, EndBuf, Result.Arg2)) return failure(true);
Chris Lattner00950542001-06-06 20:29:01 +000063 break;
64 case 3:
65 if (read_vbr(Buf, EndBuf, Result.Arg1) ||
66 read_vbr(Buf, EndBuf, Result.Arg2) ||
Chris Lattner3d3f2892001-07-28 17:50:18 +000067 read_vbr(Buf, EndBuf, Result.Arg3)) return failure(true);
Chris Lattner00950542001-06-06 20:29:01 +000068 break;
69 default:
70 if (read_vbr(Buf, EndBuf, Result.Arg1) ||
Chris Lattner3d3f2892001-07-28 17:50:18 +000071 read_vbr(Buf, EndBuf, Result.Arg2)) return failure(true);
Chris Lattner00950542001-06-06 20:29:01 +000072
73 // Allocate a vector to hold arguments 3, 4, 5, 6 ...
74 Result.VarArgs = new vector<unsigned>(Result.NumOperands-2);
75 for (unsigned a = 0; a < Result.NumOperands-2; a++)
Chris Lattner3d3f2892001-07-28 17:50:18 +000076 if (read_vbr(Buf, EndBuf, (*Result.VarArgs)[a])) return failure(true);
Chris Lattner00950542001-06-06 20:29:01 +000077 break;
78 }
Chris Lattner3d3f2892001-07-28 17:50:18 +000079 if (align32(Buf, EndBuf)) return failure(true);
Chris Lattner00950542001-06-06 20:29:01 +000080 break;
81 }
82
Chris Lattnerc8b25d42001-07-07 08:36:50 +000083#if 0
84 cerr << "NO: " << Result.NumOperands << " opcode: " << Result.Opcode
Chris Lattner1d670cc2001-09-07 16:37:43 +000085 << " Ty: " << Result.Ty->getDescription() << " arg1: " << Result.Arg1
Chris Lattnerc8b25d42001-07-07 08:36:50 +000086 << " arg2: " << Result.Arg2 << " arg3: " << Result.Arg3 << endl;
87#endif
Chris Lattner00950542001-06-06 20:29:01 +000088 return false;
89}
90
91
92bool BytecodeParser::ParseInstruction(const uchar *&Buf, const uchar *EndBuf,
93 Instruction *&Res) {
94 RawInst Raw;
Chris Lattner3d3f2892001-07-28 17:50:18 +000095 if (ParseRawInst(Buf, EndBuf, Raw)) return failure(true);
Chris Lattner00950542001-06-06 20:29:01 +000096
97 if (Raw.Opcode >= Instruction::FirstUnaryOp &&
98 Raw.Opcode < Instruction::NumUnaryOps && Raw.NumOperands == 1) {
Chris Lattner9f3d2762001-07-07 20:17:23 +000099 Res = UnaryOperator::create((Instruction::UnaryOps)Raw.Opcode,
100 getValue(Raw.Ty,Raw.Arg1));
Chris Lattner00950542001-06-06 20:29:01 +0000101 return false;
102 } else if (Raw.Opcode >= Instruction::FirstBinaryOp &&
103 Raw.Opcode < Instruction::NumBinaryOps && Raw.NumOperands == 2) {
Chris Lattner9f3d2762001-07-07 20:17:23 +0000104 Res = BinaryOperator::create((Instruction::BinaryOps)Raw.Opcode,
105 getValue(Raw.Ty, Raw.Arg1),
106 getValue(Raw.Ty, Raw.Arg2));
Chris Lattner00950542001-06-06 20:29:01 +0000107 return false;
Chris Lattner027dcc52001-07-08 21:10:27 +0000108 }
109
110 Value *V;
111 switch (Raw.Opcode) {
112 case Instruction::Cast:
Chris Lattner71496b32001-07-08 19:03:27 +0000113 Res = new CastInst(getValue(Raw.Ty, Raw.Arg1), getType(Raw.Arg2));
Chris Lattner09083092001-07-08 04:57:15 +0000114 return false;
Chris Lattner027dcc52001-07-08 21:10:27 +0000115
116 case Instruction::PHINode: {
Chris Lattner00950542001-06-06 20:29:01 +0000117 PHINode *PN = new PHINode(Raw.Ty);
118 switch (Raw.NumOperands) {
Chris Lattneree976f32001-06-11 15:04:40 +0000119 case 0:
120 case 1:
121 case 3: cerr << "Invalid phi node encountered!\n";
Chris Lattner00950542001-06-06 20:29:01 +0000122 delete PN;
Chris Lattner3d3f2892001-07-28 17:50:18 +0000123 return failure(true);
Chris Lattneree976f32001-06-11 15:04:40 +0000124 case 2: PN->addIncoming(getValue(Raw.Ty, Raw.Arg1),
Chris Lattnerb00c5822001-10-02 03:41:24 +0000125 cast<BasicBlock>(getValue(Type::LabelTy,Raw.Arg2)));
Chris Lattneree976f32001-06-11 15:04:40 +0000126 break;
Chris Lattner00950542001-06-06 20:29:01 +0000127 default:
Chris Lattneree976f32001-06-11 15:04:40 +0000128 PN->addIncoming(getValue(Raw.Ty, Raw.Arg1),
Chris Lattnerb00c5822001-10-02 03:41:24 +0000129 cast<BasicBlock>(getValue(Type::LabelTy, Raw.Arg2)));
Chris Lattneree976f32001-06-11 15:04:40 +0000130 if (Raw.VarArgs->size() & 1) {
131 cerr << "PHI Node with ODD number of arguments!\n";
132 delete PN;
Chris Lattner3d3f2892001-07-28 17:50:18 +0000133 return failure(true);
Chris Lattneree976f32001-06-11 15:04:40 +0000134 } else {
Chris Lattner00950542001-06-06 20:29:01 +0000135 vector<unsigned> &args = *Raw.VarArgs;
Chris Lattneree976f32001-06-11 15:04:40 +0000136 for (unsigned i = 0; i < args.size(); i+=2)
137 PN->addIncoming(getValue(Raw.Ty, args[i]),
Chris Lattnerb00c5822001-10-02 03:41:24 +0000138 cast<BasicBlock>(getValue(Type::LabelTy, args[i+1])));
Chris Lattner00950542001-06-06 20:29:01 +0000139 }
Chris Lattneree976f32001-06-11 15:04:40 +0000140 delete Raw.VarArgs;
141 break;
Chris Lattner00950542001-06-06 20:29:01 +0000142 }
143 Res = PN;
144 return false;
Chris Lattner027dcc52001-07-08 21:10:27 +0000145 }
146
147 case Instruction::Shl:
148 case Instruction::Shr:
149 Res = new ShiftInst((Instruction::OtherOps)Raw.Opcode,
150 getValue(Raw.Ty, Raw.Arg1),
151 getValue(Type::UByteTy, Raw.Arg2));
152 return false;
153 case Instruction::Ret:
Chris Lattner00950542001-06-06 20:29:01 +0000154 if (Raw.NumOperands == 0) {
155 Res = new ReturnInst(); return false;
156 } else if (Raw.NumOperands == 1) {
157 Res = new ReturnInst(getValue(Raw.Ty, Raw.Arg1)); return false;
158 }
Chris Lattner027dcc52001-07-08 21:10:27 +0000159 break;
160
161 case Instruction::Br:
Chris Lattner00950542001-06-06 20:29:01 +0000162 if (Raw.NumOperands == 1) {
Chris Lattnerb00c5822001-10-02 03:41:24 +0000163 Res = new BranchInst(cast<BasicBlock>(getValue(Type::LabelTy, Raw.Arg1)));
Chris Lattner00950542001-06-06 20:29:01 +0000164 return false;
165 } else if (Raw.NumOperands == 3) {
Chris Lattnerb00c5822001-10-02 03:41:24 +0000166 Res = new BranchInst(cast<BasicBlock>(getValue(Type::LabelTy, Raw.Arg1)),
167 cast<BasicBlock>(getValue(Type::LabelTy, Raw.Arg2)),
168 getValue(Type::BoolTy , Raw.Arg3));
Chris Lattner00950542001-06-06 20:29:01 +0000169 return false;
170 }
Chris Lattner027dcc52001-07-08 21:10:27 +0000171 break;
172
173 case Instruction::Switch: {
Chris Lattner00950542001-06-06 20:29:01 +0000174 SwitchInst *I =
175 new SwitchInst(getValue(Raw.Ty, Raw.Arg1),
Chris Lattnerb00c5822001-10-02 03:41:24 +0000176 cast<BasicBlock>(getValue(Type::LabelTy, Raw.Arg2)));
Chris Lattner00950542001-06-06 20:29:01 +0000177 Res = I;
178 if (Raw.NumOperands < 3) return false; // No destinations? Wierd.
179
180 if (Raw.NumOperands == 3 || Raw.VarArgs->size() & 1) {
181 cerr << "Switch statement with odd number of arguments!\n";
182 delete I;
Chris Lattner3d3f2892001-07-28 17:50:18 +0000183 return failure(true);
Chris Lattner00950542001-06-06 20:29:01 +0000184 }
185
186 vector<unsigned> &args = *Raw.VarArgs;
187 for (unsigned i = 0; i < args.size(); i += 2)
Chris Lattnerb00c5822001-10-02 03:41:24 +0000188 I->dest_push_back(cast<ConstPoolVal>(getValue(Raw.Ty, args[i])),
189 cast<BasicBlock>(getValue(Type::LabelTy, args[i+1])));
Chris Lattner00950542001-06-06 20:29:01 +0000190
191 delete Raw.VarArgs;
192 return false;
Chris Lattner027dcc52001-07-08 21:10:27 +0000193 }
194
195 case Instruction::Call: {
Chris Lattner05950c32001-10-13 06:47:01 +0000196 Value *M = getValue(Raw.Ty, Raw.Arg1);
Chris Lattner3d3f2892001-07-28 17:50:18 +0000197 if (M == 0) return failure(true);
Chris Lattner00950542001-06-06 20:29:01 +0000198
Chris Lattner05950c32001-10-13 06:47:01 +0000199 // Check to make sure we have a pointer to method type
200 PointerType *PTy = dyn_cast<PointerType>(M->getType());
201 if (PTy == 0) return failure(true);
202 MethodType *MTy = dyn_cast<MethodType>(PTy->getValueType());
203 if (MTy == 0) return failure(true);
Chris Lattnere5a57ee2001-07-25 22:47:55 +0000204
Chris Lattner05950c32001-10-13 06:47:01 +0000205 vector<Value *> Params;
206 const MethodType::ParamTypes &PL = MTy->getParamTypes();
207
208 if (!MTy->isVarArg()) {
Chris Lattnere5a57ee2001-07-25 22:47:55 +0000209 MethodType::ParamTypes::const_iterator It = PL.begin();
210
211 switch (Raw.NumOperands) {
212 case 0: cerr << "Invalid call instruction encountered!\n";
Chris Lattner3d3f2892001-07-28 17:50:18 +0000213 return failure(true);
Chris Lattnere5a57ee2001-07-25 22:47:55 +0000214 case 1: break;
215 case 2: Params.push_back(getValue(*It++, Raw.Arg2)); break;
216 case 3: Params.push_back(getValue(*It++, Raw.Arg2));
Chris Lattner3d3f2892001-07-28 17:50:18 +0000217 if (It == PL.end()) return failure(true);
Chris Lattnere5a57ee2001-07-25 22:47:55 +0000218 Params.push_back(getValue(*It++, Raw.Arg3)); break;
219 default:
220 Params.push_back(getValue(*It++, Raw.Arg2));
221 {
222 vector<unsigned> &args = *Raw.VarArgs;
223 for (unsigned i = 0; i < args.size(); i++) {
Chris Lattner3d3f2892001-07-28 17:50:18 +0000224 if (It == PL.end()) return failure(true);
Chris Lattnere5a57ee2001-07-25 22:47:55 +0000225 // TODO: Check getValue for null!
226 Params.push_back(getValue(*It++, args[i]));
227 }
Chris Lattner00950542001-06-06 20:29:01 +0000228 }
Chris Lattnere5a57ee2001-07-25 22:47:55 +0000229 delete Raw.VarArgs;
230 }
Chris Lattner3d3f2892001-07-28 17:50:18 +0000231 if (It != PL.end()) return failure(true);
Chris Lattnere5a57ee2001-07-25 22:47:55 +0000232 } else {
Chris Lattner05950c32001-10-13 06:47:01 +0000233 if (Raw.NumOperands > 2) {
234 vector<unsigned> &args = *Raw.VarArgs;
235 if (args.size() < 1) return failure(true);
Chris Lattnere5a57ee2001-07-25 22:47:55 +0000236
Chris Lattner05950c32001-10-13 06:47:01 +0000237 if ((args.size() & 1) != 0)
238 return failure(true); // Must be pairs of type/value
239 for (unsigned i = 0; i < args.size(); i+=2) {
240 const Type *Ty = getType(args[i]);
241 if (Ty == 0)
242 return failure(true);
243
244 Value *V = getValue(Ty, args[i+1]);
245 if (V == 0) return failure(true);
246 Params.push_back(V);
247 }
248 delete Raw.VarArgs;
Chris Lattner00950542001-06-06 20:29:01 +0000249 }
Chris Lattner00950542001-06-06 20:29:01 +0000250 }
Chris Lattner00950542001-06-06 20:29:01 +0000251
252 Res = new CallInst(M, Params);
253 return false;
Chris Lattner027dcc52001-07-08 21:10:27 +0000254 }
Chris Lattner05950c32001-10-13 06:47:01 +0000255 case Instruction::Invoke: {
256 Value *M = getValue(Raw.Ty, Raw.Arg1);
257 if (M == 0) return failure(true);
258
259 // Check to make sure we have a pointer to method type
260 PointerType *PTy = dyn_cast<PointerType>(M->getType());
261 if (PTy == 0) return failure(true);
262 MethodType *MTy = dyn_cast<MethodType>(PTy->getValueType());
263 if (MTy == 0) return failure(true);
264
265 vector<Value *> Params;
266 const MethodType::ParamTypes &PL = MTy->getParamTypes();
267 vector<unsigned> &args = *Raw.VarArgs;
268
269 BasicBlock *Normal, *Except;
270
271 if (!MTy->isVarArg()) {
272 if (Raw.NumOperands < 3) return failure(true);
273
274 Normal = cast<BasicBlock>(getValue(Type::LabelTy, Raw.Arg2));
275 Except = cast<BasicBlock>(getValue(Type::LabelTy, args[0]));
276
277 MethodType::ParamTypes::const_iterator It = PL.begin();
278 for (unsigned i = 1; i < args.size(); i++) {
279 if (It == PL.end()) return failure(true);
280 // TODO: Check getValue for null!
281 Params.push_back(getValue(*It++, args[i]));
282 }
283
284 if (It != PL.end()) return failure(true);
285 } else {
286 if (args.size() < 4) return failure(true);
287
288 Normal = cast<BasicBlock>(getValue(Type::LabelTy, args[0]));
289 Except = cast<BasicBlock>(getValue(Type::LabelTy, args[2]));
290
291 if ((args.size() & 1) != 0)
292 return failure(true); // Must be pairs of type/value
293 for (unsigned i = 4; i < args.size(); i+=2) {
294 // TODO: Check getValue for null!
295 Params.push_back(getValue(getType(args[i]), args[i+1]));
296 }
297 }
298
299 delete Raw.VarArgs;
300 Res = new InvokeInst(M, Normal, Except, Params);
301 return false;
302 }
Chris Lattner027dcc52001-07-08 21:10:27 +0000303 case Instruction::Malloc:
Chris Lattner3d3f2892001-07-28 17:50:18 +0000304 if (Raw.NumOperands > 2) return failure(true);
Chris Lattner027dcc52001-07-08 21:10:27 +0000305 V = Raw.NumOperands ? getValue(Type::UIntTy, Raw.Arg1) : 0;
306 Res = new MallocInst(Raw.Ty, V);
Chris Lattner00950542001-06-06 20:29:01 +0000307 return false;
Chris Lattner027dcc52001-07-08 21:10:27 +0000308
309 case Instruction::Alloca:
Chris Lattner3d3f2892001-07-28 17:50:18 +0000310 if (Raw.NumOperands > 2) return failure(true);
Chris Lattner027dcc52001-07-08 21:10:27 +0000311 V = Raw.NumOperands ? getValue(Type::UIntTy, Raw.Arg1) : 0;
312 Res = new AllocaInst(Raw.Ty, V);
Chris Lattner00950542001-06-06 20:29:01 +0000313 return false;
Chris Lattner027dcc52001-07-08 21:10:27 +0000314
315 case Instruction::Free:
316 V = getValue(Raw.Ty, Raw.Arg1);
Chris Lattner3d3f2892001-07-28 17:50:18 +0000317 if (!V->getType()->isPointerType()) return failure(true);
Chris Lattner027dcc52001-07-08 21:10:27 +0000318 Res = new FreeInst(V);
319 return false;
320
Chris Lattnerab5ac6b2001-07-08 23:22:50 +0000321 case Instruction::Load:
322 case Instruction::GetElementPtr: {
Chris Lattner027dcc52001-07-08 21:10:27 +0000323 vector<ConstPoolVal*> Idx;
324 switch (Raw.NumOperands) {
Chris Lattner3d3f2892001-07-28 17:50:18 +0000325 case 0: cerr << "Invalid load encountered!\n"; return failure(true);
Chris Lattner027dcc52001-07-08 21:10:27 +0000326 case 1: break;
327 case 2: V = getValue(Type::UByteTy, Raw.Arg2);
Chris Lattner1d87bcf2001-10-01 20:11:19 +0000328 if (!isa<ConstPoolVal>(V)) return failure(true);
329 Idx.push_back(cast<ConstPoolVal>(V));
Chris Lattner027dcc52001-07-08 21:10:27 +0000330 break;
331 case 3: V = getValue(Type::UByteTy, Raw.Arg2);
Chris Lattner1d87bcf2001-10-01 20:11:19 +0000332 if (!isa<ConstPoolVal>(V)) return failure(true);
333 Idx.push_back(cast<ConstPoolVal>(V));
Chris Lattner027dcc52001-07-08 21:10:27 +0000334 V = getValue(Type::UByteTy, Raw.Arg3);
Chris Lattner1d87bcf2001-10-01 20:11:19 +0000335 if (!isa<ConstPoolVal>(V)) return failure(true);
336 Idx.push_back(cast<ConstPoolVal>(V));
Chris Lattner027dcc52001-07-08 21:10:27 +0000337 break;
338 default:
339 V = getValue(Type::UByteTy, Raw.Arg2);
Chris Lattner1d87bcf2001-10-01 20:11:19 +0000340 if (!isa<ConstPoolVal>(V)) return failure(true);
341 Idx.push_back(cast<ConstPoolVal>(V));
Chris Lattner027dcc52001-07-08 21:10:27 +0000342 vector<unsigned> &args = *Raw.VarArgs;
343 for (unsigned i = 0, E = args.size(); i != E; ++i) {
344 V = getValue(Type::UByteTy, args[i]);
Chris Lattner1d87bcf2001-10-01 20:11:19 +0000345 if (!isa<ConstPoolVal>(V)) return failure(true);
346 Idx.push_back(cast<ConstPoolVal>(V));
Chris Lattner027dcc52001-07-08 21:10:27 +0000347 }
348 delete Raw.VarArgs;
349 break;
350 }
Chris Lattnerab5ac6b2001-07-08 23:22:50 +0000351 if (Raw.Opcode == Instruction::Load)
352 Res = new LoadInst(getValue(Raw.Ty, Raw.Arg1), Idx);
353 else if (Raw.Opcode == Instruction::GetElementPtr)
354 Res = new GetElementPtrInst(getValue(Raw.Ty, Raw.Arg1), Idx);
355 else
356 abort();
357 return false;
358 }
359 case Instruction::Store: {
360 vector<ConstPoolVal*> Idx;
361 switch (Raw.NumOperands) {
362 case 0:
Chris Lattner3d3f2892001-07-28 17:50:18 +0000363 case 1: cerr << "Invalid store encountered!\n"; return failure(true);
Chris Lattnerab5ac6b2001-07-08 23:22:50 +0000364 case 2: break;
365 case 3: V = getValue(Type::UByteTy, Raw.Arg3);
Chris Lattner1d87bcf2001-10-01 20:11:19 +0000366 if (!isa<ConstPoolVal>(V)) return failure(true);
367 Idx.push_back(cast<ConstPoolVal>(V));
Chris Lattnerab5ac6b2001-07-08 23:22:50 +0000368 break;
369 default:
370 vector<unsigned> &args = *Raw.VarArgs;
371 for (unsigned i = 0, E = args.size(); i != E; ++i) {
372 V = getValue(Type::UByteTy, args[i]);
Chris Lattner1d87bcf2001-10-01 20:11:19 +0000373 if (!isa<ConstPoolVal>(V)) return failure(true);
374 Idx.push_back(cast<ConstPoolVal>(V));
Chris Lattnerab5ac6b2001-07-08 23:22:50 +0000375 }
376 delete Raw.VarArgs;
377 break;
378 }
379
380 const Type *ElType = StoreInst::getIndexedType(Raw.Ty, Idx);
Chris Lattner3d3f2892001-07-28 17:50:18 +0000381 if (ElType == 0) return failure(true);
Chris Lattnerab5ac6b2001-07-08 23:22:50 +0000382 Res = new StoreInst(getValue(ElType, Raw.Arg1), getValue(Raw.Ty, Raw.Arg2),
383 Idx);
Chris Lattner00950542001-06-06 20:29:01 +0000384 return false;
385 }
Chris Lattner027dcc52001-07-08 21:10:27 +0000386 } // end switch(Raw.Opcode)
Chris Lattner00950542001-06-06 20:29:01 +0000387
Chris Lattnerc8b25d42001-07-07 08:36:50 +0000388 cerr << "Unrecognized instruction! " << Raw.Opcode
389 << " ADDR = 0x" << (void*)Buf << endl;
Chris Lattner3d3f2892001-07-28 17:50:18 +0000390 return failure(true);
Chris Lattner00950542001-06-06 20:29:01 +0000391}