1 //===-- SparcV9TmpInstr.h ---------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
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.
8 //===----------------------------------------------------------------------===//
10 // Definition of class for temporary intermediate values used within the current
13 //===----------------------------------------------------------------------===//
15 #ifndef SPARCV9TMPINSTR_H
16 #define SPARCV9TMPINSTR_H
18 #include "llvm/Instruction.h"
19 #include "MachineCodeForInstruction.h"
23 /// TmpInstruction - This class represents temporary intermediate
24 /// values used within the SparcV9 machine code for an LLVM instruction.
26 class TmpInstruction : public Instruction {
28 TmpInstruction(const TmpInstruction &TI);
30 // Constructor that uses the type of S1 as the type of the temporary.
31 // s1 must be a valid value. s2 may be NULL.
32 TmpInstruction(MachineCodeForInstruction &mcfi,
33 Value *s1, Value *s2 = 0, const std::string &name = "");
35 // Constructor that uses the type of S1 as the type of the temporary,
36 // but does not require a MachineCodeForInstruction.
37 // s1 must be a valid value. s2 may be NULL.
38 TmpInstruction(Value *s1, Value *s2 = 0, const std::string &name = "");
40 // Constructor that requires the type of the temporary to be specified.
41 // Both S1 and S2 may be NULL.
42 TmpInstruction(MachineCodeForInstruction& mcfi,
43 const Type *Ty, Value *s1 = 0, Value* s2 = 0,
44 const std::string &name = "");
46 virtual Instruction *clone() const {
47 assert(0 && "Cannot clone TmpInstructions!");
50 virtual const char *getOpcodeName() const { return "TmpInstruction"; }
52 // Methods for support type inquiry through isa, cast, and dyn_cast:
53 static inline bool classof(const TmpInstruction *) { return true; }
54 static inline bool classof(const Instruction *I) {
55 return (I->getOpcode() == Instruction::UserOp1);
57 static inline bool classof(const Value *V) {
58 return isa<Instruction>(V) && classof(cast<Instruction>(V));
62 } // End llvm namespace