[llvm] r180226 - [inline asm] Fix a crasher for an invalid value type/register class.
Chad Rosier
mcrosier at apple.com
Thu Apr 25 10:12:56 PDT 2013
Done so in r180445. Thanks for keeping me honest, Rafael.
Chad
On Apr 24, 2013, at 3:59 PM, Rafael EspĂndola <rafael.espindola at gmail.com> wrote:
> testcase?
>
> On 24 April 2013 18:53, Chad Rosier <mcrosier at apple.com> wrote:
>> Author: mcrosier
>> Date: Wed Apr 24 17:53:10 2013
>> New Revision: 180226
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=180226&view=rev
>> Log:
>> [inline asm] Fix a crasher for an invalid value type/register class.
>> rdar://13731657
>>
>> Modified:
>> llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
>>
>> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp?rev=180226&r1=180225&r2=180226&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (original)
>> +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Wed Apr 24 17:53:10 2013
>> @@ -6171,10 +6171,17 @@ void SelectionDAGBuilder::visitInlineAsm
>> MatchedRegs.RegVTs.push_back(RegVT);
>> MachineRegisterInfo &RegInfo = DAG.getMachineFunction().getRegInfo();
>> for (unsigned i = 0, e = InlineAsm::getNumOperandRegisters(OpFlag);
>> - i != e; ++i)
>> - MatchedRegs.Regs.push_back
>> - (RegInfo.createVirtualRegister(TLI.getRegClassFor(RegVT)));
>> -
>> + i != e; ++i) {
>> + if (const TargetRegisterClass *RC = 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
>> MatchedRegs.getCopyToRegs(InOperandVal, DAG, getCurDebugLoc(),
>> Chain, &Flag, CS.getInstruction());
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130425/7f33609c/attachment.html>
More information about the llvm-commits
mailing list