mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-15 19:24:33 +00:00
Neg instruction removed. Cast instruction implemented.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -7,6 +7,32 @@
|
||||
#include "llvm/iBinary.h"
|
||||
#include "llvm/Type.h"
|
||||
|
||||
UnaryOperator *UnaryOperator::create(UnaryOps Op, Value *Source,
|
||||
const Type *DestTy = 0) {
|
||||
if (DestTy == 0) DestTy = Source->getType();
|
||||
switch (Op) {
|
||||
case Not: assert(DestTy == Source->getType());
|
||||
case Cast: return new GenericUnaryInst(Op, Source, DestTy);
|
||||
default:
|
||||
cerr << "Don't know how to GetUnaryOperator " << Op << endl;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
const char *GenericUnaryInst::getOpcodeName() const {
|
||||
switch (getOpcode()) {
|
||||
case Not: return "not";
|
||||
case Cast: return "cast";
|
||||
default:
|
||||
cerr << "Invalid unary operator type!" << getOpcode() << endl;
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// BinaryOperator Class
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
BinaryOperator *BinaryOperator::create(BinaryOps Op, Value *S1, Value *S2,
|
||||
const string &Name) {
|
||||
switch (Op) {
|
||||
@@ -20,6 +46,10 @@ BinaryOperator *BinaryOperator::create(BinaryOps Op, Value *S1, Value *S2,
|
||||
}
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// GenericBinaryInst Class
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
const char *GenericBinaryInst::getOpcodeName() const {
|
||||
switch (getOpcode()) {
|
||||
// Standard binary operators...
|
||||
@@ -35,7 +65,7 @@ const char *GenericBinaryInst::getOpcodeName() const {
|
||||
case Xor: return "xor";
|
||||
default:
|
||||
cerr << "Invalid binary operator type!" << getOpcode() << endl;
|
||||
return 0;
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user