@@ -2641,7 +2641,7 @@ MorphNode(SDNode *Node, unsigned TargetOpc, SDVTList VTList,
2641
2641
unsigned ResNumResults = Res->getNumValues ();
2642
2642
// Move the glue if needed.
2643
2643
if ((EmitNodeInfo & OPFL_GlueOutput) && OldGlueResultNo != -1 &&
2644
- ( unsigned ) OldGlueResultNo != ResNumResults- 1 )
2644
+ static_cast < unsigned >( OldGlueResultNo) != ResNumResults - 1 )
2645
2645
ReplaceUses (SDValue (Node, OldGlueResultNo),
2646
2646
SDValue (Res, ResNumResults - 1 ));
2647
2647
@@ -2650,7 +2650,7 @@ MorphNode(SDNode *Node, unsigned TargetOpc, SDVTList VTList,
2650
2650
2651
2651
// Move the chain reference if needed.
2652
2652
if ((EmitNodeInfo & OPFL_Chain) && OldChainResultNo != -1 &&
2653
- ( unsigned ) OldChainResultNo != ResNumResults- 1 )
2653
+ static_cast < unsigned >( OldChainResultNo) != ResNumResults - 1 )
2654
2654
ReplaceUses (SDValue (Node, OldChainResultNo),
2655
2655
SDValue (Res, ResNumResults - 1 ));
2656
2656
@@ -2707,15 +2707,17 @@ LLVM_ATTRIBUTE_ALWAYS_INLINE static bool
2707
2707
CheckOpcode (const unsigned char *MatcherTable, unsigned &MatcherIndex,
2708
2708
SDNode *N) {
2709
2709
uint16_t Opc = MatcherTable[MatcherIndex++];
2710
- Opc |= ( unsigned short ) MatcherTable[MatcherIndex++] << 8 ;
2710
+ Opc |= static_cast < uint16_t >( MatcherTable[MatcherIndex++]) << 8 ;
2711
2711
return N->getOpcode () == Opc;
2712
2712
}
2713
2713
2714
2714
LLVM_ATTRIBUTE_ALWAYS_INLINE static bool
2715
2715
CheckType (const unsigned char *MatcherTable, unsigned &MatcherIndex, SDValue N,
2716
2716
const TargetLowering *TLI, const DataLayout &DL) {
2717
- MVT::SimpleValueType VT = (MVT::SimpleValueType)MatcherTable[MatcherIndex++];
2718
- if (N.getValueType () == VT) return true ;
2717
+ MVT::SimpleValueType VT =
2718
+ static_cast <MVT::SimpleValueType>(MatcherTable[MatcherIndex++]);
2719
+ if (N.getValueType () == VT)
2720
+ return true ;
2719
2721
2720
2722
// Handle the case when VT is iPTR.
2721
2723
return VT == MVT::iPTR && N.getValueType () == TLI->getPointerTy (DL);
@@ -2735,7 +2737,7 @@ LLVM_ATTRIBUTE_ALWAYS_INLINE static bool
2735
2737
CheckCondCode (const unsigned char *MatcherTable, unsigned &MatcherIndex,
2736
2738
SDValue N) {
2737
2739
return cast<CondCodeSDNode>(N)->get () ==
2738
- ( ISD::CondCode) MatcherTable[MatcherIndex++];
2740
+ static_cast < ISD::CondCode>( MatcherTable[MatcherIndex++]) ;
2739
2741
}
2740
2742
2741
2743
LLVM_ATTRIBUTE_ALWAYS_INLINE static bool
@@ -2749,7 +2751,8 @@ CheckChild2CondCode(const unsigned char *MatcherTable, unsigned &MatcherIndex,
2749
2751
LLVM_ATTRIBUTE_ALWAYS_INLINE static bool
2750
2752
CheckValueType (const unsigned char *MatcherTable, unsigned &MatcherIndex,
2751
2753
SDValue N, const TargetLowering *TLI, const DataLayout &DL) {
2752
- MVT::SimpleValueType VT = (MVT::SimpleValueType)MatcherTable[MatcherIndex++];
2754
+ MVT::SimpleValueType VT =
2755
+ static_cast <MVT::SimpleValueType>(MatcherTable[MatcherIndex++]);
2753
2756
if (cast<VTSDNode>(N)->getVT () == VT)
2754
2757
return true ;
2755
2758
@@ -3101,7 +3104,7 @@ void SelectionDAGISel::SelectCodeCommon(SDNode *NodeToMatch,
3101
3104
3102
3105
// Get the opcode, add the index to the table.
3103
3106
uint16_t Opc = MatcherTable[Idx++];
3104
- Opc |= ( unsigned short ) MatcherTable[Idx++] << 8 ;
3107
+ Opc |= static_cast < uint16_t >( MatcherTable[Idx++]) << 8 ;
3105
3108
if (Opc >= OpcodeOffset.size ())
3106
3109
OpcodeOffset.resize ((Opc+1 )*2 );
3107
3110
OpcodeOffset[Opc] = Idx;
@@ -3118,7 +3121,8 @@ void SelectionDAGISel::SelectCodeCommon(SDNode *NodeToMatch,
3118
3121
#ifndef NDEBUG
3119
3122
unsigned CurrentOpcodeIndex = MatcherIndex;
3120
3123
#endif
3121
- BuiltinOpcodes Opcode = (BuiltinOpcodes)MatcherTable[MatcherIndex++];
3124
+ BuiltinOpcodes Opcode =
3125
+ static_cast <BuiltinOpcodes>(MatcherTable[MatcherIndex++]);
3122
3126
switch (Opcode) {
3123
3127
case OPC_Scope: {
3124
3128
// Okay, the semantics of this operation are that we should push a scope
@@ -3327,7 +3331,7 @@ void SelectionDAGISel::SelectCodeCommon(SDNode *NodeToMatch,
3327
3331
if (CaseSize == 0 ) break ;
3328
3332
3329
3333
uint16_t Opc = MatcherTable[MatcherIndex++];
3330
- Opc |= ( unsigned short ) MatcherTable[MatcherIndex++] << 8 ;
3334
+ Opc |= static_cast < uint16_t >( MatcherTable[MatcherIndex++]) << 8 ;
3331
3335
3332
3336
// If the opcode matches, then we will execute this case.
3333
3337
if (CurNodeOpcode == Opc)
@@ -3357,7 +3361,8 @@ void SelectionDAGISel::SelectCodeCommon(SDNode *NodeToMatch,
3357
3361
CaseSize = GetVBR (CaseSize, MatcherTable, MatcherIndex);
3358
3362
if (CaseSize == 0 ) break ;
3359
3363
3360
- MVT CaseVT = (MVT::SimpleValueType)MatcherTable[MatcherIndex++];
3364
+ MVT CaseVT =
3365
+ static_cast <MVT::SimpleValueType>(MatcherTable[MatcherIndex++]);
3361
3366
if (CaseVT == MVT::iPTR)
3362
3367
CaseVT = TLI->getPointerTy (CurDAG->getDataLayout ());
3363
3368
@@ -3474,7 +3479,7 @@ void SelectionDAGISel::SelectCodeCommon(SDNode *NodeToMatch,
3474
3479
VT = MVT::i64;
3475
3480
break ;
3476
3481
default :
3477
- VT = ( MVT::SimpleValueType) MatcherTable[MatcherIndex++];
3482
+ VT = static_cast < MVT::SimpleValueType>( MatcherTable[MatcherIndex++]) ;
3478
3483
break ;
3479
3484
}
3480
3485
int64_t Val = MatcherTable[MatcherIndex++];
@@ -3488,7 +3493,7 @@ void SelectionDAGISel::SelectCodeCommon(SDNode *NodeToMatch,
3488
3493
}
3489
3494
case OPC_EmitRegister: {
3490
3495
MVT::SimpleValueType VT =
3491
- ( MVT::SimpleValueType) MatcherTable[MatcherIndex++];
3496
+ static_cast < MVT::SimpleValueType>( MatcherTable[MatcherIndex++]) ;
3492
3497
unsigned RegNo = MatcherTable[MatcherIndex++];
3493
3498
RecordedNodes.push_back (std::pair<SDValue, SDNode*>(
3494
3499
CurDAG->getRegister (RegNo, VT), nullptr ));
@@ -3499,7 +3504,7 @@ void SelectionDAGISel::SelectCodeCommon(SDNode *NodeToMatch,
3499
3504
// values are stored in two bytes in the matcher table (just like
3500
3505
// opcodes).
3501
3506
MVT::SimpleValueType VT =
3502
- ( MVT::SimpleValueType) MatcherTable[MatcherIndex++];
3507
+ static_cast < MVT::SimpleValueType>( MatcherTable[MatcherIndex++]) ;
3503
3508
unsigned RegNo = MatcherTable[MatcherIndex++];
3504
3509
RegNo |= MatcherTable[MatcherIndex++] << 8 ;
3505
3510
RecordedNodes.push_back (std::pair<SDValue, SDNode*>(
@@ -3645,7 +3650,7 @@ void SelectionDAGISel::SelectCodeCommon(SDNode *NodeToMatch,
3645
3650
case OPC_EmitNode0: case OPC_EmitNode1: case OPC_EmitNode2:
3646
3651
case OPC_MorphNodeTo0: case OPC_MorphNodeTo1: case OPC_MorphNodeTo2: {
3647
3652
uint16_t TargetOpc = MatcherTable[MatcherIndex++];
3648
- TargetOpc |= ( unsigned short ) MatcherTable[MatcherIndex++] << 8 ;
3653
+ TargetOpc |= static_cast < uint16_t >( MatcherTable[MatcherIndex++]) << 8 ;
3649
3654
unsigned EmitNodeInfo = MatcherTable[MatcherIndex++];
3650
3655
// Get the result VT list.
3651
3656
unsigned NumVTs;
@@ -3660,7 +3665,7 @@ void SelectionDAGISel::SelectCodeCommon(SDNode *NodeToMatch,
3660
3665
SmallVector<EVT, 4 > VTs;
3661
3666
for (unsigned i = 0 ; i != NumVTs; ++i) {
3662
3667
MVT::SimpleValueType VT =
3663
- ( MVT::SimpleValueType) MatcherTable[MatcherIndex++];
3668
+ static_cast < MVT::SimpleValueType>( MatcherTable[MatcherIndex++]) ;
3664
3669
if (VT == MVT::iPTR)
3665
3670
VT = TLI->getPointerTy (CurDAG->getDataLayout ()).SimpleTy ;
3666
3671
VTs.push_back (VT);
0 commit comments