From be8422e8e0176c26181b8998813e99bffc998b8e Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Fri, 31 Jul 2009 18:35:56 +0000 Subject: Until we have a "ALIGN" pseudo instruction, have asm printer emitted a .align to ensure the instruction that follows a TBB (when the number of table entries is odd) is 2-byte aligned. Patch by Sandeep Patel. llvm-svn: 77705 --- llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'llvm/lib/Target/ARM') diff --git a/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp index a80a88e1d35..5feafb42977 100644 --- a/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp +++ b/llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp @@ -988,6 +988,13 @@ void ARMAsmPrinter::printJT2BlockOperand(const MachineInstr *MI, int OpNum) { if (i != e-1) O << '\n'; } + + // Make sure the instruction that follows TBB is 2-byte aligned. + // FIXME: Constant island pass should insert an "ALIGN" instruction instead. + if (ByteOffset && (JTBBs.size() & 1)) { + O << '\n'; + EmitAlignment(1); + } } void ARMAsmPrinter::printTBAddrMode(const MachineInstr *MI, int OpNum) { -- cgit v1.2.3