aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2002-03-24 03:56:55 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2002-03-24 03:56:55 +0000
commit4fad51370455296216bde8b8ab8c267a33e632c1 (patch)
tree603d9676b3c7293ea5daa9b585d869fd4bb48211 /include
parentb6efb3605fe9ce7fbfe6874039b1aaa907061e1c (diff)
downloadexternal_llvm-4fad51370455296216bde8b8ab8c267a33e632c1.zip
external_llvm-4fad51370455296216bde8b8ab8c267a33e632c1.tar.gz
external_llvm-4fad51370455296216bde8b8ab8c267a33e632c1.tar.bz2
Add methods to support type inquiry. Rename TmpInstruction values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1978 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/InstrSelection.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/include/llvm/CodeGen/InstrSelection.h b/include/llvm/CodeGen/InstrSelection.h
index 4d5e497..91bc8f2 100644
--- a/include/llvm/CodeGen/InstrSelection.h
+++ b/include/llvm/CodeGen/InstrSelection.h
@@ -88,10 +88,6 @@ public:
Operands.push_back(Use(s1, this)); // s1 must be nonnull
if (s2) {
Operands.push_back(Use(s2, this));
-#if 0
- assert(s2->getType() == getType() &&
- "TmpInstruction operand types do not match!");
-#endif
}
}
@@ -100,13 +96,22 @@ public:
TmpInstruction(const Type *Ty, Value *s1 = 0, Value* s2 = 0,
const std::string &name = "")
: Instruction(Ty, Instruction::UserOp1, name) {
- if (s1) { Operands.push_back(Use(s1, this)); /*assert(s1->getType() == Ty);*/ }
- if (s2) { Operands.push_back(Use(s2, this)); /*assert(s2->getType() == Ty);*/ }
+ if (s1) { Operands.push_back(Use(s1, this)); }
+ if (s2) { Operands.push_back(Use(s2, this)); }
}
virtual Instruction *clone() const { return new TmpInstruction(*this); }
virtual const char *getOpcodeName() const {
- return "TemporaryInstruction";
+ return "TempValueForMachineInstr";
+ }
+
+ // 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));
}
};