diff options
author | Jay Foad <jay.foad@gmail.com> | 2011-06-28 08:24:19 +0000 |
---|---|---|
committer | Jay Foad <jay.foad@gmail.com> | 2011-06-28 08:24:19 +0000 |
commit | 4f91054fe4a593f23b46abe359d2df9aebc50f10 (patch) | |
tree | fd9004ff73f3cca95b24004144ac96b7b65b286a /include/llvm/Constants.h | |
parent | 4086bb5ba58ed83dba4991599c00bfba34693d3a (diff) | |
download | external_llvm-4f91054fe4a593f23b46abe359d2df9aebc50f10.zip external_llvm-4f91054fe4a593f23b46abe359d2df9aebc50f10.tar.gz external_llvm-4f91054fe4a593f23b46abe359d2df9aebc50f10.tar.bz2 |
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.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h index ff59951..1afbb8a 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. |