From a11b35a9b0583946780aa2e774f775362db33fdd Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Wed, 1 Feb 2012 06:36:49 +0000 Subject: Revert r149363 which was part a series of commits that were reverted in llvm commit 149470. This fixes test/CodeGen/PR3589-freestanding-libcalls.c. Original log: ConstantArray::get() (for strings) is going away, use ConstantDataArray::getString instead. Many instances of ConstantArray::get() could be moved to use more efficient ConstantDataArray methods that avoid a ton of intermediate Constant*'s for each element (e.g. GetConstantArrayFromStringLiteral). I don't plan on doing this in the short-term though. llvm-svn: 149477 --- clang/lib/CodeGen/CGObjCGNU.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CGObjCGNU.cpp') diff --git a/clang/lib/CodeGen/CGObjCGNU.cpp b/clang/lib/CodeGen/CGObjCGNU.cpp index 82c478d4feb..4911e0e2973 100644 --- a/clang/lib/CodeGen/CGObjCGNU.cpp +++ b/clang/lib/CodeGen/CGObjCGNU.cpp @@ -186,7 +186,7 @@ protected: std::string name = prefix + Str; llvm::Constant *ConstStr = TheModule.getGlobalVariable(name); if (!ConstStr) { - llvm::Constant *value = llvm::ConstantDataArray::getString(VMContext,Str); + llvm::Constant *value = llvm::ConstantArray::get(VMContext, Str, true); ConstStr = new llvm::GlobalVariable(TheModule, value->getType(), true, llvm::GlobalValue::LinkOnceODRLinkage, value, prefix + Str); } -- cgit v1.2.3