summaryrefslogtreecommitdiff
path: root/lib/Target/X86/X86ATTAsmPrinter.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-08-28 22:14:16 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-08-28 22:14:16 +0000
commit67afeceaf04d9ba2773531e9d6f0e541636768d7 (patch)
tree2a95532c8914eaa151beb6b09bdd407a9df055c3 /lib/Target/X86/X86ATTAsmPrinter.cpp
parent181c359c9d29be884ca1fd33c0469b1b567bd33c (diff)
downloadllvm-67afeceaf04d9ba2773531e9d6f0e541636768d7.tar.gz
llvm-67afeceaf04d9ba2773531e9d6f0e541636768d7.tar.bz2
llvm-67afeceaf04d9ba2773531e9d6f0e541636768d7.tar.xz
On Mac, print jump table entries after the function to work around a linker issue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29946 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86ATTAsmPrinter.cpp')
-rwxr-xr-xlib/Target/X86/X86ATTAsmPrinter.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Target/X86/X86ATTAsmPrinter.cpp b/lib/Target/X86/X86ATTAsmPrinter.cpp
index 10a2c89fba..76e137e75b 100755
--- a/lib/Target/X86/X86ATTAsmPrinter.cpp
+++ b/lib/Target/X86/X86ATTAsmPrinter.cpp
@@ -38,9 +38,6 @@ bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
// Print out constants referenced by the function
EmitConstantPool(MF.getConstantPool());
- // Print out jump tables referenced by the function
- EmitJumpTableInfo(MF.getJumpTableInfo());
-
// Print out labels for the function.
const Function *F = MF.getFunction();
switch (F->getLinkage()) {
@@ -98,6 +95,12 @@ bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
printMachineInstruction(II);
}
}
+
+ // Print out jump tables referenced by the function
+ // Mac OS X requires at least one non-local (e.g. L1) labels before local
+ // lables that are used in jump table expressions (e.g. LBB1_1-LJT1_0).
+ EmitJumpTableInfo(MF.getJumpTableInfo());
+
if (HasDotTypeDotSizeDirective)
O << "\t.size " << CurrentFnName << ", .-" << CurrentFnName << "\n";