diff options
author | Chris Lattner <sabre@nondot.org> | 2009-08-19 06:35:36 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-08-19 06:35:36 +0000 |
commit | 78b23b0e3f75cf5f007d60b0eac19108f7052a56 (patch) | |
tree | 0f254c39678237fa0a4d15c4f1cc20bcae5d0e7a /llvm/lib/MC/MCAsmStreamer.cpp | |
parent | 9ddc52d5b88706f61d141dd3a1f6f9f3f54b4651 (diff) | |
download | bcm5719-llvm-78b23b0e3f75cf5f007d60b0eac19108f7052a56.tar.gz bcm5719-llvm-78b23b0e3f75cf5f007d60b0eac19108f7052a56.zip |
fix asmstreaming of 2/4 byte elements with pow-2 alignments.
llvm-svn: 79408
Diffstat (limited to 'llvm/lib/MC/MCAsmStreamer.cpp')
-rw-r--r-- | llvm/lib/MC/MCAsmStreamer.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCAsmStreamer.cpp b/llvm/lib/MC/MCAsmStreamer.cpp index 8068c666671..3dfd8e94748 100644 --- a/llvm/lib/MC/MCAsmStreamer.cpp +++ b/llvm/lib/MC/MCAsmStreamer.cpp @@ -229,7 +229,14 @@ void MCAsmStreamer::EmitValueToAlignment(unsigned ByteAlignment, int64_t Value, // Some assemblers don't support non-power of two alignments, so we always // emit alignments as a power of two if possible. if (isPowerOf2_32(ByteAlignment)) { - OS << TAI.getAlignDirective(); + switch (ValueSize) { + default: llvm_unreachable("Invalid size for machine code value!"); + case 1: OS << TAI.getAlignDirective(); break; + // FIXME: use TAI for this! + case 2: OS << ".p2alignw "; break; + case 4: OS << ".p2alignl "; break; + case 8: llvm_unreachable("Unsupported alignment size!"); + } if (TAI.getAlignmentIsInBytes()) OS << ByteAlignment; |