UnaryOperator::create should take a name just like BinaryOperator::create

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3279 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2002-08-09 21:39:38 +00:00
parent 035dfbe7f2
commit dc1e020444
2 changed files with 5 additions and 14 deletions

View 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();

View 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
//===----------------------------------------------------------------------===//