Remove support for unary operators.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3326 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2002-08-14 18:19:46 +00:00
parent 935bb0d071
commit 9c16dba29f
4 changed files with 2 additions and 71 deletions

View File

@ -53,45 +53,6 @@ public:
};
//===----------------------------------------------------------------------===//
// UnaryOperator Class
//===----------------------------------------------------------------------===//
class UnaryOperator : public Instruction {
protected:
UnaryOperator(Value *S, UnaryOps iType, const std::string &Name = "")
: Instruction(S->getType(), iType, Name) {
Operands.reserve(1);
Operands.push_back(Use(S, this));
}
public:
// create() - Construct a unary instruction, given the opcode
// and its operand.
//
static UnaryOperator *create(UnaryOps Op, Value *Source,
const std::string &Name = "");
inline UnaryOps getOpcode() const {
return (UnaryOps)Instruction::getOpcode();
}
virtual Instruction *clone() const {
return create(getOpcode(), Operands[0]);
}
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const UnaryOperator *) { return true; }
static inline bool classof(const Instruction *I) {
return I->getOpcode() >= FirstUnaryOp && I->getOpcode() < NumUnaryOps;
}
static inline bool classof(const Value *V) {
return isa<Instruction>(V) && classof(cast<Instruction>(V));
}
};
//===----------------------------------------------------------------------===//
// BinaryOperator Class
//===----------------------------------------------------------------------===//

View File

@ -68,9 +68,6 @@ public:
inline bool isTerminator() const { // Instance of TerminatorInst?
return iType >= FirstTermOp && iType < NumTermOps;
}
inline bool isUnaryOp() const {
return iType >= FirstUnaryOp && iType < NumUnaryOps;
}
inline bool isBinaryOp() const {
return iType >= FirstBinaryOp && iType < NumBinaryOps;
}

View File

@ -9,17 +9,6 @@
#include "llvm/InstrTypes.h"
//===----------------------------------------------------------------------===//
// Class to represent Unary operators
//===----------------------------------------------------------------------===//
//
class GenericUnaryInst : public UnaryOperator {
public:
GenericUnaryInst(UnaryOps Opcode, Value *S1, const std::string &Name = "")
: UnaryOperator(S1, Opcode, Name) {
}
};
//===----------------------------------------------------------------------===//
// Classes to represent Binary operators
//===----------------------------------------------------------------------===//

View File

@ -1,28 +1,12 @@
//===-- iOperators.cpp - Implement the Binary & Unary Operators --*- C++ -*--=//
//===-- iOperators.cpp - Implement binary Operators ------------*- C++ -*--===//
//
// This file implements the nontrivial binary & unary operator instructions.
// This file implements the nontrivial binary operator instructions.
//
//===----------------------------------------------------------------------===//
#include "llvm/iOperators.h"
#include "llvm/Type.h"
#include "llvm/Constants.h"
using std::cerr;
//===----------------------------------------------------------------------===//
// UnaryOperator Class
//===----------------------------------------------------------------------===//
UnaryOperator *UnaryOperator::create(UnaryOps Op, Value *Source,
const std::string &Name) {
switch (Op) {
case Not: return new GenericUnaryInst(Op, Source, Name);
default:
cerr << "Don't know how to Create UnaryOperator " << Op << "\n";
return 0;
}
}
//===----------------------------------------------------------------------===//
// BinaryOperator Class