llvm-project/clang/lib/Basic
Ulrich Weigand fa80642205 Allow targets to define minimum alignment for global variables
This patch adds a new common code feature that allows platform code to
request minimum alignment of global symbols.  The background for this is
that on SystemZ, the most efficient way to load addresses of global symbol
is the LOAD ADDRESS RELATIVE LONG (LARL) instruction.  This instruction
provides PC-relative addressing, but only to *even* addresses.  For this
reason, existing compilers will guarantee that global symbols are always
aligned to at least 2.  [ Since symbols would otherwise already use a
default alignment based on their type, this will usually only affect global
objects of character type or character arrays. ]  GCC also allows creating
symbols without that extra alignment by using explicit "aligned" attributes
(which then need to be used on both definition and each use of the symbol).

To enable support for this with Clang, this patch adds a
TargetInfo::MinGlobalAlign variable that provides a global minimum for the
alignment of every global object (unless overridden via explicit alignment
attribute), and adds code to respect this setting.  Within this patch, no
platform actually sets the value to anything but the default 1, resulting
in no change in behaviour on any existing target.

This version of the patch incorporates feedback from reviews by
Eric Christopher and John McCall.  Thanks to all reviewers!

Patch by Richard Sandiford.

llvm-svn: 181210
2013-05-06 16:23:57 +00:00
..
Builtins.cpp Revert r170500. It over-zealously converted *ALL* things named Attributes, which is wrong here. 2012-12-20 19:22:21 +00:00
CMakeLists.txt <rdar://problem/13358795> Teach CMake to check Subversion version information at build time, not configure time. 2013-03-25 23:16:38 +00:00
CharInfo.cpp CharInfo: Add missing "using namespace clang::charinfo" in .cpp file. 2013-02-08 22:37:49 +00:00
Diagnostic.cpp Revert r177218. 2013-05-03 23:20:27 +00:00
DiagnosticIDs.cpp Fix typos: [Dd]iagnosic -> [Dd]iagnostic 2013-03-01 21:41:22 +00:00
FileManager.cpp <limits.h> includes <linux/limits.h> on Linux, no need to special-case it 2013-01-26 16:29:36 +00:00
FileSystemStatCache.cpp Extend stat query APIs to explicitly specify if the query is for 2012-12-11 07:48:23 +00:00
IdentifierTable.cpp [Modules] Use global index to improve typo correction performance 2013-04-17 22:10:55 +00:00
LangOptions.cpp Add a *San + modules FIXME. 2013-02-07 01:09:29 +00:00
Makefile Use tabs instead of spaces. 2012-03-02 16:06:37 +00:00
Module.cpp <rdar://problem/12368093> Extend module maps with a 'conflict' declaration, and warn when a newly-imported module conflicts with an already-imported module. 2013-03-20 21:10:35 +00:00
ObjCRuntime.cpp Add the ObjFW runtime. Patch by Jonathan Schleifer! 2012-07-12 02:07:58 +00:00
OpenMPKinds.cpp Fix a layering violation introduced in r177705. 2013-03-25 21:32:02 +00:00
OperatorPrecedence.cpp s/CPlusPlus0x/CPlusPlus11/g 2013-01-02 11:42:31 +00:00
SourceLocation.cpp PR14581: Make SourceLocation::printToString work, or it will always return an empty string. 2012-12-12 14:17:17 +00:00
SourceManager.cpp Introduce SourceManager::getDecomposedIncludedLoc, that returns the "included/expanded in" decomposed location of the given FileID. 2013-04-13 01:03:57 +00:00
TargetInfo.cpp Allow targets to define minimum alignment for global variables 2013-05-06 16:23:57 +00:00
Targets.cpp AArch64: teach Clang about __clear_cache intrinsic 2013-05-04 07:15:13 +00:00
TokenKinds.cpp Sort all of Clang's files under 'lib', and fix up the broken headers 2012-12-04 09:13:33 +00:00
Version.cpp <rdar://problem/13358795> Teach CMake to check Subversion version information at build time, not configure time. 2013-03-25 23:16:38 +00:00
VersionTuple.cpp Include llvm::Optional in clang/Basic/LLVM.h 2013-02-20 22:23:23 +00:00