aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-08-11 17:03:18 +0000
committerDan Gohman <gohman@apple.com>2009-08-11 17:03:18 +0000
commitd30658c3ffd1e33e98b82750202a9375bf5963ed (patch)
tree1e95fc5e16be21dca49f37899000a7c7be15693d
parent02552decf9af871701d869e626ffdfe7d6171715 (diff)
downloadexternal_llvm-d30658c3ffd1e33e98b82750202a9375bf5963ed.zip
external_llvm-d30658c3ffd1e33e98b82750202a9375bf5963ed.tar.gz
external_llvm-d30658c3ffd1e33e98b82750202a9375bf5963ed.tar.bz2
Avoid implicitly depending on Instructions.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78681 91177308-0d34-0410-b5e6-96231b3b80d8
-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 c62164b..6057c4b 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)));
}
};