/// 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
/// 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();
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();
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();
}
// Print out jump tables referenced by the function.
- EmitJumpTableInfo(MF.getJumpTableInfo());
+ EmitJumpTableInfo(MF.getJumpTableInfo(), MF);
// Emit post-function debug information.
DW.EndFunction();
}
}
- // 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";
}
}
+ // Print out jump tables referenced by the function.
+ EmitJumpTableInfo(MF.getJumpTableInfo(), MF);
+
O << CurrentFnName << "\tendp\n";
// We didn't modify anything.