diff options
author | dim <dim@FreeBSD.org> | 2016-01-16 18:00:58 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2016-01-16 18:00:58 +0000 |
commit | a49d5469df472d80c9cc17394c71fa8244e6a759 (patch) | |
tree | 1aa6c4bf43100053e1c9992a26e30564c1146d38 /contrib/llvm/include | |
parent | 7c048a3e43696cd763f00aa2b8d7a2bb1e71e1be (diff) | |
download | FreeBSD-src-a49d5469df472d80c9cc17394c71fa8244e6a759.zip FreeBSD-src-a49d5469df472d80c9cc17394c71fa8244e6a759.tar.gz |
Pull in r257902 from upstream llvm trunk, by James Y Knight (this will
be merged to the official release_38 branch soon, but we need it ASAP):
Stop increasing alignment of externally-visible globals on ELF
platforms.
With ELF, the alignment of a global variable in a shared library will
get copied into an executables linked against it, if the executable even
accesss the variable. So, it's not possible to implicitly increase
alignment based on access patterns, or you'll break existing binaries.
This happened to affect libc++'s std::cout symbol, for example. See
thread: http://thread.gmane.org/gmane.comp.compilers.clang.devel/45311
(This is a re-commit of r257719, without the bug reported in
PR26144. I've tweaked the code to not assert-fail in
enforceKnownAlignment when computeKnownBits doesn't recurse far enough
to find the underlying Alloca/GlobalObject value.)
Differential Revision: http://reviews.llvm.org/D16145
Diffstat (limited to 'contrib/llvm/include')
-rw-r--r-- | contrib/llvm/include/llvm/IR/GlobalValue.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/llvm/include/llvm/IR/GlobalValue.h b/contrib/llvm/include/llvm/IR/GlobalValue.h index 4fa4e7d..fa6469a 100644 --- a/contrib/llvm/include/llvm/IR/GlobalValue.h +++ b/contrib/llvm/include/llvm/IR/GlobalValue.h @@ -346,6 +346,10 @@ public: return !(isDeclarationForLinker() || isWeakForLinker()); } + // Returns true if the alignment of the value can be unilaterally + // increased. + bool canIncreaseAlignment() const; + /// This method unlinks 'this' from the containing module, but does not delete /// it. virtual void removeFromParent() = 0; |