summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-02-01 20:59:08 +0000
committerChris Lattner <sabre@nondot.org>2010-02-01 20:59:08 +0000
commit5b5d2db3f6030878d79424e85eb16ff5a329b8dd (patch)
tree7500d0226631a3625ac3516f02248d2f877559d2 /clang/lib/CodeGen/CodeGenModule.cpp
parent180334e13fe8b81b950be7e84e42e4ec4d9c2481 (diff)
downloadbcm5719-llvm-5b5d2db3f6030878d79424e85eb16ff5a329b8dd.tar.gz
bcm5719-llvm-5b5d2db3f6030878d79424e85eb16ff5a329b8dd.zip
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 llvm-svn: 95003
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp4
1 files changed, 0 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 84a3c318e52..28a808bd835 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/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());
OpenPOWER on IntegriCloud