From 6ffb623a5209e4b59536f1be17e15d60127a8467 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 . llvm-svn: 132223 --- clang/lib/CodeGen/CodeGenModule.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 987ebff..de11a29 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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.1