summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-05-14 17:49:52 +0000
committerChris Lattner <sabre@nondot.org>2003-05-14 17:49:52 +0000
commitf2bef422e481b890feb1dd6f6b37d7dc96dc7a83 (patch)
treed33cb5eeea24182d172532324daea9e9c236a396 /llvm
parent70694cba0afa82753537508b09375dda952dd255 (diff)
downloadbcm5719-llvm-f2bef422e481b890feb1dd6f6b37d7dc96dc7a83.tar.gz
bcm5719-llvm-f2bef422e481b890feb1dd6f6b37d7dc96dc7a83.zip
Add some methods to make type safety a bit easier
llvm-svn: 6198
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Constants.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/include/llvm/Constants.h b/llvm/include/llvm/Constants.h
index 396a5ca0930..7c0a00506af 100644
--- a/llvm/include/llvm/Constants.h
+++ b/llvm/include/llvm/Constants.h
@@ -506,6 +506,15 @@ public:
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) {
OpenPOWER on IntegriCloud