aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Operator.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/llvm/Operator.h b/include/llvm/Operator.h
index c62164bcbc..6057c4b877 100644
--- a/include/llvm/Operator.h
+++ b/include/llvm/Operator.h
@@ -20,6 +20,8 @@
namespace llvm {
+class GetElementPtrInst;
+
/// Operator - This is a utility class that provides an abstraction for the
/// common functionality between Instructions and ConstantExprs.
///
@@ -242,7 +244,7 @@ public:
return I->getOpcode() == Instruction::GetElementPtr;
}
static inline bool classof(const Value *V) {
- return isa<GetElementPtrInst>(V) ||
+ return (isa<Instruction>(V) && classof(cast<Instruction>(V))) ||
(isa<ConstantExpr>(V) && classof(cast<ConstantExpr>(V)));
}
};