summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2012-08-08 23:31:14 +0000
committerOwen Anderson <resistor@mac.com>2012-08-08 23:31:14 +0000
commit12864689d199209a3a5046f4570d92a252da7420 (patch)
tree7659058a12f05e71ecd14b30b95806c86b71dad0 /include
parente723007ee6911c77bedaa2e914961e86b0b4ce61 (diff)
downloadllvm-12864689d199209a3a5046f4570d92a252da7420.tar.gz
llvm-12864689d199209a3a5046f4570d92a252da7420.tar.bz2
llvm-12864689d199209a3a5046f4570d92a252da7420.tar.xz
Allow legalization of target-specific SDNodes, provided that the target itself provide a legalization hook for them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161536 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Target/TargetLowering.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h
index f3113bd8f6..acf0419510 100644
--- a/include/llvm/Target/TargetLowering.h
+++ b/include/llvm/Target/TargetLowering.h
@@ -366,7 +366,9 @@ public:
/// for it.
LegalizeAction getOperationAction(unsigned Op, EVT VT) const {
if (VT.isExtended()) return Expand;
- assert(Op < array_lengthof(OpActions[0]) && "Table isn't big enough!");
+ // If a target-specific SDNode requires legalization, require the target
+ // to provide custom legalization for it.
+ if (Op > array_lengthof(OpActions[0])) return Custom;
unsigned I = (unsigned) VT.getSimpleVT().SimpleTy;
return (LegalizeAction)OpActions[I][Op];
}