forked from OSchip/llvm-project
[inline asm] Fix a crasher for an invalid value type/register class.
rdar://13731657 llvm-svn: 180226
This commit is contained in:
parent
f91b5acc99
commit
108d5a61b7
|
@ -6171,10 +6171,17 @@ void SelectionDAGBuilder::visitInlineAsm(ImmutableCallSite CS) {
|
||||||
MatchedRegs.RegVTs.push_back(RegVT);
|
MatchedRegs.RegVTs.push_back(RegVT);
|
||||||
MachineRegisterInfo &RegInfo = DAG.getMachineFunction().getRegInfo();
|
MachineRegisterInfo &RegInfo = DAG.getMachineFunction().getRegInfo();
|
||||||
for (unsigned i = 0, e = InlineAsm::getNumOperandRegisters(OpFlag);
|
for (unsigned i = 0, e = InlineAsm::getNumOperandRegisters(OpFlag);
|
||||||
i != e; ++i)
|
i != e; ++i) {
|
||||||
MatchedRegs.Regs.push_back
|
if (const TargetRegisterClass *RC = TLI.getRegClassFor(RegVT))
|
||||||
(RegInfo.createVirtualRegister(TLI.getRegClassFor(RegVT)));
|
MatchedRegs.Regs.push_back(RegInfo.createVirtualRegister(RC));
|
||||||
|
else {
|
||||||
|
LLVMContext &Ctx = *DAG.getContext();
|
||||||
|
Ctx.emitError(CS.getInstruction(), "inline asm error: This value"
|
||||||
|
" type register class is not natively supported!");
|
||||||
|
report_fatal_error("inline asm error: This value type register "
|
||||||
|
"class is not natively supported!");
|
||||||
|
}
|
||||||
|
}
|
||||||
// Use the produced MatchedRegs object to
|
// Use the produced MatchedRegs object to
|
||||||
MatchedRegs.getCopyToRegs(InOperandVal, DAG, getCurDebugLoc(),
|
MatchedRegs.getCopyToRegs(InOperandVal, DAG, getCurDebugLoc(),
|
||||||
Chain, &Flag, CS.getInstruction());
|
Chain, &Flag, CS.getInstruction());
|
||||||
|
|
Loading…
Reference in New Issue