summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2013-04-24 22:53:10 +0000
committerChad Rosier <mcrosier@apple.com>2013-04-24 22:53:10 +0000
commit108d5a61b7903a6f68235fc2fd6bee9e31975c8c (patch)
tree39fda5ced70ef8fdc26b40925036692946b8c30d /llvm/lib/CodeGen
parentf91b5acc993a1a5a838e035303a22d874ea4a9f3 (diff)
downloadbcm5719-llvm-108d5a61b7903a6f68235fc2fd6bee9e31975c8c.tar.gz
bcm5719-llvm-108d5a61b7903a6f68235fc2fd6bee9e31975c8c.zip
[inline asm] Fix a crasher for an invalid value type/register class.
rdar://13731657 llvm-svn: 180226
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index c1c8be4387a..6e613d606f4 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -6171,10 +6171,17 @@ void SelectionDAGBuilder::visitInlineAsm(ImmutableCallSite CS) {
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());
OpenPOWER on IntegriCloud