diff options
author | Chris Lattner <sabre@nondot.org> | 2001-10-02 03:41:24 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-10-02 03:41:24 +0000 |
commit | b00c582b6d40e6b9ff2d1ed4f5eaf7930e792ace (patch) | |
tree | 44b5f879c16e7ecb2e9334ad120e3454270e1bb3 /lib/Target/TargetData.cpp | |
parent | 1d87bcf4909b06dcd86320722653341f08b8b396 (diff) |
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
Diffstat (limited to 'lib/Target/TargetData.cpp')
-rw-r--r-- | lib/Target/TargetData.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp index 24a5e852a2..0b4dc98233 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?"); |