aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorMicah Villmow <villmow@gmail.com>2012-10-25 15:39:14 +0000
committerMicah Villmow <villmow@gmail.com>2012-10-25 15:39:14 +0000
commit956a5a17713deb1b5b27893303c4f308a1bd2a62 (patch)
tree74f8b7ec7e1a35af00fa26528fb763dab049cd1e /lib/CodeGen/CodeGenFunction.cpp
parent37c94bfdc82f0e3526e7f7fc33ee9c817159ed4d (diff)
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
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--lib/CodeGen/CodeGenFunction.cpp3
1 files changed, 1 insertions, 2 deletions
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<llvm::PointerType>(addr->getType())->getAddressSpace();
+ unsigned AddressSpace = addr->getType()->getPointerAddressSpace();
llvm::Type *BaseType = ConvertType(eltType)->getPointerTo(AddressSpace);
addr = Builder.CreateBitCast(addr, BaseType, "array.begin");
} else {