PR10210: New method ConstantArray::getAsCString(). Use it in LTO to

avoid getting embedded trailing null bytes in std::strings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133999 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jay Foad
2011-06-28 08:24:19 +00:00
parent 4086bb5ba5
commit 4f91054fe4
3 changed files with 30 additions and 9 deletions

View File

@@ -387,6 +387,12 @@ public:
///
std::string getAsString() const;
/// getAsCString - If this array is isCString(), then this method converts the
/// array (without the trailing null byte) to an std::string and returns it.
/// Otherwise, it asserts out.
///
std::string getAsCString() const;
/// isNullValue - Return true if this is the value that would be returned by
/// getNullValue. This always returns false because zero arrays are always
/// created as ConstantAggregateZero objects.