[llvm-commits] CVS: llvm/include/llvm/Constants.h
Chris Lattner
lattner at cs.uiuc.edu
Wed May 14 12:51:01 PDT 2003
Changes in directory llvm/include/llvm:
Constants.h updated: 1.21 -> 1.22
---
Log message:
Add some methods to make type safety a bit easier
---
Diffs of the changes:
Index: llvm/include/llvm/Constants.h
diff -u llvm/include/llvm/Constants.h:1.21 llvm/include/llvm/Constants.h:1.22
--- llvm/include/llvm/Constants.h:1.21 Wed Apr 16 17:40:43 2003
+++ llvm/include/llvm/Constants.h Wed May 14 12:49:52 2003
@@ -506,6 +506,15 @@
virtual void destroyConstant();
virtual void replaceUsesOfWithOnConstant(Value *From, Value *To);
+ /// Override methods to provide more type information...
+ inline Constant *getOperand(unsigned i) {
+ return cast<Constant>(User::getOperand(i));
+ }
+ inline Constant *getOperand(unsigned i) const {
+ return const_cast<Constant*>(cast<Constant>(User::getOperand(i)));
+ }
+
+
/// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const ConstantExpr *) { return true; }
static inline bool classof(const Constant *CPV) {
More information about the llvm-commits
mailing list