From 9abb2736f6286578810f733a187d6f9595b62061 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Thu, 11 Feb 2010 19:45:15 +0000 Subject: [PATCH] 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 --- lib/CodeGen/CGVtable.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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); } -- 2.40.0