From: Anders Carlsson Date: Thu, 11 Feb 2010 19:45:15 +0000 (+0000) Subject: Use getAs instead of cast/dyn_cast on types. (I'm sure Doug will appreciate this). X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9abb2736f6286578810f733a187d6f9595b62061;p=clang Use getAs instead of cast/dyn_cast on types. (I'm sure Doug will appreciate this). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95911 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp index 703e0970e3..70c9c6c8ee 100644 --- a/lib/CodeGen/CGVtable.cpp +++ b/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); }