$OpenBSD: patch-include_llvm_Target_TargetInstrInfo_h,v 1.1 2014/09/18 20:19:27 brad Exp $

r217801
Fix a lot of confusion around inserting nops on empty functions.

On MachO, and MachO only, we cannot have a truly empty function since that
breaks the linker logic for atomizing the section.

When we are emitting a frame pointer, the presence of an unreachable will
create a cfi instruction pointing past the last instruction. This is perfectly
fine. The FDE information encodes the pc range it applies to. If some tool
cannot handle this, we should explicitly say which bug we are working around
and only work around it when it is actually relevant (not for ELF for example).

Given the unreachable we could omit the .cfi_def_cfa_register, but then
again, we could also omit the entire function prologue if we wanted to.

--- include/llvm/Target/TargetInstrInfo.h.orig	Mon Sep 15 16:00:35 2014
+++ include/llvm/Target/TargetInstrInfo.h	Mon Sep 15 16:01:15 2014
@@ -661,10 +661,8 @@ class TargetInstrInfo : public MCInstrInfo { (public)
                           MachineBasicBlock::iterator MI) const;
 
 
-  /// getNoopForMachoTarget - Return the noop instruction to use for a noop.
-  virtual void getNoopForMachoTarget(MCInst &NopInst) const {
-    // Default to just using 'nop' string.
-  }
+  /// Return the noop instruction to use for a noop.
+  virtual void getNoopForMachoTarget(MCInst &NopInst) const;
 
 
   /// isPredicated - Returns true if the instruction is already predicated.
