aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/InstrTypes.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-06-08 21:30:13 +0000
committerChris Lattner <sabre@nondot.org>2001-06-08 21:30:13 +0000
commit477c2ec3e01ddb67c3c079156f2ee2e1858bec42 (patch)
tree0a0978df36c7f87dae60a99848d549ddd3cd509b /include/llvm/InstrTypes.h
parentdaa6ae31c18fd948ceaa05a6ef6712612dd70d7f (diff)
downloadexternal_llvm-477c2ec3e01ddb67c3c079156f2ee2e1858bec42.zip
external_llvm-477c2ec3e01ddb67c3c079156f2ee2e1858bec42.tar.gz
external_llvm-477c2ec3e01ddb67c3c079156f2ee2e1858bec42.tar.bz2
Moved getBinaryOperator to the BinaryOperator class and the getUnaryOperator
to the UnaryOperator class (from the Instruction class). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/InstrTypes.h')
-rw-r--r--include/llvm/InstrTypes.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/include/llvm/InstrTypes.h b/include/llvm/InstrTypes.h
index be6ea26..1bd7a24 100644
--- a/include/llvm/InstrTypes.h
+++ b/include/llvm/InstrTypes.h
@@ -56,13 +56,19 @@ public:
class UnaryOperator : public Instruction {
Use Source;
public:
+
+ // getUnaryOperator() - Construct a unary instruction, given the opcode
+ // and its operand.
+ //
+ static UnaryOperator *getUnaryOperator(unsigned Op, Value *Source);
+
UnaryOperator(Value *S, unsigned iType, const string &Name = "")
: Instruction(S->getType(), iType, Name), Source(S, this) {
}
inline ~UnaryOperator() { dropAllReferences(); }
virtual Instruction *clone() const {
- return Instruction::getUnaryOperator(getInstType(), Source);
+ return getUnaryOperator(getInstType(), Source);
}
virtual void dropAllReferences() {
@@ -92,6 +98,12 @@ public:
class BinaryOperator : public Instruction {
Use Source1, Source2;
public:
+
+ // getBinaryOperator() - Construct a binary instruction, given the opcode
+ // and the two operands.
+ //
+ static BinaryOperator *getBinaryOperator(unsigned Op, Value *S1, Value *S2);
+
BinaryOperator(unsigned iType, Value *S1, Value *S2,
const string &Name = "")
: Instruction(S1->getType(), iType, Name), Source1(S1, this),
@@ -101,7 +113,7 @@ public:
inline ~BinaryOperator() { dropAllReferences(); }
virtual Instruction *clone() const {
- return Instruction::getBinaryOperator(getInstType(), Source1, Source2);
+ return getBinaryOperator(getInstType(), Source1, Source2);
}
virtual void dropAllReferences() {