diff options
author | Chris Lattner <sabre@nondot.org> | 2003-05-14 17:49:52 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-05-14 17:49:52 +0000 |
commit | 17aefb168fb2cfffcbd7131d1529a90ae1831b1c (patch) | |
tree | f77fed0245b2e63622f1ea63086bdb64bb220b1a /include | |
parent | 2434a58dcf0a5662d5fba7436c810c67879a7bb3 (diff) | |
download | external_llvm-17aefb168fb2cfffcbd7131d1529a90ae1831b1c.zip external_llvm-17aefb168fb2cfffcbd7131d1529a90ae1831b1c.tar.gz external_llvm-17aefb168fb2cfffcbd7131d1529a90ae1831b1c.tar.bz2 |
Add some methods to make type safety a bit easier
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6198 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Constants.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h index 396a5ca..7c0a005 100644 --- a/include/llvm/Constants.h +++ b/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) { |