[llvm-commits] [llvm] r78681 - /llvm/trunk/include/llvm/Operator.h
Dan Gohman
gohman at apple.com
Tue Aug 11 10:03:18 PDT 2009
Author: djg
Date: Tue Aug 11 12:03:18 2009
New Revision: 78681
URL: http://llvm.org/viewvc/llvm-project?rev=78681&view=rev
Log:
Avoid implicitly depending on Instructions.h.
Modified:
llvm/trunk/include/llvm/Operator.h
Modified: llvm/trunk/include/llvm/Operator.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Operator.h?rev=78681&r1=78680&r2=78681&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Operator.h (original)
+++ llvm/trunk/include/llvm/Operator.h Tue Aug 11 12:03:18 2009
@@ -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 @@
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)));
}
};
More information about the llvm-commits
mailing list