summaryrefslogtreecommitdiff
path: root/include/llvm/Constants.h
diff options
context:
space:
mode:
authorJay Foad <jay.foad@gmail.com>2011-06-28 08:24:19 +0000
committerJay Foad <jay.foad@gmail.com>2011-06-28 08:24:19 +0000
commit4f91054fe4a593f23b46abe359d2df9aebc50f10 (patch)
treefd9004ff73f3cca95b24004144ac96b7b65b286a /include/llvm/Constants.h
parent4086bb5ba58ed83dba4991599c00bfba34693d3a (diff)
downloadllvm-4f91054fe4a593f23b46abe359d2df9aebc50f10.tar.gz
llvm-4f91054fe4a593f23b46abe359d2df9aebc50f10.tar.bz2
llvm-4f91054fe4a593f23b46abe359d2df9aebc50f10.tar.xz
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
Diffstat (limited to 'include/llvm/Constants.h')
-rw-r--r--include/llvm/Constants.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h
index ff599512e6..1afbb8a96d 100644
--- a/include/llvm/Constants.h
+++ b/include/llvm/Constants.h
@@ -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.