diff options
author | Chris Lattner <sabre@nondot.org> | 2012-02-05 02:29:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2012-02-05 02:29:43 +0000 |
commit | cf9e8f6968af1e5871b535a06a6bff45de49e4bf (patch) | |
tree | 00731766834527ed56ba142710486c79d01c875e /llvm/lib/VMCore/Core.cpp | |
parent | 2c1dd2716a07a173773ac2ba04b5f2da73a1fc6c (diff) | |
download | bcm5719-llvm-cf9e8f6968af1e5871b535a06a6bff45de49e4bf.tar.gz bcm5719-llvm-cf9e8f6968af1e5871b535a06a6bff45de49e4bf.zip |
reapply the patches reverted in r149470 that reenable ConstantDataArray,
but with a critical fix to the SelectionDAG code that optimizes copies
from strings into immediate stores: the previous code was stopping reading
string data at the first nul. Address this by adding a new argument to
llvm::getConstantStringInfo, preserving the behavior before the patch.
llvm-svn: 149800
Diffstat (limited to 'llvm/lib/VMCore/Core.cpp')
-rw-r--r-- | llvm/lib/VMCore/Core.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/VMCore/Core.cpp b/llvm/lib/VMCore/Core.cpp index ea4e95205b1..c3765465214 100644 --- a/llvm/lib/VMCore/Core.cpp +++ b/llvm/lib/VMCore/Core.cpp @@ -634,8 +634,8 @@ LLVMValueRef LLVMConstStringInContext(LLVMContextRef C, const char *Str, LLVMBool DontNullTerminate) { /* Inverted the sense of AddNull because ', 0)' is a better mnemonic for null termination than ', 1)'. */ - return wrap(ConstantArray::get(*unwrap(C), StringRef(Str, Length), - DontNullTerminate == 0)); + return wrap(ConstantDataArray::getString(*unwrap(C), StringRef(Str, Length), + DontNullTerminate == 0)); } LLVMValueRef LLVMConstStructInContext(LLVMContextRef C, LLVMValueRef *ConstantVals, |