From: Jakub Staszak Date: Tue, 1 May 2012 23:06:00 +0000 (+0000) Subject: Use dyn_cast instead of checking opcode and cast. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ce00b440f5d754aaf7196255bc139ce64c260e00;p=oota-llvm.git Use dyn_cast instead of checking opcode and cast. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155957 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 0f2a5dff963..d6b866fb559 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -2246,8 +2246,7 @@ unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, unsigned Depth) const{ } // Handle LOADX separately here. EXTLOAD case will fallthrough. - if (Op.getOpcode() == ISD::LOAD) { - LoadSDNode *LD = cast(Op); + if (LoadSDNode *LD = dyn_cast(Op)) { unsigned ExtType = LD->getExtensionType(); switch (ExtType) { default: break;