summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/ConstantHandling.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-08-14 17:52:06 +0000
committerChris Lattner <sabre@nondot.org>2002-08-14 17:52:06 +0000
commit4ec79c3e6f1a3ea125ed95da5f83d6ab9d5d1b4f (patch)
treece90a4bfccfbdf7c13cce5641249a9dd47fec736 /llvm/lib/VMCore/ConstantHandling.cpp
parent31ae86328422917f4135f1d7aafc2429245e2ea7 (diff)
downloadbcm5719-llvm-4ec79c3e6f1a3ea125ed95da5f83d6ab9d5d1b4f.tar.gz
bcm5719-llvm-4ec79c3e6f1a3ea125ed95da5f83d6ab9d5d1b4f.zip
Remove support forNOT instruction
llvm-svn: 3316
Diffstat (limited to 'llvm/lib/VMCore/ConstantHandling.cpp')
-rw-r--r--llvm/lib/VMCore/ConstantHandling.cpp21
1 files changed, 0 insertions, 21 deletions
diff --git a/llvm/lib/VMCore/ConstantHandling.cpp b/llvm/lib/VMCore/ConstantHandling.cpp
index 078dffdf83b..5115ede9a1f 100644
--- a/llvm/lib/VMCore/ConstantHandling.cpp
+++ b/llvm/lib/VMCore/ConstantHandling.cpp
@@ -47,7 +47,6 @@ Constant *ConstantFoldInstruction(Instruction *I) {
switch (I->getOpcode()) {
case Instruction::Cast:
return ConstRules::get(*Op0)->castTo(Op0, I->getType());
- case Instruction::Not: return ~*Op0;
case Instruction::Add: return *Op0 + *Op1;
case Instruction::Sub: return *Op0 - *Op1;
case Instruction::Mul: return *Op0 * *Op1;
@@ -74,13 +73,6 @@ Constant *ConstantFoldCastInstruction(const Constant *V, const Type *DestTy) {
return ConstRules::get(*V)->castTo(V, DestTy);
}
-Constant *ConstantFoldUnaryInstruction(unsigned Opcode, const Constant *V) {
- switch (Opcode) {
- case Instruction::Not: return ~*V;
- }
- return 0;
-}
-
Constant *ConstantFoldBinaryInstruction(unsigned Opcode, const Constant *V1,
const Constant *V2) {
switch (Opcode) {
@@ -132,10 +124,6 @@ class TemplateRules : public ConstRules {
// Redirecting functions that cast to the appropriate types
//===--------------------------------------------------------------------===//
- virtual Constant *op_not(const Constant *V) const {
- return SubClassName::Not((const ArgType *)V);
- }
-
virtual Constant *add(const Constant *V1, const Constant *V2) const {
return SubClassName::Add((const ArgType *)V1, (const ArgType *)V2);
}
@@ -215,8 +203,6 @@ class TemplateRules : public ConstRules {
// Default "noop" implementations
//===--------------------------------------------------------------------===//
- static Constant *Not(const ArgType *V) { return 0; }
-
static Constant *Add(const ArgType *V1, const ArgType *V2) { return 0; }
static Constant *Sub(const ArgType *V1, const ArgType *V2) { return 0; }
static Constant *Mul(const ArgType *V1, const ArgType *V2) { return 0; }
@@ -268,10 +254,6 @@ struct EmptyRules : public TemplateRules<Constant, EmptyRules> {
//
struct BoolRules : public TemplateRules<ConstantBool, BoolRules> {
- static Constant *Not(const ConstantBool *V) {
- return ConstantBool::get(!V->getValue());
- }
-
static Constant *And(const ConstantBool *V1, const ConstantBool *V2) {
return ConstantBool::get(V1->getValue() & V2->getValue());
}
@@ -425,9 +407,6 @@ template <class ConstantClass, class BuiltinType, Type **Ty>
struct DirectIntRules
: public DirectRules<ConstantClass, BuiltinType, Ty,
DirectIntRules<ConstantClass, BuiltinType, Ty> > {
- static Constant *Not(const ConstantClass *V) {
- return ConstantClass::get(*Ty, ~(BuiltinType)V->getValue());;
- }
static Constant *Rem(const ConstantClass *V1,
const ConstantClass *V2) {
OpenPOWER on IntegriCloud