From 956a5a17713deb1b5b27893303c4f308a1bd2a62 Mon Sep 17 00:00:00 2001 From: Micah Villmow Date: Thu, 25 Oct 2012 15:39:14 +0000 Subject: Cleanup some clang code to use new type functions instead of using cast<>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166684 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenFunction.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/CodeGen/CodeGenFunction.cpp') diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp index 34cdaa94fd..53de9074b4 100644 --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/lib/CodeGen/CodeGenFunction.cpp @@ -1001,8 +1001,7 @@ llvm::Value *CodeGenFunction::emitArrayLength(const ArrayType *origArrayType, arrayType = getContext().getAsArrayType(eltType); } - unsigned AddressSpace = - cast(addr->getType())->getAddressSpace(); + unsigned AddressSpace = addr->getType()->getPointerAddressSpace(); llvm::Type *BaseType = ConvertType(eltType)->getPointerTo(AddressSpace); addr = Builder.CreateBitCast(addr, BaseType, "array.begin"); } else { -- cgit v1.2.3-70-g09d2