summaryrefslogtreecommitdiff
path: root/lib/VMCore/IRBuilder.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2012-02-05 02:29:43 +0000
committerChris Lattner <sabre@nondot.org>2012-02-05 02:29:43 +0000
commit18c7f80b3e83ab584bd8572695a3cde8bafd9d3c (patch)
tree93b57cd1b5fb8fa1e48c06e4bef7571f02603243 /lib/VMCore/IRBuilder.cpp
parenteea723fe02edba0a1215fa235ba425ae93202dc9 (diff)
downloadllvm-18c7f80b3e83ab584bd8572695a3cde8bafd9d3c.tar.gz
llvm-18c7f80b3e83ab584bd8572695a3cde8bafd9d3c.tar.bz2
llvm-18c7f80b3e83ab584bd8572695a3cde8bafd9d3c.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149800 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/IRBuilder.cpp')
-rw-r--r--lib/VMCore/IRBuilder.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/VMCore/IRBuilder.cpp b/lib/VMCore/IRBuilder.cpp
index 0994394aef..b45923489a 100644
--- a/lib/VMCore/IRBuilder.cpp
+++ b/lib/VMCore/IRBuilder.cpp
@@ -24,7 +24,7 @@ using namespace llvm;
/// specified. If Name is specified, it is the name of the global variable
/// created.
Value *IRBuilderBase::CreateGlobalString(StringRef Str, const Twine &Name) {
- Constant *StrConstant = ConstantArray::get(Context, Str, true);
+ Constant *StrConstant = ConstantDataArray::getString(Context, Str);
Module &M = *BB->getParent()->getParent();
GlobalVariable *GV = new GlobalVariable(M, StrConstant->getType(),
true, GlobalValue::PrivateLinkage,