Avoid implicitly depending on Instructions.h.
authorDan Gohman <gohman@apple.com>
Tue, 11 Aug 2009 17:03:18 +0000 (17:03 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 11 Aug 2009 17:03:18 +0000 (17:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78681 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Operator.h

index c62164bcbcea4bb3af1a033c98a16e4292e594d6..6057c4b877b29dcb5ba5964831fa9970e4909f73 100644 (file)
@@ -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)));
   }
 };