[llvm-commits] CVS: llvm/include/llvm/Constants.h

Chris Lattner lattner at cs.uiuc.edu
Sat Oct 16 11:06:36 PDT 2004



Changes in directory llvm/include/llvm:

Constants.h updated: 1.59 -> 1.60
---
Log message:

Add new UndefValue class


---
Diffs of the changes:  (+31 -0)

Index: llvm/include/llvm/Constants.h
diff -u llvm/include/llvm/Constants.h:1.59 llvm/include/llvm/Constants.h:1.60
--- llvm/include/llvm/Constants.h:1.59	Tue Oct 12 23:44:53 2004
+++ llvm/include/llvm/Constants.h	Sat Oct 16 13:05:25 2004
@@ -626,6 +626,37 @@
   }
 };
 
+
+//===----------------------------------------------------------------------===//
+/// 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






More information about the llvm-commits mailing list