Fix some uses of dyn_cast to be uses of cast.
authorDan Gohman <gohman@apple.com>
Mon, 23 Jul 2007 20:24:29 +0000 (20:24 +0000)
committerDan Gohman <gohman@apple.com>
Mon, 23 Jul 2007 20:24:29 +0000 (20:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40443 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/DwarfWriter.cpp
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
lib/Target/X86/X86ISelLowering.cpp

index 257a776d2f127821a4ea596d589b7cea5238da5d..e157e58bd4ceb09f8674805b2af018ad1cbb6702 100644 (file)
@@ -1546,7 +1546,7 @@ private:
                 break;
               }
               
-              FromTy = dyn_cast<DerivedTypeDesc>(FromTy)->getFromType();
+              FromTy = cast<DerivedTypeDesc>(FromTy)->getFromType();
             }
             
             // Unless we have a bit field.
index 4b768c23540bec6d956699619ab1c830ca36123c..9b146eef629773501eaf16d94e3c72e858223cee 100644 (file)
@@ -3210,7 +3210,7 @@ HandleSDNode::~HandleSDNode() {
 GlobalAddressSDNode::GlobalAddressSDNode(bool isTarget, const GlobalValue *GA,
                                          MVT::ValueType VT, int o)
   : SDNode(isa<GlobalVariable>(GA) &&
-           dyn_cast<GlobalVariable>(GA)->isThreadLocal() ?
+           cast<GlobalVariable>(GA)->isThreadLocal() ?
            // Thread Local
            (isTarget ? ISD::TargetGlobalTLSAddress : ISD::GlobalTLSAddress) :
            // Non Thread Local
index 2c4234b93fe640a015feff89aa8d9f77b11271e0..a25710ba5aaba8d38c43f80c9c5ef4089d1b7ab8 100644 (file)
@@ -4676,8 +4676,8 @@ static bool isConsecutiveLoad(SDNode *N, SDNode *Base, int Dist, int Size,
   if (Loc.getOpcode() == ISD::FrameIndex) {
     if (BaseLoc.getOpcode() != ISD::FrameIndex)
       return false;
-    int FI  = dyn_cast<FrameIndexSDNode>(Loc)->getIndex();
-    int BFI = dyn_cast<FrameIndexSDNode>(BaseLoc)->getIndex();
+    int FI  = cast<FrameIndexSDNode>(Loc)->getIndex();
+    int BFI = cast<FrameIndexSDNode>(BaseLoc)->getIndex();
     int FS  = MFI->getObjectSize(FI);
     int BFS = MFI->getObjectSize(BFI);
     if (FS != BFS || FS != Size) return false;
@@ -4704,7 +4704,7 @@ static bool isBaseAlignment16(SDNode *Base, MachineFrameInfo *MFI,
     return (GV->getAlignment() >= 16 && (Offset % 16) == 0);
   else {
     assert(Base->getOpcode() == ISD::FrameIndex && "Unexpected base node!");
-    int BFI = dyn_cast<FrameIndexSDNode>(Base)->getIndex();
+    int BFI = cast<FrameIndexSDNode>(Base)->getIndex();
     if (BFI < 0)
       // Fixed objects do not specify alignment, however the offsets are known.
       return ((Subtarget->getStackAlignment() % 16) == 0 &&