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

Reid Spencer reid at x10sys.com
Tue May 30 11:15:20 PDT 2006



Changes in directory llvm/include/llvm:

Constants.h updated: 1.82 -> 1.83
---
Log message:

Provide a simpler interface for getting a ConstantArray from a character
string. Instead of specifying the length, just specify whether the user
wants a terminating null or not. The default is "true" to retain the same
behavior as previously provided by this function.


---
Diffs of the changes:  (+6 -6)

 Constants.h |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)


Index: llvm/include/llvm/Constants.h
diff -u llvm/include/llvm/Constants.h:1.82 llvm/include/llvm/Constants.h:1.83
--- llvm/include/llvm/Constants.h:1.82	Tue May 30 03:26:13 2006
+++ llvm/include/llvm/Constants.h	Tue May 30 13:15:07 2006
@@ -347,12 +347,12 @@
   static Constant *get(const ArrayType *T, const std::vector<Constant*> &);
 
   /// This method constructs a ConstantArray and initializes it with a text
-  /// string. The default behavior (len==0) causes the null terminator to
-  /// be copied as well. However, in some situations this is not desired so
-  /// if len <= Initializer.length() (but not 0) then only that portion of
-  /// the string is copied and there is no null termination. If len >
-  /// than Initializer's length then the function asserts out (don't do that).
-  static Constant *get(const std::string &Initializer, unsigned len = 0);
+  /// 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.






More information about the llvm-commits mailing list