llvm.org GIT mirror llvm / b945e4d
Get rid of extraneous arguments to implementation functions git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5852 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 17 years ago
1 changed file(s) with 31 addition(s) and 31 deletion(s). Raw diff Collapse all Expand all
9292 static GenericValue executeCastOperation(Value *Src, const Type *DestTy,
9393 ExecutionContext &SF);
9494 static GenericValue executeAddInst(GenericValue Src1, GenericValue Src2,
95 const Type *Ty, ExecutionContext &SF);
95 const Type *Ty);
9696
9797
9898 static GenericValue getOperandValue(Value *V, ExecutionContext &SF) {
106106 case Instruction::Add:
107107 return executeAddInst(getOperandValue(CE->getOperand(0), SF),
108108 getOperandValue(CE->getOperand(1), SF),
109 CE->getType(), SF);
109 CE->getType());
110110 default:
111111 cerr << "Unhandled ConstantExpr: " << CE << "\n";
112112 abort();
176176 case Type::TY##TyID: Dest.TY##Val = Src1.TY##Val OP Src2.TY##Val; break
177177
178178 static GenericValue executeAddInst(GenericValue Src1, GenericValue Src2,
179 const Type *Ty, ExecutionContext &SF) {
179 const Type *Ty) {
180180 GenericValue Dest;
181181 switch (Ty->getPrimitiveID()) {
182182 IMPLEMENT_BINARY_OPERATOR(+, UByte);
197197 }
198198
199199 static GenericValue executeSubInst(GenericValue Src1, GenericValue Src2,
200 const Type *Ty, ExecutionContext &SF) {
200 const Type *Ty) {
201201 GenericValue Dest;
202202 switch (Ty->getPrimitiveID()) {
203203 IMPLEMENT_BINARY_OPERATOR(-, UByte);
218218 }
219219
220220 static GenericValue executeMulInst(GenericValue Src1, GenericValue Src2,
221 const Type *Ty, ExecutionContext &SF) {
221 const Type *Ty) {
222222 GenericValue Dest;
223223 switch (Ty->getPrimitiveID()) {
224224 IMPLEMENT_BINARY_OPERATOR(*, UByte);
239239 }
240240
241241 static GenericValue executeDivInst(GenericValue Src1, GenericValue Src2,
242 const Type *Ty, ExecutionContext &SF) {
242 const Type *Ty) {
243243 GenericValue Dest;
244244 switch (Ty->getPrimitiveID()) {
245245 IMPLEMENT_BINARY_OPERATOR(/, UByte);
260260 }
261261
262262 static GenericValue executeRemInst(GenericValue Src1, GenericValue Src2,
263 const Type *Ty, ExecutionContext &SF) {
263 const Type *Ty) {
264264 GenericValue Dest;
265265 switch (Ty->getPrimitiveID()) {
266266 IMPLEMENT_BINARY_OPERATOR(%, UByte);
285285 }
286286
287287 static GenericValue executeAndInst(GenericValue Src1, GenericValue Src2,
288 const Type *Ty, ExecutionContext &SF) {
288 const Type *Ty) {
289289 GenericValue Dest;
290290 switch (Ty->getPrimitiveID()) {
291291 IMPLEMENT_BINARY_OPERATOR(&, UByte);
305305
306306
307307 static GenericValue executeOrInst(GenericValue Src1, GenericValue Src2,
308 const Type *Ty, ExecutionContext &SF) {
308 const Type *Ty) {
309309 GenericValue Dest;
310310 switch (Ty->getPrimitiveID()) {
311311 IMPLEMENT_BINARY_OPERATOR(|, UByte);
325325
326326
327327 static GenericValue executeXorInst(GenericValue Src1, GenericValue Src2,
328 const Type *Ty, ExecutionContext &SF) {
328 const Type *Ty) {
329329 GenericValue Dest;
330330 switch (Ty->getPrimitiveID()) {
331331 IMPLEMENT_BINARY_OPERATOR(^, UByte);
348348 case Type::TY##TyID: Dest.BoolVal = Src1.TY##Val OP Src2.TY##Val; break
349349
350350 static GenericValue executeSetEQInst(GenericValue Src1, GenericValue Src2,
351 const Type *Ty, ExecutionContext &SF) {
351 const Type *Ty) {
352352 GenericValue Dest;
353353 switch (Ty->getPrimitiveID()) {
354354 IMPLEMENT_SETCC(==, UByte);
369369 }
370370
371371 static GenericValue executeSetNEInst(GenericValue Src1, GenericValue Src2,
372 const Type *Ty, ExecutionContext &SF) {
372 const Type *Ty) {
373373 GenericValue Dest;
374374 switch (Ty->getPrimitiveID()) {
375375 IMPLEMENT_SETCC(!=, UByte);
391391 }
392392
393393 static GenericValue executeSetLEInst(GenericValue Src1, GenericValue Src2,
394 const Type *Ty, ExecutionContext &SF) {
394 const Type *Ty) {
395395 GenericValue Dest;
396396 switch (Ty->getPrimitiveID()) {
397397 IMPLEMENT_SETCC(<=, UByte);
412412 }
413413
414414 static GenericValue executeSetGEInst(GenericValue Src1, GenericValue Src2,
415 const Type *Ty, ExecutionContext &SF) {
415 const Type *Ty) {
416416 GenericValue Dest;
417417 switch (Ty->getPrimitiveID()) {
418418 IMPLEMENT_SETCC(>=, UByte);
433433 }
434434
435435 static GenericValue executeSetLTInst(GenericValue Src1, GenericValue Src2,
436 const Type *Ty, ExecutionContext &SF) {
436 const Type *Ty) {
437437 GenericValue Dest;
438438 switch (Ty->getPrimitiveID()) {
439439 IMPLEMENT_SETCC(<, UByte);
454454 }
455455
456456 static GenericValue executeSetGTInst(GenericValue Src1, GenericValue Src2,
457 const Type *Ty, ExecutionContext &SF) {
457 const Type *Ty) {
458458 GenericValue Dest;
459459 switch (Ty->getPrimitiveID()) {
460460 IMPLEMENT_SETCC(>, UByte);
481481 GenericValue R; // Result
482482
483483 switch (I.getOpcode()) {
484 case Instruction::Add: R = executeAddInst (Src1, Src2, Ty, SF); break;
485 case Instruction::Sub: R = executeSubInst (Src1, Src2, Ty, SF); break;
486 case Instruction::Mul: R = executeMulInst (Src1, Src2, Ty, SF); break;
487 case Instruction::Div: R = executeDivInst (Src1, Src2, Ty, SF); break;
488 case Instruction::Rem: R = executeRemInst (Src1, Src2, Ty, SF); break;
489 case Instruction::And: R = executeAndInst (Src1, Src2, Ty, SF); break;
490 case Instruction::Or: R = executeOrInst (Src1, Src2, Ty, SF); break;
491 case Instruction::Xor: R = executeXorInst (Src1, Src2, Ty, SF); break;
492 case Instruction::SetEQ: R = executeSetEQInst(Src1, Src2, Ty, SF); break;
493 case Instruction::SetNE: R = executeSetNEInst(Src1, Src2, Ty, SF); break;
494 case Instruction::SetLE: R = executeSetLEInst(Src1, Src2, Ty, SF); break;
495 case Instruction::SetGE: R = executeSetGEInst(Src1, Src2, Ty, SF); break;
496 case Instruction::SetLT: R = executeSetLTInst(Src1, Src2, Ty, SF); break;
497 case Instruction::SetGT: R = executeSetGTInst(Src1, Src2, Ty, SF); break;
484 case Instruction::Add: R = executeAddInst (Src1, Src2, Ty); break;
485 case Instruction::Sub: R = executeSubInst (Src1, Src2, Ty); break;
486 case Instruction::Mul: R = executeMulInst (Src1, Src2, Ty); break;
487 case Instruction::Div: R = executeDivInst (Src1, Src2, Ty); break;
488 case Instruction::Rem: R = executeRemInst (Src1, Src2, Ty); break;
489 case Instruction::And: R = executeAndInst (Src1, Src2, Ty); break;
490 case Instruction::Or: R = executeOrInst (Src1, Src2, Ty); break;
491 case Instruction::Xor: R = executeXorInst (Src1, Src2, Ty); break;
492 case Instruction::SetEQ: R = executeSetEQInst(Src1, Src2, Ty); break;
493 case Instruction::SetNE: R = executeSetNEInst(Src1, Src2, Ty); break;
494 case Instruction::SetLE: R = executeSetLEInst(Src1, Src2, Ty); break;
495 case Instruction::SetGE: R = executeSetGEInst(Src1, Src2, Ty); break;
496 case Instruction::SetLT: R = executeSetLTInst(Src1, Src2, Ty); break;
497 case Instruction::SetGT: R = executeSetGTInst(Src1, Src2, Ty); break;
498498 default:
499499 cout << "Don't know how to handle this binary operator!\n-->" << I;
500500 R = Src1;
643643 // Check to see if any of the cases match...
644644 for (unsigned i = 2, e = I.getNumOperands(); i != e; i += 2) {
645645 if (executeSetEQInst(CondVal,
646 getOperandValue(I.getOperand(i), SF),ElTy,SF).BoolVal){
646 getOperandValue(I.getOperand(i), SF), ElTy).BoolVal) {
647647 Dest = cast(I.getOperand(i+1));
648648 break;
649649 }