commit | 552f3d8472bff7068e626305c25419dbcc33e7b7 | [log] [tgz] |
---|---|---|
author | Pete Cooper <peter_cooper@apple.com> | Wed Mar 23 21:49:31 2016 +0000 |
committer | Pete Cooper <peter_cooper@apple.com> | Wed Mar 23 21:49:31 2016 +0000 |
tree | d254d2b34a76a05704f1ac938322f9f7626ed9ff | |
parent | 222f9e97f6d01fd83c197e4ea897db6b4db6a995 [diff] |
StringRef::copy shouldn't allocate anything for length 0 strings. The BumpPtrAllocator currently doesn't handle zero length allocations well. The discussion for how to fix that is ongoing. However, there's no need for StringRef::copy to actually allocate anything here anyway, so just return StringRef() when we get a zero length copy. Reviewed by David Blaikie git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264201 91177308-0d34-0410-b5e6-96231b3b80d8