UnaryOperator::create should take a name just like BinaryOperator::create
authorChris Lattner <sabre@nondot.org>
Fri, 9 Aug 2002 21:39:38 +0000 (21:39 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 9 Aug 2002 21:39:38 +0000 (21:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3279 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 9a28d64fb9c057894c7f33fd94500491a3bae8f5..8d1b5f1230dce8e8353c67a28e36c7d90f28a951 100644 (file)
@@ -69,7 +69,8 @@ public:
   // create() - Construct a unary instruction, given the opcode
   // and its operand.
   //
-  static UnaryOperator *create(UnaryOps Op, Value *Source);
+  static UnaryOperator *create(UnaryOps Op, Value *Source,
+                               const std::string &Name = "");
 
   inline UnaryOps getOpcode() const { 
     return (UnaryOps)Instruction::getOpcode();
index 75cac7d59d5a1a8797077552f3f0caa41cfc502a..bc37df5cb7f1bb03fde0d477c41ff4d3384ed2cc 100644 (file)
@@ -6,16 +6,16 @@
 
 #include "llvm/iOperators.h"
 #include "llvm/Type.h"
-#include <iostream>
 using std::cerr;
 
 //===----------------------------------------------------------------------===//
 //                              UnaryOperator Class
 //===----------------------------------------------------------------------===//
 
-UnaryOperator *UnaryOperator::create(UnaryOps Op, Value *Source) {
+UnaryOperator *UnaryOperator::create(UnaryOps Op, Value *Source,
+                                     const std::string &Name) {
   switch (Op) {
-  case Not:  return new GenericUnaryInst(Op, Source);
+  case Not:  return new GenericUnaryInst(Op, Source, Name);
   default:
     cerr << "Don't know how to Create UnaryOperator " << Op << "\n";
     return 0;
@@ -23,11 +23,6 @@ UnaryOperator *UnaryOperator::create(UnaryOps Op, Value *Source) {
 }
 
 
-//===----------------------------------------------------------------------===//
-//                           GenericUnaryOperator Class
-//===----------------------------------------------------------------------===//
-
-
 //===----------------------------------------------------------------------===//
 //                             BinaryOperator Class
 //===----------------------------------------------------------------------===//
@@ -72,11 +67,6 @@ bool BinaryOperator::swapOperands() {
 }
 
 
-//===----------------------------------------------------------------------===//
-//                            GenericBinaryInst Class
-//===----------------------------------------------------------------------===//
-
-
 //===----------------------------------------------------------------------===//
 //                             SetCondInst Class
 //===----------------------------------------------------------------------===//