Fix build on old compilers
[oota-llvm.git] / include / llvm / Constants.h
index ef2c839adc22cd6eb264e8eb730e3f6c1b0e683d..cce4d49d1fbaf7fea9c330d1a7fb456c9fc2395e 100644 (file)
@@ -58,7 +58,7 @@ public:
   /// type.
   inline uint64_t getZExtValue() const {
     unsigned Size = getType()->getPrimitiveSizeInBits();
-    return Val.Unsigned & (~0ULL >> (64-Size));
+    return Val.Unsigned & (~uint64_t(0UL) >> (64-Size));
   }
 
   /// getSExtValue - Return the constant sign extended as appropriate for this
@@ -345,7 +345,14 @@ protected:
 public:
   /// get() - Static factory methods - Return objects of the specified value
   static Constant *get(const ArrayType *T, const std::vector<Constant*> &);
-  static Constant *get(const std::string &Initializer);
+
+  /// This method constructs a ConstantArray and initializes it with a text
+  /// string. The default behavior (AddNull==true) causes a null terminator to
+  /// be placed at the end of the array. This effectively increases the length
+  /// of the array by one (you've been warned).  However, in some situations 
+  /// this is not desired so if AddNull==false then the string is copied without
+  /// null termination. 
+  static Constant *get(const std::string &Initializer, bool AddNull = true);
 
   /// getType - Specialize the getType() method to always return an ArrayType,
   /// which reduces the amount of casting needed in parts of the compiler.