mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
Fix alignment of .comm and .lcomm on mingw32.
For some reason .lcomm uses byte alignment and .comm log2 alignment so we can't use the same setting for both. Fix this by reintroducing the LCOMM enum. I verified this against mingw's gcc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163420 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2280,11 +2280,13 @@ bool AsmParser::ParseDirectiveComm(bool IsLocal) {
|
||||
if (ParseAbsoluteExpression(Pow2Alignment))
|
||||
return true;
|
||||
|
||||
if (IsLocal && !Lexer.getMAI().getLCOMMDirectiveSupportsAlignment())
|
||||
LCOMM::LCOMMType LCOMM = Lexer.getMAI().getLCOMMDirectiveAlignmentType();
|
||||
if (IsLocal && LCOMM == LCOMM::NoAlignment)
|
||||
return Error(Pow2AlignmentLoc, "alignment not supported on this target");
|
||||
|
||||
// If this target takes alignments in bytes (not log) validate and convert.
|
||||
if (Lexer.getMAI().getCOMMDirectiveAlignmentIsInBytes()) {
|
||||
if ((!IsLocal && Lexer.getMAI().getCOMMDirectiveAlignmentIsInBytes()) ||
|
||||
(IsLocal && LCOMM == LCOMM::ByteAlignment)) {
|
||||
if (!isPowerOf2_64(Pow2Alignment))
|
||||
return Error(Pow2AlignmentLoc, "alignment must be a power of 2");
|
||||
Pow2Alignment = Log2_64(Pow2Alignment);
|
||||
|
Reference in New Issue
Block a user