aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-05-27 22:13:20 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-05-27 22:13:20 +0000
commitb0dd6702ab5e7f53a4bdab5a3371285ad2a4b20b (patch)
treea3bb3f91414c8ea38818b41207cfbe931a7d3e29 /lib/CodeGen/CodeGenModule.cpp
parentaddd80d1c80d1e9f249988452103c93a564945f0 (diff)
Match llvm-gcc's string literals alignment by forcing alignment on string literals to 1. This can significantly impact the size of the string data, and as far as I know, the alignment doesn't help performance. rdar://9078969 .
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132223 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index 987ebffd97..de11a29f67 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -1899,6 +1899,7 @@ static llvm::Constant *GenerateStringLiteral(llvm::StringRef str,
new llvm::GlobalVariable(CGM.getModule(), C->getType(), constant,
llvm::GlobalValue::PrivateLinkage,
C, GlobalName);
+ GV->setAlignment(1);
GV->setUnnamedAddr(true);
return GV;
}