Pass the MachineFunction into EmitJumpTableInfo.

llvm-svn: 30742
diff --git a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
index 4c0d187..d0005a8 100644
--- a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
+++ b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
@@ -117,7 +117,7 @@
   EmitConstantPool(MF.getConstantPool());
 
   // Print out jump tables referenced by the function
-  EmitJumpTableInfo(MF.getJumpTableInfo());
+  EmitJumpTableInfo(MF.getJumpTableInfo(), MF);
 
   // Print out labels for the function.
   const Function *F = MF.getFunction();
diff --git a/llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp b/llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp
index 265f8ae..3448f3c 100644
--- a/llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp
+++ b/llvm/lib/Target/Alpha/AlphaAsmPrinter.cpp
@@ -162,7 +162,7 @@
   EmitConstantPool(MF.getConstantPool());
 
   // Print out jump tables referenced by the function
-  EmitJumpTableInfo(MF.getJumpTableInfo());
+  EmitJumpTableInfo(MF.getJumpTableInfo(), MF);
 
   // Print out labels for the function.
   const Function *F = MF.getFunction();
diff --git a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
index b7e7f28..bba9d75 100644
--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -475,7 +475,7 @@
   }
 
   // Print out jump tables referenced by the function.
-  EmitJumpTableInfo(MF.getJumpTableInfo());
+  EmitJumpTableInfo(MF.getJumpTableInfo(), MF);
   
   // Emit post-function debug information.
   DW.EndFunction();
diff --git a/llvm/lib/Target/X86/X86ATTAsmPrinter.cpp b/llvm/lib/Target/X86/X86ATTAsmPrinter.cpp
index 85ba0f4..eef95d9 100755
--- a/llvm/lib/Target/X86/X86ATTAsmPrinter.cpp
+++ b/llvm/lib/Target/X86/X86ATTAsmPrinter.cpp
@@ -126,10 +126,11 @@
     }
   }
 
-  // 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());
+  // Print out jump tables referenced by the function.
+  
+  // Mac OS X requires that the jump table follow the function, so that the jump
+  // table is part of the same atom that the function is in.
+  EmitJumpTableInfo(MF.getJumpTableInfo(), MF);
   
   if (TAI->hasDotTypeDotSizeDirective())
     O << "\t.size " << CurrentFnName << ", .-" << CurrentFnName << "\n";
diff --git a/llvm/lib/Target/X86/X86IntelAsmPrinter.cpp b/llvm/lib/Target/X86/X86IntelAsmPrinter.cpp
index 4e833bd..a7d1351 100755
--- a/llvm/lib/Target/X86/X86IntelAsmPrinter.cpp
+++ b/llvm/lib/Target/X86/X86IntelAsmPrinter.cpp
@@ -85,6 +85,9 @@
     }
   }
 
+  // Print out jump tables referenced by the function.
+  EmitJumpTableInfo(MF.getJumpTableInfo(), MF);
+
   O << CurrentFnName << "\tendp\n";
 
   // We didn't modify anything.