Remove support for unary operators.
authorChris Lattner <sabre@nondot.org>
Wed, 14 Aug 2002 18:19:46 +0000 (18:19 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 14 Aug 2002 18:19:46 +0000 (18:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3326 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/InstrTypes.h
include/llvm/Instruction.h
include/llvm/iOperators.h
lib/VMCore/iOperators.cpp

index 1d3bae6c7d61f6bc6bda39dae902e52da2dcb3e6..6f71710e84bd9e2df5db9ff40bfce7f38dcfe75f 100644 (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
 //===----------------------------------------------------------------------===//
index 2e5bcdaed225255ec1bb37c54842821b7f47da5e..41be312853f377fac0d6a1bf5c0c38362276e436 100644 (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;
   }
index f9fc88ac41a85a2198a35fffa1bee96dc39e7f25..ba64b0faec1ffffd74b13153d2d79627cb399aa2 100644 (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
 //===----------------------------------------------------------------------===//
index f520ff52f5b0859d678389ed3ad922039c77c1bc..5b8c26a0d10598f021cc9ccf9a23d2cac3da2aea 100644 (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