Pass the MachineFunction into EmitJumpTableInfo.
authorChris Lattner <sabre@nondot.org>
Thu, 5 Oct 2006 03:01:21 +0000 (03:01 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 5 Oct 2006 03:01:21 +0000 (03:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30742 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/AsmPrinter.h
lib/CodeGen/AsmPrinter.cpp
lib/Target/ARM/ARMAsmPrinter.cpp
lib/Target/Alpha/AlphaAsmPrinter.cpp
lib/Target/PowerPC/PPCAsmPrinter.cpp
lib/Target/X86/X86ATTAsmPrinter.cpp
lib/Target/X86/X86IntelAsmPrinter.cpp

index 7c4d4eeb4493807c1644b796da597c5e7cc7f328..3632cc40714ad567295a8de43ed444801c2c49b6 100644 (file)
@@ -161,7 +161,7 @@ namespace llvm {
     /// EmitJumpTableInfo - Print assembly representations of the jump tables 
     /// used by the current function to the current output stream.  
     ///
-    void EmitJumpTableInfo(MachineJumpTableInfo *MJTI);
+    void EmitJumpTableInfo(MachineJumpTableInfo *MJTI, MachineFunction &MF);
     
     /// EmitSpecialLLVMGlobal - Check to see if the specified global is a
     /// special global used by LLVM.  If so, emit it and return true, otherwise
index 247cceda7da9deb18453abd373b315b96d290667..63d5f9218209cf290bed318452f08b520e74db98 100644 (file)
@@ -183,7 +183,8 @@ void AsmPrinter::EmitConstantPool(unsigned Alignment, const char *Section,
 /// EmitJumpTableInfo - Print assembly representations of the jump tables used
 /// by the current function to the current output stream.  
 ///
-void AsmPrinter::EmitJumpTableInfo(MachineJumpTableInfo *MJTI) {
+void AsmPrinter::EmitJumpTableInfo(MachineJumpTableInfo *MJTI,
+                                   MachineFunction &MF) {
   const std::vector<MachineJumpTableEntry> &JT = MJTI->getJumpTables();
   if (JT.empty()) return;
   const TargetData *TD = TM.getTargetData();
index 4c0d187c7bc0596aceb4ea0b6e7a88eb606b10d9..d0005a8dd2f1fbe5a5101f16cdfc09fb3d54f44c 100644 (file)
@@ -117,7 +117,7 @@ bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
   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();
index 265f8ae4a21e660be2ddc606c3bf95a76eb233c6..3448f3c47393e1e49e64f6fcf9171c731a508f3b 100644 (file)
@@ -162,7 +162,7 @@ bool AlphaAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
   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();
index b7e7f2878e4e1c18a5f6bf5cd8ec3ca76fc6a926..bba9d75558f10df1cdd672f0a0900c86bd1cf682 100644 (file)
@@ -475,7 +475,7 @@ bool DarwinAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
   }
 
   // Print out jump tables referenced by the function.
-  EmitJumpTableInfo(MF.getJumpTableInfo());
+  EmitJumpTableInfo(MF.getJumpTableInfo(), MF);
   
   // Emit post-function debug information.
   DW.EndFunction();
index 85ba0f40e6135d395e5435aa09da18872ec4b45f..eef95d935d1dde7dd011a7080767626394132579 100755 (executable)
@@ -126,10 +126,11 @@ bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
     }
   }
 
-  // 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";
index 4e833bdd3dac5ff70a8804de4a879382e84709e0..a7d1351e7a06b171e6ec17e2cd4aa667377fefc3 100755 (executable)
@@ -85,6 +85,9 @@ bool X86IntelAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
     }
   }
 
+  // Print out jump tables referenced by the function.
+  EmitJumpTableInfo(MF.getJumpTableInfo(), MF);
+
   O << CurrentFnName << "\tendp\n";
 
   // We didn't modify anything.