| Brian Gaeke | b3e3c53 | 2004-08-04 07:29:04 +0000 | [diff] [blame] | 1 | //===- SparcV9TmpInstr.cpp - SparcV9 Intermediate Value class -------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file was developed by the LLVM research group and is distributed under |
| 6 | // the University of Illinois Open Source License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // Methods of class for temporary intermediate values used within the current |
| 11 | // SparcV9 backend. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #include "SparcV9TmpInstr.h" |
| Reid Spencer | 7c16caa | 2004-09-01 22:55:40 +0000 | [diff] [blame] | 16 | #include "llvm/Support/LeakDetector.h" |
| Brian Gaeke | b3e3c53 | 2004-08-04 07:29:04 +0000 | [diff] [blame] | 17 | |
| 18 | namespace llvm { |
| 19 | |
| 20 | TmpInstruction::TmpInstruction(Value *s1, Value *s2, const std::string &name) |
| 21 | : Instruction(s1->getType(), Instruction::UserOp1, name) { |
| 22 | Operands.push_back(Use(s1, this)); // s1 must be non-null |
| 23 | if (s2) |
| 24 | Operands.push_back(Use(s2, this)); |
| 25 | |
| 26 | // TmpInstructions should not be garbage checked. |
| 27 | LeakDetector::removeGarbageObject(this); |
| 28 | } |
| 29 | |
| 30 | TmpInstruction::TmpInstruction(MachineCodeForInstruction& mcfi, |
| 31 | Value *s1, Value *s2, const std::string &name) |
| 32 | : Instruction(s1->getType(), Instruction::UserOp1, name) { |
| 33 | mcfi.addTemp(this); |
| 34 | |
| 35 | Operands.push_back(Use(s1, this)); // s1 must be non-null |
| 36 | if (s2) |
| 37 | Operands.push_back(Use(s2, this)); |
| 38 | |
| 39 | // TmpInstructions should not be garbage checked. |
| 40 | LeakDetector::removeGarbageObject(this); |
| 41 | } |
| 42 | |
| 43 | // Constructor that requires the type of the temporary to be specified. |
| 44 | // Both S1 and S2 may be NULL. |
| 45 | TmpInstruction::TmpInstruction(MachineCodeForInstruction& mcfi, |
| 46 | const Type *Ty, Value *s1, Value* s2, |
| 47 | const std::string &name) |
| 48 | : Instruction(Ty, Instruction::UserOp1, name) { |
| 49 | mcfi.addTemp(this); |
| 50 | |
| 51 | if (s1) |
| 52 | Operands.push_back(Use(s1, this)); |
| 53 | if (s2) |
| 54 | Operands.push_back(Use(s2, this)); |
| 55 | |
| 56 | // TmpInstructions should not be garbage checked. |
| 57 | LeakDetector::removeGarbageObject(this); |
| 58 | } |
| 59 | |
| 60 | } // end namespace llvm |