Mesa (master): r600g/llvm: Remove unnecessary dynamic casts

Tom Stellard tstellar at kemper.freedesktop.org
Mon Apr 30 20:58:51 UTC 2012


Module: Mesa
Branch: master
Commit: 7bf3fe851c9ac45f0c297d05b5272c3b312109d7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7bf3fe851c9ac45f0c297d05b5272c3b312109d7

Author: Dragomir Ivanov <drago.ivanov at gmail.com>
Date:   Sat Apr 28 22:02:48 2012 +0300

r600g/llvm: Remove unnecessary dynamic casts

When the result of dynamic_cast is not checked, it can be replaced with
static_cast

Signed-off-by: Tom Stellard <thomas.stellard at amd.com>

---

 src/gallium/drivers/radeon/AMDILISelLowering.cpp |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/radeon/AMDILISelLowering.cpp b/src/gallium/drivers/radeon/AMDILISelLowering.cpp
index 54c6ea6..b4082e0 100644
--- a/src/gallium/drivers/radeon/AMDILISelLowering.cpp
+++ b/src/gallium/drivers/radeon/AMDILISelLowering.cpp
@@ -3191,7 +3191,7 @@ AMDILTargetLowering::LowerFP_TO_SINT(SDValue Op, SelectionDAG &DAG) const
     amdtm = reinterpret_cast<const AMDILTargetMachine*>
     (&this->getTargetMachine());
   const AMDILSubtarget*
-    stm = dynamic_cast<const AMDILSubtarget*>(
+    stm = static_cast<const AMDILSubtarget*>(
         amdtm->getSubtargetImpl());
   if (RST == MVT::f64 && RHSVT.isVector()
       && stm->device()->getGeneration() > AMDILDeviceInfo::HD6XXX)  {
@@ -3248,7 +3248,7 @@ AMDILTargetLowering::LowerFP_TO_UINT(SDValue Op, SelectionDAG &DAG) const
     amdtm = reinterpret_cast<const AMDILTargetMachine*>
     (&this->getTargetMachine());
   const AMDILSubtarget*
-    stm = dynamic_cast<const AMDILSubtarget*>(
+    stm = static_cast<const AMDILSubtarget*>(
         amdtm->getSubtargetImpl());
   if (RST == MVT::f64 && RHSVT.isVector()
       && stm->device()->getGeneration() > AMDILDeviceInfo::HD6XXX)  {
@@ -3314,7 +3314,7 @@ AMDILTargetLowering::genu32tof64(SDValue RHS, EVT LHSVT,
     amdtm = reinterpret_cast<const AMDILTargetMachine*>
     (&this->getTargetMachine());
   const AMDILSubtarget*
-    stm = dynamic_cast<const AMDILSubtarget*>(
+    stm = static_cast<const AMDILSubtarget*>(
         amdtm->getSubtargetImpl());
   if (stm->calVersion() >= CAL_VERSION_SC_135) {
     // unsigned x = RHS;
@@ -3489,7 +3489,7 @@ AMDILTargetLowering::LowerUINT_TO_FP(SDValue Op, SelectionDAG &DAG) const
     amdtm = reinterpret_cast<const AMDILTargetMachine*>
     (&this->getTargetMachine());
   const AMDILSubtarget*
-    stm = dynamic_cast<const AMDILSubtarget*>(
+    stm = static_cast<const AMDILSubtarget*>(
         amdtm->getSubtargetImpl());
   if (LST == MVT::f64 && LHSVT.isVector()
       && stm->device()->getGeneration() > AMDILDeviceInfo::HD6XXX)  {
@@ -3543,7 +3543,7 @@ AMDILTargetLowering::LowerSINT_TO_FP(SDValue Op, SelectionDAG &DAG) const
     amdtm = reinterpret_cast<const AMDILTargetMachine*>
     (&this->getTargetMachine());
   const AMDILSubtarget*
-    stm = dynamic_cast<const AMDILSubtarget*>(
+    stm = static_cast<const AMDILSubtarget*>(
         amdtm->getSubtargetImpl());
   if (LST == MVT::f64 && LHSVT.isVector()
       && stm->device()->getGeneration() > AMDILDeviceInfo::HD6XXX)  {




More information about the mesa-commit mailing list