aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/TargetData.cpp
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@apple.com>2011-04-13 09:02:43 +0000
committerCameron Zwarich <zwarich@apple.com>2011-04-13 09:02:43 +0000
commiteb04a33dc778c6520489dff19d394c542d87c6ac (patch)
treec0bfc32859c2dfebb1964377c3a4ccffb2e1e38b /lib/Target/TargetData.cpp
parent5876db7a66fcc4ec4444a9f3e387c1cdc8baf9e5 (diff)
Fix an obvious problem with an alignment computation. AsmPrinter actually does
the max itself, so it is not easy to write a test case for this, but I added a test case that would fail if the code in AsmPrinter were removed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129432 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/TargetData.cpp')
-rw-r--r--lib/Target/TargetData.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp
index d15855ce12..da956d5fed 100644
--- a/lib/Target/TargetData.cpp
+++ b/lib/Target/TargetData.cpp
@@ -621,7 +621,7 @@ unsigned TargetData::getPreferredAlignment(const GlobalVariable *GV) const {
if (GVAlignment >= Alignment) {
Alignment = GVAlignment;
} else if (GVAlignment != 0) {
- Alignment = std::min(GVAlignment, getABITypeAlignment(ElemType));
+ Alignment = std::max(GVAlignment, getABITypeAlignment(ElemType));
}
if (GV->hasInitializer()) {