MandarinISelLowering.cpp
// Convert to a target node and set target flags.

Convert to a target node and set target flags.
Convert to a target node and set target flags .
SDValue MandarinTargetLowering::withTargetFlags(SDValue Op, unsigned TF,
                                             SelectionDAG &DAG) const
{
  if (const GlobalAddressSDNode *GA = dyn_cast<GlobalAddressSDNode>(Op))
    return DAG.getTargetGlobalAddress(GA->getGlobal(),
                                      SDLoc(GA),
                                      GA->getValueType(0),
                                      GA->getOffset(), TF);
  if (const ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(Op))
    return DAG.getTargetConstantPool(CP->getConstVal(),
                                     CP->getValueType(0),
                                     CP->getAlignment(),
                                     CP->getOffset(), TF);
  if (const BlockAddressSDNode *BA = dyn_cast<BlockAddressSDNode>(Op))
    return DAG.getTargetBlockAddress(BA->getBlockAddress(),
                                     Op.getValueType(),
                                     0,
                                     TF);
  if (const ExternalSymbolSDNode *ES = dyn_cast<ExternalSymbolSDNode>(Op))
    return DAG.getTargetExternalSymbol(ES->getSymbol(),
                                       ES->getValueType(0), TF);
  llvm_unreachable("Unhandled address SDNode");
}
SDValue MandarinTargetLowering :: withTargetFlags ( SDValue Op , unsigned TF , SelectionDAG & DAG ) const { if ( const GlobalAddressSDNode * GA = dyn_cast < GlobalAddressSDNode > ( Op ) ) return DAG . getTargetGlobalAddress ( GA -> getGlobal ( ) , SDLoc ( GA ) , GA -> getValueType ( 0 ) , GA -> getOffset ( ) , TF ) ; if ( const ConstantPoolSDNode * CP = dyn_cast < ConstantPoolSDNode > ( Op ) ) return DAG . getTargetConstantPool ( CP -> getConstVal ( ) , CP -> getValueType ( 0 ) , CP -> getAlignment ( ) , CP -> getOffset ( ) , TF ) ; if ( const BlockAddressSDNode * BA = dyn_cast < BlockAddressSDNode > ( Op ) ) return DAG . getTargetBlockAddress ( BA -> getBlockAddress ( ) , Op . getValueType ( ) , 0 , TF ) ; if ( const ExternalSymbolSDNode * ES = dyn_cast < ExternalSymbolSDNode > ( Op ) ) return DAG . getTargetExternalSymbol ( ES -> getSymbol ( ) , ES -> getValueType ( 0 ) , TF ) ; llvm_unreachable ( " " ) ; }
Convert to a target node and set target flags.
Convert to a target node and set target flags .