From fe655dc15598ebd4c8077e4a67914e7f233e0774 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187309 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/IR/DataLayout.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/IR/DataLayout.cpp b/lib/IR/DataLayout.cpp index d1096d74242..d786d33f9ca 100644 --- a/lib/IR/DataLayout.cpp +++ b/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.34.1