summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGVtable.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-02-11 19:45:15 +0000
committerAnders Carlsson <andersca@mac.com>2010-02-11 19:45:15 +0000
commitdd27b5d7bb90b0d6fbdc043ed1dd31fe083cd2cf (patch)
treeaaca2adb18528aa620fbb534dc1bcea70406ca6f /clang/lib/CodeGen/CGVtable.cpp
parent727ffb14a1682493d717f97c869fd56978bcd565 (diff)
downloadbcm5719-llvm-dd27b5d7bb90b0d6fbdc043ed1dd31fe083cd2cf.tar.gz
bcm5719-llvm-dd27b5d7bb90b0d6fbdc043ed1dd31fe083cd2cf.zip
Use getAs instead of cast/dyn_cast on types. (I'm sure Doug will appreciate this).
llvm-svn: 95911
Diffstat (limited to 'clang/lib/CodeGen/CGVtable.cpp')
-rw-r--r--clang/lib/CodeGen/CGVtable.cpp12
1 files changed, 6 insertions, 6 deletions
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<ReferenceType>(CanDerivedType)) {
+ if (const ReferenceType *RT = CanDerivedType->getAs<ReferenceType>()) {
CanDerivedType = RT->getPointeeType();
- CanBaseType = cast<ReferenceType>(CanBaseType)->getPointeeType();
- } else if (const PointerType *PT = dyn_cast<PointerType>(CanDerivedType)) {
+ CanBaseType = CanBaseType->getAs<ReferenceType>()->getPointeeType();
+ } else if (const PointerType *PT = CanDerivedType->getAs<PointerType>()) {
CanDerivedType = PT->getPointeeType();
- CanBaseType = cast<PointerType>(CanBaseType)->getPointeeType();
+ CanBaseType = CanBaseType->getAs<PointerType>()->getPointeeType();
} else {
assert(false && "Unexpected return type!");
}
@@ -91,10 +91,10 @@ TypeConversionRequiresAdjustment(ASTContext &Ctx,
}
const CXXRecordDecl *DerivedDecl =
- cast<CXXRecordDecl>(cast<RecordType>(CanDerivedType)->getDecl());
+ cast<CXXRecordDecl>(CanDerivedType->getAs<RecordType>()->getDecl());
const CXXRecordDecl *BaseDecl =
- cast<CXXRecordDecl>(cast<RecordType>(CanBaseType)->getDecl());
+ cast<CXXRecordDecl>(CanBaseType->getAs<RecordType>()->getDecl());
return TypeConversionRequiresAdjustment(Ctx, DerivedDecl, BaseDecl);
}
OpenPOWER on IntegriCloud