on darwin empty functions need to codegen into something of non-zero length,
authorChris Lattner <sabre@nondot.org>
Mon, 26 Apr 2010 23:37:21 +0000 (23:37 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 26 Apr 2010 23:37:21 +0000 (23:37 +0000)
commitee9eb411fffddbb8fe70418c05946a131889b487
tree23b17d9a2ae83b24f36a5dd40068e7a4d8b177a3
parentae11c3f83e92d776b9f24a569532229ba106b4b0
on darwin empty functions need to codegen into something of non-zero length,
otherwise labels get incorrectly merged.  We handled this by emitting a
".byte 0", but this isn't correct on thumb/arm targets where the text segment
needs to be a multiple of 2/4 bytes.  Handle this by emitting a noop.  This
is more gross than it should be because arm/ppc are not fully mc'ized yet.

This fixes rdar://7908505

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102400 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Target/TargetInstrInfo.h
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/Target/X86/X86InstrInfo.cpp
lib/Target/X86/X86InstrInfo.h
test/CodeGen/PowerPC/2008-01-25-EmptyFunction.ll
test/CodeGen/X86/2008-01-25-EmptyFunction.ll