From 517cf483c0a17278c2b8688c6c00b3673ca09649 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Sat, 27 Jul 2013 19:22:28 +0000 Subject: [PATCH] Minor code simplification suggested by Duncan llvm-svn: 187309 --- llvm/lib/IR/DataLayout.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/llvm/lib/IR/DataLayout.cpp b/llvm/lib/IR/DataLayout.cpp index d1096d7..d786d33 100644 --- a/llvm/lib/IR/DataLayout.cpp +++ b/llvm/lib/IR/DataLayout.cpp @@ -514,8 +514,7 @@ unsigned DataLayout::getPointerTypeSizeInBits(Type *Ty) const { if (Ty->isPointerTy()) return getTypeSizeInBits(Ty); - Type *EleTy = cast(Ty)->getElementType(); - return getTypeSizeInBits(EleTy); + return getTypeSizeInBits(Ty->getScalarType()); } /*! -- 2.7.4