[llvm-commits] CVS: llvm/include/llvm/Support/PatternMatch.h
Reid Spencer
reid at x10sys.com
Sat Jan 20 16:30:00 PST 2007
Changes in directory llvm/include/llvm/Support:
PatternMatch.h updated: 1.16 -> 1.17
---
Log message:
For PR970: http://llvm.org/PR970 :
Clean up handling of isFloatingPoint() and dealing with PackedType.
Patch by Gordon Henriksen!
---
Diffs of the changes: (+0 -31)
PatternMatch.h | 31 -------------------------------
1 files changed, 31 deletions(-)
Index: llvm/include/llvm/Support/PatternMatch.h
diff -u llvm/include/llvm/Support/PatternMatch.h:1.16 llvm/include/llvm/Support/PatternMatch.h:1.17
--- llvm/include/llvm/Support/PatternMatch.h:1.16 Thu Jan 11 06:24:13 2007
+++ llvm/include/llvm/Support/PatternMatch.h Sat Jan 20 18:29:25 2007
@@ -306,37 +306,6 @@
//
template<typename LHS_t>
-struct neg_match {
- LHS_t L;
-
- neg_match(const LHS_t &LHS) : L(LHS) {}
-
- template<typename OpTy>
- bool match(OpTy *V) {
- if (Instruction *I = dyn_cast<Instruction>(V))
- if (I->getOpcode() == Instruction::Sub)
- return matchIfNeg(I->getOperand(0), I->getOperand(1));
- if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V))
- if (CE->getOpcode() == Instruction::Sub)
- return matchIfNeg(CE->getOperand(0), CE->getOperand(1));
- if (ConstantInt *CI = dyn_cast<ConstantInt>(V))
- return L.match(ConstantExpr::getNeg(CI));
- return false;
- }
-private:
- bool matchIfNeg(Value *LHS, Value *RHS) {
- if (!LHS->getType()->isFloatingPoint())
- return LHS == Constant::getNullValue(LHS->getType()) && L.match(RHS);
- else
- return LHS == ConstantFP::get(LHS->getType(), -0.0) && L.match(RHS);
- }
-};
-
-template<typename LHS>
-inline neg_match<LHS> m_Neg(const LHS &L) { return L; }
-
-
-template<typename LHS_t>
struct not_match {
LHS_t L;
More information about the llvm-commits
mailing list