summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/lib
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2013-02-19 17:53:32 +0000
committerdim <dim@FreeBSD.org>2013-02-19 17:53:32 +0000
commitb72d635ee90ed19d32f99bf5b95a4e18130a7641 (patch)
tree77bdafb15b66e2ad2139cb3dfb25b979991a0766 /contrib/llvm/lib
parent90c71ac75a455d049dc4ec69e3dbf475e699fc81 (diff)
downloadFreeBSD-src-b72d635ee90ed19d32f99bf5b95a4e18130a7641.zip
FreeBSD-src-b72d635ee90ed19d32f99bf5b95a4e18130a7641.tar.gz
Pull in r175360 from upstream llvm trunk:
MCParser: Reject .balign with non-pow2 alignments. GNU as rejects them and there are configure scripts in the wild that check if the assembler rejects ".align 3" to determine whether the alignment is in bytes or powers of two. MFC after: 3 days
Diffstat (limited to 'contrib/llvm/lib')
-rw-r--r--contrib/llvm/lib/MC/MCParser/AsmParser.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/llvm/lib/MC/MCParser/AsmParser.cpp b/contrib/llvm/lib/MC/MCParser/AsmParser.cpp
index 6f2e85e..414d2d5 100644
--- a/contrib/llvm/lib/MC/MCParser/AsmParser.cpp
+++ b/contrib/llvm/lib/MC/MCParser/AsmParser.cpp
@@ -2372,6 +2372,10 @@ bool AsmParser::ParseDirectiveAlign(bool IsPow2, unsigned ValueSize) {
}
Alignment = 1ULL << Alignment;
+ } else {
+ // Reject alignments that aren't a power of two, for gas compatibility.
+ if (!isPowerOf2_64(Alignment))
+ Error(AlignmentLoc, "alignment must be a power of 2");
}
// Diagnose non-sensical max bytes to align.
OpenPOWER on IntegriCloud