[llvm] r180226 - [inline asm] Fix a crasher for an invalid value type/register class.
Eric Christopher
echristo at gmail.com
Wed Apr 24 17:04:27 PDT 2013
Testcase and description? That's really not much of a commit message.
There's also no corresponding front end commit to diagnose this.
What's up here?
-eric
On Wed, Apr 24, 2013 at 11:53 PM, 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
More information about the llvm-commits
mailing list