diff --git a/include/llvm/InstrTypes.h b/include/llvm/InstrTypes.h index 1d3bae6c7d6..6f71710e84b 100644 --- a/include/llvm/InstrTypes.h +++ b/include/llvm/InstrTypes.h @@ -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(V) && classof(cast(V)); - } -}; - - - //===----------------------------------------------------------------------===// // BinaryOperator Class //===----------------------------------------------------------------------===// diff --git a/include/llvm/Instruction.h b/include/llvm/Instruction.h index 2e5bcdaed22..41be312853f 100644 --- a/include/llvm/Instruction.h +++ b/include/llvm/Instruction.h @@ -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; } diff --git a/include/llvm/iOperators.h b/include/llvm/iOperators.h index f9fc88ac41a..ba64b0faec1 100644 --- a/include/llvm/iOperators.h +++ b/include/llvm/iOperators.h @@ -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 //===----------------------------------------------------------------------===// diff --git a/lib/VMCore/iOperators.cpp b/lib/VMCore/iOperators.cpp index f520ff52f5b..5b8c26a0d10 100644 --- a/lib/VMCore/iOperators.cpp +++ b/lib/VMCore/iOperators.cpp @@ -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