LLVM API Documentation
00001 //===-- SparcV9TmpInstr.h ---------------------------------------*- C++ -*-===// 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 // Definition of class for temporary intermediate values used within the current 00011 // SparcV9 backend. 00012 // 00013 //===----------------------------------------------------------------------===// 00014 00015 #ifndef SPARCV9TMPINSTR_H 00016 #define SPARCV9TMPINSTR_H 00017 00018 #include "llvm/Instruction.h" 00019 #include "MachineCodeForInstruction.h" 00020 00021 namespace llvm { 00022 00023 /// TmpInstruction - This class represents temporary intermediate 00024 /// values used within the SparcV9 machine code for an LLVM instruction. 00025 /// 00026 class TmpInstruction : public Instruction { 00027 Use Ops[2]; 00028 TmpInstruction(const TmpInstruction &TI); 00029 public: 00030 // Constructor that uses the type of S1 as the type of the temporary. 00031 // s1 must be a valid value. s2 may be NULL. 00032 TmpInstruction(MachineCodeForInstruction &mcfi, 00033 Value *s1, Value *s2 = 0, const std::string &name = ""); 00034 00035 // Constructor that uses the type of S1 as the type of the temporary, 00036 // but does not require a MachineCodeForInstruction. 00037 // s1 must be a valid value. s2 may be NULL. 00038 TmpInstruction(Value *s1, Value *s2 = 0, const std::string &name = ""); 00039 00040 // Constructor that requires the type of the temporary to be specified. 00041 // Both S1 and S2 may be NULL. 00042 TmpInstruction(MachineCodeForInstruction& mcfi, 00043 const Type *Ty, Value *s1 = 0, Value* s2 = 0, 00044 const std::string &name = ""); 00045 00046 virtual Instruction *clone() const { 00047 assert(0 && "Cannot clone TmpInstructions!"); 00048 return 0; 00049 } 00050 virtual const char *getOpcodeName() const { return "TmpInstruction"; } 00051 00052 // Methods for support type inquiry through isa, cast, and dyn_cast: 00053 static inline bool classof(const TmpInstruction *) { return true; } 00054 static inline bool classof(const Instruction *I) { 00055 return (I->getOpcode() == Instruction::UserOp1); 00056 } 00057 static inline bool classof(const Value *V) { 00058 return isa<Instruction>(V) && classof(cast<Instruction>(V)); 00059 } 00060 }; 00061 00062 } // End llvm namespace 00063 00064 #endif