From da00cf5f73446235f0bfe89db90c28fc2d2019f3 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Fri, 31 Oct 2014 23:19:46 +0000 Subject: Work around bugs in MSVC "14" CTP 3's conversion logic It appears to ignore or find ambiguous MachineInstrBuilder's conversion operators that allow conversion to MachineInstr* and MachineBasicBlock::bundle_iterator. As a workaround, add an explicit way to get the MachineInstr. llvm-svn: 221017 --- llvm/lib/Target/XCore/XCoreInstrInfo.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Target/XCore') diff --git a/llvm/lib/Target/XCore/XCoreInstrInfo.cpp b/llvm/lib/Target/XCore/XCoreInstrInfo.cpp index 36ea9a087da..c310aa3a179 100644 --- a/llvm/lib/Target/XCore/XCoreInstrInfo.cpp +++ b/llvm/lib/Target/XCore/XCoreInstrInfo.cpp @@ -446,16 +446,19 @@ MachineBasicBlock::iterator XCoreInstrInfo::loadImmediate( dl = MI->getDebugLoc(); if (isImmMskBitp(Value)) { int N = Log2_32(Value) + 1; - return BuildMI(MBB, MI, dl, get(XCore::MKMSK_rus), Reg).addImm(N); + return BuildMI(MBB, MI, dl, get(XCore::MKMSK_rus), Reg) + .addImm(N) + .getInstr(); } if (isImmU16(Value)) { int Opcode = isImmU6(Value) ? XCore::LDC_ru6 : XCore::LDC_lru6; - return BuildMI(MBB, MI, dl, get(Opcode), Reg).addImm(Value); + return BuildMI(MBB, MI, dl, get(Opcode), Reg).addImm(Value).getInstr(); } MachineConstantPool *ConstantPool = MBB.getParent()->getConstantPool(); const Constant *C = ConstantInt::get( Type::getInt32Ty(MBB.getParent()->getFunction()->getContext()), Value); unsigned Idx = ConstantPool->getConstantPoolIndex(C, 4); return BuildMI(MBB, MI, dl, get(XCore::LDWCP_lru6), Reg) - .addConstantPoolIndex(Idx); + .addConstantPoolIndex(Idx) + .getInstr(); } -- cgit v1.2.3