From b9f709665a6fe9da5c67d0431de2e63c55dd5322 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 1 Feb 2010 20:59:08 +0000 Subject: Don't explicitly force utf strings into the __TEXT,__ustring by setting the section of the generated global. This is an optimization done by the code generator, and the code being removed didn't handle the case when the string contained an embedded nul (which the code generator does correctly handle). This is rdar://7589850 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95003 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'lib/CodeGen/CodeGenModule.cpp') diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 84a3c318e5..28a808bd83 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -1480,11 +1480,9 @@ CodeGenModule::GetAddrOfConstantCFString(const StringLiteral *Literal) { // String pointer. llvm::Constant *C = llvm::ConstantArray::get(VMContext, Entry.getKey().str()); - const char *Sect = 0; llvm::GlobalValue::LinkageTypes Linkage; bool isConstant; if (isUTF16) { - Sect = getContext().Target.getUnicodeStringSection(); // FIXME: why do utf strings get "_" labels instead of "L" labels? Linkage = llvm::GlobalValue::InternalLinkage; // Note: -fwritable-strings doesn't make unicode CFStrings writable, but @@ -1498,8 +1496,6 @@ CodeGenModule::GetAddrOfConstantCFString(const StringLiteral *Literal) { llvm::GlobalVariable *GV = new llvm::GlobalVariable(getModule(), C->getType(), isConstant, Linkage, C, ".str"); - if (Sect) - GV->setSection(Sect); if (isUTF16) { CharUnits Align = getContext().getTypeAlignInChars(getContext().ShortTy); GV->setAlignment(Align.getQuantity()); -- cgit v1.2.3-70-g09d2