Commit more code over to new cast style
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@697 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp
index 24a5e85..0b4dc98 100644
--- a/lib/Target/TargetData.cpp
+++ b/lib/Target/TargetData.cpp
@@ -147,14 +147,14 @@
unsigned TargetData::getIndexedOffset(const Type *ptrTy,
const vector<ConstPoolVal*> &Idx) const {
- const PointerType *PtrTy = ptrTy->castPointerType();
+ const PointerType *PtrTy = cast<const PointerType>(ptrTy);
unsigned Result = 0;
// Get the type pointed to...
const Type *Ty = PtrTy->getValueType();
for (unsigned CurIDX = 0; CurIDX < Idx.size(); ++CurIDX) {
- if (const StructType *STy = Ty->dyncastStructType()) {
+ if (const StructType *STy = dyn_cast<const StructType>(Ty)) {
assert(Idx[CurIDX]->getType() == Type::UByteTy && "Illegal struct idx");
unsigned FieldNo = ((ConstPoolUInt*)Idx[CurIDX++])->getValue();
@@ -168,7 +168,7 @@
// Update Ty to refer to current element
Ty = STy->getElementTypes()[FieldNo];
- } else if (const ArrayType *ATy = Ty->dyncastArrayType()) {
+ } else if (const ArrayType *ATy = dyn_cast<const ArrayType>(Ty)) {
assert(0 && "Loading from arrays not implemented yet!");
} else {
assert(0 && "Indexing type that is not struct or array?");