From ea2fea2a6033983a0943fadf9689f978879feb16 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<>. llvm-svn: 166684 --- clang/lib/CodeGen/CodeGenFunction.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp') diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 34cdaa9..53de907 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/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.1