summaryrefslogtreecommitdiff
path: root/lib/VMCore
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-07-08 19:03:27 +0000
committerChris Lattner <sabre@nondot.org>2001-07-08 19:03:27 +0000
commit71496b3b50cfcba84eb4acd988ce88a4463e4515 (patch)
treebc0590b1a998d42ac95c3671c79d993030e193e1 /lib/VMCore
parent72f1e9929a086346d4f8a8105f30ff1ac78f691b (diff)
downloadllvm-71496b3b50cfcba84eb4acd988ce88a4463e4515.tar.gz
llvm-71496b3b50cfcba84eb4acd988ce88a4463e4515.tar.bz2
llvm-71496b3b50cfcba84eb4acd988ce88a4463e4515.tar.xz
Moved Cast from being a Unary instruction to being an "Other" instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/iOperators.cpp27
1 files changed, 18 insertions, 9 deletions
diff --git a/lib/VMCore/iOperators.cpp b/lib/VMCore/iOperators.cpp
index 6f7c2f158e..22b6052d46 100644
--- a/lib/VMCore/iOperators.cpp
+++ b/lib/VMCore/iOperators.cpp
@@ -1,24 +1,30 @@
-//===-- iBinaryOperators.cpp - Implement the BinaryOperators -----*- C++ -*--=//
+//===-- iOperators.cpp - Implement the Binary & Unary Operators --*- C++ -*--=//
//
-// This file implements the nontrivial binary operator instructions.
+// This file implements the nontrivial binary & unary operator instructions.
//
//===----------------------------------------------------------------------===//
-#include "llvm/iBinary.h"
+#include "llvm/iOperators.h"
#include "llvm/Type.h"
-UnaryOperator *UnaryOperator::create(UnaryOps Op, Value *Source,
- const Type *DestTy = 0) {
- if (DestTy == 0) DestTy = Source->getType();
+//===----------------------------------------------------------------------===//
+// UnaryOperator Class
+//===----------------------------------------------------------------------===//
+
+UnaryOperator *UnaryOperator::create(UnaryOps Op, Value *Source) {
switch (Op) {
- case Not: assert(DestTy == Source->getType());
- case Cast: return new GenericUnaryInst(Op, Source, DestTy);
+ case Not: return new GenericUnaryInst(Op, Source);
default:
- cerr << "Don't know how to GetUnaryOperator " << Op << endl;
+ cerr << "Don't know how to Create UnaryOperator " << Op << endl;
return 0;
}
}
+
+//===----------------------------------------------------------------------===//
+// GenericUnaryOperator Class
+//===----------------------------------------------------------------------===//
+
const char *GenericUnaryInst::getOpcodeName() const {
switch (getOpcode()) {
case Not: return "not";
@@ -29,6 +35,7 @@ const char *GenericUnaryInst::getOpcodeName() const {
}
}
+
//===----------------------------------------------------------------------===//
// BinaryOperator Class
//===----------------------------------------------------------------------===//
@@ -46,6 +53,7 @@ BinaryOperator *BinaryOperator::create(BinaryOps Op, Value *S1, Value *S2,
}
}
+
//===----------------------------------------------------------------------===//
// GenericBinaryInst Class
//===----------------------------------------------------------------------===//
@@ -69,6 +77,7 @@ const char *GenericBinaryInst::getOpcodeName() const {
}
}
+
//===----------------------------------------------------------------------===//
// SetCondInst Class
//===----------------------------------------------------------------------===//