diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-04-26 23:37:21 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-04-26 23:37:21 +0000 |
| commit | 6a5e706e3c99f5995dbefe1a4f058c7b49a0bb01 (patch) | |
| tree | 34dcbe21fc6100c474a93ffed9494ff64bd5f222 /llvm/lib/Target/X86/X86InstrInfo.cpp | |
| parent | b8b85c1ddb5ce5a2a5ac7f3180055b38fec6500f (diff) | |
| download | bcm5719-llvm-6a5e706e3c99f5995dbefe1a4f058c7b49a0bb01.tar.gz bcm5719-llvm-6a5e706e3c99f5995dbefe1a4f058c7b49a0bb01.zip | |
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
llvm-svn: 102400
Diffstat (limited to 'llvm/lib/Target/X86/X86InstrInfo.cpp')
| -rw-r--r-- | llvm/lib/Target/X86/X86InstrInfo.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp index 4ed7434e45a..9a41a4a525d 100644 --- a/llvm/lib/Target/X86/X86InstrInfo.cpp +++ b/llvm/lib/Target/X86/X86InstrInfo.cpp @@ -27,6 +27,7 @@ #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/LiveVariables.h" #include "llvm/CodeGen/PseudoSourceValue.h" +#include "llvm/MC/MCInst.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" @@ -3766,3 +3767,9 @@ void X86InstrInfo::SetSSEDomain(MachineInstr *MI, unsigned Domain) const { assert(table && "Cannot change domain"); MI->setDesc(get(table[Domain-1])); } + +/// getNoopForMachoTarget - Return the noop instruction to use for a noop. +void X86InstrInfo::getNoopForMachoTarget(MCInst &NopInst) const { + NopInst.setOpcode(X86::NOOP); +} + |

