diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-09-07 21:08:01 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-09-07 21:08:01 +0000 |
commit | a9e37c5eaf79c3a32f2921536fb7e12514e86fb2 (patch) | |
tree | b0906a5545739e94cfa1a199df774d59929bba12 /lib/MC/MCAsmStreamer.cpp | |
parent | b72a90e05b296d13b6fb4efc54eee9f6f5c0ea7b (diff) | |
download | external_llvm-a9e37c5eaf79c3a32f2921536fb7e12514e86fb2.zip external_llvm-a9e37c5eaf79c3a32f2921536fb7e12514e86fb2.tar.gz external_llvm-a9e37c5eaf79c3a32f2921536fb7e12514e86fb2.tar.bz2 |
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
Diffstat (limited to 'lib/MC/MCAsmStreamer.cpp')
-rw-r--r-- | lib/MC/MCAsmStreamer.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp index 804e38e..b0bc290 100644 --- a/lib/MC/MCAsmStreamer.cpp +++ b/lib/MC/MCAsmStreamer.cpp @@ -519,13 +519,16 @@ void MCAsmStreamer::EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlign) { OS << "\t.lcomm\t" << *Symbol << ',' << Size; if (ByteAlign > 1) { - assert(MAI.getLCOMMDirectiveSupportsAlignment() && - "alignment not supported on .lcomm!"); - if (MAI.getCOMMDirectiveAlignmentIsInBytes()) { + switch (MAI.getLCOMMDirectiveAlignmentType()) { + case LCOMM::NoAlignment: + llvm_unreachable("alignment not supported on .lcomm!"); + case LCOMM::ByteAlignment: OS << ',' << ByteAlign; - } else { + break; + case LCOMM::Log2Alignment: assert(isPowerOf2_32(ByteAlign) && "alignment must be a power of 2"); OS << ',' << Log2_32(ByteAlign); + break; } } EmitEOL(); |