]> granicus.if.org Git - llvm/commitdiff
Use cast<> instead of unchecked dyn_cast<>
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 18 Sep 2014 22:28:56 +0000 (22:28 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 18 Sep 2014 22:28:56 +0000 (22:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218085 91177308-0d34-0410-b5e6-96231b3b80d8

lib/IR/DataLayout.cpp

index 388735386709cadf1dd107c01d1ca0c2ec36f8ba..7496268b4094b65ada51e6d3f52d48e965e796fc 100644 (file)
@@ -641,7 +641,7 @@ unsigned DataLayout::getAlignment(Type *Ty, bool abi_or_pref) const {
             ? getPointerABIAlignment(0)
             : getPointerPrefAlignment(0));
   case Type::PointerTyID: {
-    unsigned AS = dyn_cast<PointerType>(Ty)->getAddressSpace();
+    unsigned AS = cast<PointerType>(Ty)->getAddressSpace();
     return (abi_or_pref
             ? getPointerABIAlignment(AS)
             : getPointerPrefAlignment(AS));