From dd27b5d7bb90b0d6fbdc043ed1dd31fe083cd2cf Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Thu, 11 Feb 2010 19:45:15 +0000 Subject: Use getAs instead of cast/dyn_cast on types. (I'm sure Doug will appreciate this). llvm-svn: 95911 --- clang/lib/CodeGen/CGVtable.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'clang/lib/CodeGen/CGVtable.cpp') diff --git a/clang/lib/CodeGen/CGVtable.cpp b/clang/lib/CodeGen/CGVtable.cpp index 703e0970e37..70c9c6c8eed 100644 --- a/clang/lib/CodeGen/CGVtable.cpp +++ b/clang/lib/CodeGen/CGVtable.cpp @@ -75,12 +75,12 @@ TypeConversionRequiresAdjustment(ASTContext &Ctx, return false; } - if (const ReferenceType *RT = dyn_cast(CanDerivedType)) { + if (const ReferenceType *RT = CanDerivedType->getAs()) { CanDerivedType = RT->getPointeeType(); - CanBaseType = cast(CanBaseType)->getPointeeType(); - } else if (const PointerType *PT = dyn_cast(CanDerivedType)) { + CanBaseType = CanBaseType->getAs()->getPointeeType(); + } else if (const PointerType *PT = CanDerivedType->getAs()) { CanDerivedType = PT->getPointeeType(); - CanBaseType = cast(CanBaseType)->getPointeeType(); + CanBaseType = CanBaseType->getAs()->getPointeeType(); } else { assert(false && "Unexpected return type!"); } @@ -91,10 +91,10 @@ TypeConversionRequiresAdjustment(ASTContext &Ctx, } const CXXRecordDecl *DerivedDecl = - cast(cast(CanDerivedType)->getDecl()); + cast(CanDerivedType->getAs()->getDecl()); const CXXRecordDecl *BaseDecl = - cast(cast(CanBaseType)->getDecl()); + cast(CanBaseType->getAs()->getDecl()); return TypeConversionRequiresAdjustment(Ctx, DerivedDecl, BaseDecl); } -- cgit v1.2.3