aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/TargetData.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/TargetData.cpp')
-rw-r--r--lib/Target/TargetData.cpp6
1 files changed, 3 insertions, 3 deletions
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 char TargetData::getTypeAlignment(const Type *Ty) const {
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 @@ unsigned TargetData::getIndexedOffset(const Type *ptrTy,
// 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?");