From b0dd6702ab5e7f53a4bdab5a3371285ad2a4b20b Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Fri, 27 May 2011 22:13:20 +0000 Subject: 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 --- lib/CodeGen/CodeGenModule.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/CodeGen/CodeGenModule.cpp') 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; } -- cgit v1.2.3-70-g09d2