summaryrefslogtreecommitdiff
path: root/include/llvm/IR/Operator.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/IR/Operator.h')
-rw-r--r--include/llvm/IR/Operator.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/llvm/IR/Operator.h b/include/llvm/IR/Operator.h
index 6eb5998478c65..c7f4697e93e74 100644
--- a/include/llvm/IR/Operator.h
+++ b/include/llvm/IR/Operator.h
@@ -328,8 +328,15 @@ public:
return I->getType()->isFPOrFPVectorTy() ||
I->getOpcode() == Instruction::FCmp;
}
+
+ static inline bool classof(const ConstantExpr *CE) {
+ return CE->getType()->isFPOrFPVectorTy() ||
+ CE->getOpcode() == Instruction::FCmp;
+ }
+
static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
+ return (isa<Instruction>(V) && classof(cast<Instruction>(V))) ||
+ (isa<ConstantExpr>(V) && classof(cast<ConstantExpr>(V)));
}
};