diff options
author | Chris Lattner <sabre@nondot.org> | 2004-10-16 18:05:25 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-10-16 18:05:25 +0000 |
commit | e1e922e09007f15aa01b438e5cf6a69c5a67afe4 (patch) | |
tree | a421d4a80bdeba6cbafd0e1cac007802bc1d0d40 /include | |
parent | 58fa09947587b091f59a69373392b07709bd30b8 (diff) | |
download | external_llvm-e1e922e09007f15aa01b438e5cf6a69c5a67afe4.zip external_llvm-e1e922e09007f15aa01b438e5cf6a69c5a67afe4.tar.gz external_llvm-e1e922e09007f15aa01b438e5cf6a69c5a67afe4.tar.bz2 |
Add new UndefValue class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17035 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Constants.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h index 5cfcf1d..6a59cfa 100644 --- a/include/llvm/Constants.h +++ b/include/llvm/Constants.h @@ -626,6 +626,37 @@ public: } }; + +//===----------------------------------------------------------------------===// +/// UndefValue - 'undef' values are things that do not have specified contents. +/// These are used for a variety of purposes, including global variable +/// initializers and operands to instructions. 'undef' values can occur with +/// any type. +/// +class UndefValue : public Constant { + friend struct ConstantCreator<UndefValue, Type, char>; + UndefValue(const UndefValue &); // DO NOT IMPLEMENT +protected: + UndefValue(const Type *T) : Constant(T, UndefValueVal) {} +public: + /// get() - Static factory methods - Return an 'undef' object of the specified + /// type. + /// + static UndefValue *get(const Type *T); + + /// isNullValue - Return true if this is the value that would be returned by + /// getNullValue. + virtual bool isNullValue() const { return false; } + + virtual void destroyConstant(); + + /// Methods for support type inquiry through isa, cast, and dyn_cast: + static inline bool classof(const UndefValue *) { return true; } + static bool classof(const Value *V) { + return V->getValueType() == UndefValueVal; + } +}; + } // End llvm namespace #endif |