2004-08-04 07:29:04 +00:00
|
|
|
//===-- SparcV9TmpInstr.h ---------------------------------------*- C++ -*-===//
|
2005-04-21 23:30:14 +00:00
|
|
|
//
|
2004-08-04 07:29:04 +00:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file was developed by the LLVM research group and is distributed under
|
|
|
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
2005-04-21 23:30:14 +00:00
|
|
|
//
|
2004-08-04 07:29:04 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// Definition of class for temporary intermediate values used within the current
|
|
|
|
// SparcV9 backend.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef SPARCV9TMPINSTR_H
|
|
|
|
#define SPARCV9TMPINSTR_H
|
|
|
|
|
|
|
|
#include "llvm/Instruction.h"
|
2004-08-16 21:55:02 +00:00
|
|
|
#include "MachineCodeForInstruction.h"
|
2004-08-04 07:29:04 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
/// TmpInstruction - This class represents temporary intermediate
|
|
|
|
/// values used within the SparcV9 machine code for an LLVM instruction.
|
2005-04-21 23:30:14 +00:00
|
|
|
///
|
2004-08-04 07:29:04 +00:00
|
|
|
class TmpInstruction : public Instruction {
|
2005-01-29 00:36:59 +00:00
|
|
|
Use Ops[2];
|
|
|
|
TmpInstruction(const TmpInstruction &TI);
|
2004-08-04 07:29:04 +00:00
|
|
|
public:
|
|
|
|
// Constructor that uses the type of S1 as the type of the temporary.
|
|
|
|
// s1 must be a valid value. s2 may be NULL.
|
|
|
|
TmpInstruction(MachineCodeForInstruction &mcfi,
|
|
|
|
Value *s1, Value *s2 = 0, const std::string &name = "");
|
2005-04-21 23:30:14 +00:00
|
|
|
|
2004-08-04 07:29:04 +00:00
|
|
|
// Constructor that uses the type of S1 as the type of the temporary,
|
|
|
|
// but does not require a MachineCodeForInstruction.
|
|
|
|
// s1 must be a valid value. s2 may be NULL.
|
|
|
|
TmpInstruction(Value *s1, Value *s2 = 0, const std::string &name = "");
|
|
|
|
|
|
|
|
// Constructor that requires the type of the temporary to be specified.
|
|
|
|
// Both S1 and S2 may be NULL.
|
|
|
|
TmpInstruction(MachineCodeForInstruction& mcfi,
|
|
|
|
const Type *Ty, Value *s1 = 0, Value* s2 = 0,
|
|
|
|
const std::string &name = "");
|
2005-04-21 23:30:14 +00:00
|
|
|
|
2004-08-04 07:29:04 +00:00
|
|
|
virtual Instruction *clone() const {
|
|
|
|
assert(0 && "Cannot clone TmpInstructions!");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
virtual const char *getOpcodeName() const { return "TmpInstruction"; }
|
2005-04-21 23:30:14 +00:00
|
|
|
|
2004-08-04 07:29:04 +00:00
|
|
|
// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
|
|
static inline bool classof(const TmpInstruction *) { return true; }
|
|
|
|
static inline bool classof(const Instruction *I) {
|
|
|
|
return (I->getOpcode() == Instruction::UserOp1);
|
|
|
|
}
|
|
|
|
static inline bool classof(const Value *V) {
|
|
|
|
return isa<Instruction>(V) && classof(cast<Instruction>(V));
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
} // End llvm namespace
|
|
|
|
|
|
|
|
#endif
|