From 80656fd7aef05bce5fe7ee0ab61220c01455018f Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Wed, 22 Jan 2020 13:52:26 +0000 Subject: [PATCH] [SelectionDAG] getShiftAmountConstant - assert the type is an integer. --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 94e5011576c..0421c6ad5e4 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -1332,6 +1332,7 @@ SDValue SelectionDAG::getIntPtrConstant(uint64_t Val, const SDLoc &DL, SDValue SelectionDAG::getShiftAmountConstant(uint64_t Val, EVT VT, const SDLoc &DL, bool LegalTypes) { + assert(VT.isInteger() && "Shift amount is not an integer type!"); EVT ShiftVT = TLI->getShiftAmountTy(VT, getDataLayout(), LegalTypes); return getConstant(Val, DL, ShiftVT); } -- 2.11.0