summaryrefslogtreecommitdiffstats
path: root/clang/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
commitea2fea2a6033983a0943fadf9689f978879feb16 (patch)
tree6d778b60bdf9067017bc63772a57b85eecd2a743 /clang/lib/CodeGen/CodeGenFunction.cpp
parent920cff606bea1251dcf3bfd836031741943c7f92 (diff)
downloadbcm5719-llvm-ea2fea2a6033983a0943fadf9689f978879feb16.tar.gz
bcm5719-llvm-ea2fea2a6033983a0943fadf9689f978879feb16.zip
Cleanup some clang code to use new type functions instead of using cast<>.
llvm-svn: 166684
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 34cdaa94fd7..53de9074b44 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<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 {
OpenPOWER on IntegriCloud