aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/ARM/Thumb2InstrInfo.cpp
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2012-02-28 23:53:30 +0000
committerJim Grosbach <grosbach@apple.com>2012-02-28 23:53:30 +0000
commitc01810eeb7227010f73cb39e3c4fa0197a3c4ef0 (patch)
tree10b49a3600d9b9c798d9679ca3300348ac7eb606 /lib/Target/ARM/Thumb2InstrInfo.cpp
parentb62fbc5e469f532fd1747a3c24115fb1d0ba792f (diff)
downloadexternal_llvm-c01810eeb7227010f73cb39e3c4fa0197a3c4ef0.tar.gz
external_llvm-c01810eeb7227010f73cb39e3c4fa0197a3c4ef0.tar.bz2
external_llvm-c01810eeb7227010f73cb39e3c4fa0197a3c4ef0.zip
ARM implement TargetInstrInfo::getNoopForMachoTarget()
Without this hook, functions w/ a completely empty body (including no epilogue) will cause an MCEmitter assertion failure. For example, define internal fastcc void @empty_function() { unreachable } rdar://10947471 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151673 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/Thumb2InstrInfo.cpp')
-rw-r--r--lib/Target/ARM/Thumb2InstrInfo.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Target/ARM/Thumb2InstrInfo.cpp b/lib/Target/ARM/Thumb2InstrInfo.cpp
index 8a6276be51..6cb182a084 100644
--- a/lib/Target/ARM/Thumb2InstrInfo.cpp
+++ b/lib/Target/ARM/Thumb2InstrInfo.cpp
@@ -21,6 +21,7 @@
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineMemOperand.h"
#include "llvm/ADT/SmallVector.h"
+#include "llvm/MC/MCInst.h"
#include "llvm/Support/CommandLine.h"
using namespace llvm;
@@ -34,6 +35,13 @@ Thumb2InstrInfo::Thumb2InstrInfo(const ARMSubtarget &STI)
: ARMBaseInstrInfo(STI), RI(*this, STI) {
}
+/// getNoopForMachoTarget - Return the noop instruction to use for a noop.
+void Thumb2InstrInfo::getNoopForMachoTarget(MCInst &NopInst) const {
+ NopInst.setOpcode(ARM::tNOP);
+ NopInst.addOperand(MCOperand::CreateImm(ARMCC::AL));
+ NopInst.addOperand(MCOperand::CreateReg(0));
+}
+
unsigned Thumb2InstrInfo::getUnindexedOpcode(unsigned Opc) const {
// FIXME
return 0;