1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

If the function has no machine instructions, then emit a "nop" so that

the function label isn't associated with something it shouldn't be.

llvm-svn: 46449
This commit is contained in:
Bill Wendling 2008-01-28 09:15:03 +00:00
parent dc0c4352bd
commit 5b6f587a80

View File

@ -233,6 +233,16 @@ bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
// Emit pre-function debug information.
DW.BeginFunction(&MF);
if (Subtarget->isTargetDarwin()) {
// If the function is empty, then we need to emit *something*. Otherwise,
// the function's label might be associated with something that it wasn't
// meant to be associated with. We emit a noop in this situation.
MachineFunction::iterator I = MF.begin();
if (++I == MF.end() && MF.front().empty())
O << "\tnop\n";
}
// Print out code for the function.
for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
I != E; ++I) {