summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-07-31 18:35:56 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-07-31 18:35:56 +0000
commitbe8422e8e0176c26181b8998813e99bffc998b8e (patch)
tree836342bbcd6d7830b3865e55a3908848c934cd0d /llvm/lib/Target/ARM
parent7baae4b3557d5c50bcf632d91e2fd21deee54099 (diff)
downloadbcm5719-llvm-be8422e8e0176c26181b8998813e99bffc998b8e.tar.gz
bcm5719-llvm-be8422e8e0176c26181b8998813e99bffc998b8e.zip
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
Diffstat (limited to 'llvm/lib/Target/ARM')
-rw-r--r--llvm/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp7
1 files changed, 7 insertions, 0 deletions
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) {
OpenPOWER on IntegriCloud