LLVM API Documentation
00001 //===- SparcV9TmpInstr.cpp - SparcV9 Intermediate Value class -------------===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file was developed by the LLVM research group and is distributed under 00006 // the University of Illinois Open Source License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // Methods of class for temporary intermediate values used within the current 00011 // SparcV9 backend. 00012 // 00013 //===----------------------------------------------------------------------===// 00014 00015 #include "SparcV9TmpInstr.h" 00016 #include "llvm/Support/LeakDetector.h" 00017 00018 namespace llvm { 00019 00020 TmpInstruction::TmpInstruction(Value *s1, Value *s2, const std::string &name) 00021 : Instruction(s1->getType(), Instruction::UserOp1, name) { 00022 Operands.push_back(Use(s1, this)); // s1 must be non-null 00023 if (s2) 00024 Operands.push_back(Use(s2, this)); 00025 00026 // TmpInstructions should not be garbage checked. 00027 LeakDetector::removeGarbageObject(this); 00028 } 00029 00030 TmpInstruction::TmpInstruction(MachineCodeForInstruction& mcfi, 00031 Value *s1, Value *s2, const std::string &name) 00032 : Instruction(s1->getType(), Instruction::UserOp1, name) { 00033 mcfi.addTemp(this); 00034 00035 Operands.push_back(Use(s1, this)); // s1 must be non-null 00036 if (s2) 00037 Operands.push_back(Use(s2, this)); 00038 00039 // TmpInstructions should not be garbage checked. 00040 LeakDetector::removeGarbageObject(this); 00041 } 00042 00043 // Constructor that requires the type of the temporary to be specified. 00044 // Both S1 and S2 may be NULL. 00045 TmpInstruction::TmpInstruction(MachineCodeForInstruction& mcfi, 00046 const Type *Ty, Value *s1, Value* s2, 00047 const std::string &name) 00048 : Instruction(Ty, Instruction::UserOp1, name) { 00049 mcfi.addTemp(this); 00050 00051 if (s1) 00052 Operands.push_back(Use(s1, this)); 00053 if (s2) 00054 Operands.push_back(Use(s2, this)); 00055 00056 // TmpInstructions should not be garbage checked. 00057 LeakDetector::removeGarbageObject(this); 00058 } 00059 00060 } // end namespace llvm