summaryrefslogtreecommitdiff
path: root/lib/MC/MCAsmStreamer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-08-19 06:35:36 +0000
committerChris Lattner <sabre@nondot.org>2009-08-19 06:35:36 +0000
commit6e579c67272afdbca273ad6e6e93c5f6c0f10eeb (patch)
treee7a1006affc4be3bac6b250fc499a916d2189d16 /lib/MC/MCAsmStreamer.cpp
parent3417e8f185e9d866df6a604976237e2f0a5e5deb (diff)
downloadllvm-6e579c67272afdbca273ad6e6e93c5f6c0f10eeb.tar.gz
llvm-6e579c67272afdbca273ad6e6e93c5f6c0f10eeb.tar.bz2
llvm-6e579c67272afdbca273ad6e6e93c5f6c0f10eeb.tar.xz
fix asmstreaming of 2/4 byte elements with pow-2 alignments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79408 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCAsmStreamer.cpp')
-rw-r--r--lib/MC/MCAsmStreamer.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp
index 8068c66667..3dfd8e9474 100644
--- a/lib/MC/MCAsmStreamer.cpp
+++ b/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;