From fc4f2fb0da5bea73f29af07b261042d523b3516b Mon Sep 17 00:00:00 2001 From: Sean Callanan Date: Wed, 14 Dec 2011 01:13:04 +0000 Subject: This commit is the result of a general audit of the expression parser to locate instances where dyn_cast<>() and isa<>() are used on types, and replace them with getAs<>() as appropriate. The difference is that dyn_cast<>() and isa<>() are essentially LLVM/Clang's equivalent of RTTI -- that is, they try to downcast the object and return NULL if they cannot -- but getAs<>() can traverse typedefs to perform a semantic cast. llvm-svn: 146537 --- lldb/source/Expression/ClangASTSource.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lldb/source/Expression/ClangASTSource.cpp') diff --git a/lldb/source/Expression/ClangASTSource.cpp b/lldb/source/Expression/ClangASTSource.cpp index 9831070c9be..1f84185042a 100644 --- a/lldb/source/Expression/ClangASTSource.cpp +++ b/lldb/source/Expression/ClangASTSource.cpp @@ -220,7 +220,7 @@ ClangASTSource::CompleteType (TagDecl *tag_decl) if (!opaque_type) continue; - const TagType *tag_type = dyn_cast(QualType::getFromOpaquePtr(opaque_type).getTypePtr()); + const TagType *tag_type = QualType::getFromOpaquePtr(opaque_type)->getAs(); if (!tag_type) continue; @@ -258,7 +258,7 @@ ClangASTSource::CompleteType (TagDecl *tag_decl) if (!opaque_type) continue; - const TagType *tag_type = dyn_cast(QualType::getFromOpaquePtr(opaque_type).getTypePtr()); + const TagType *tag_type = QualType::getFromOpaquePtr(opaque_type)->getAs(); if (!tag_type) continue; @@ -677,7 +677,7 @@ ClangASTSource::FindObjCMethodDecls (NameSearchContext &context) QualType backing_qual_type = QualType::getFromOpaquePtr(backing_type); - const ObjCInterfaceType *backing_interface_type = dyn_cast(backing_qual_type.getTypePtr()); + const ObjCInterfaceType *backing_interface_type = backing_qual_type.getTypePtr()->getAs(); if (!backing_interface_type) continue; @@ -1067,7 +1067,7 @@ NameSearchContext::AddFunDecl (void *type) // this, we raid the function's FunctionProtoType for types. QualType qual_type (QualType::getFromOpaquePtr(type)); - const FunctionProtoType *func_proto_type = dyn_cast(qual_type.getTypePtr()); + const FunctionProtoType *func_proto_type = qual_type.getTypePtr()->getAs(); if (func_proto_type) { @@ -1128,7 +1128,7 @@ NameSearchContext::AddTypeDecl(void *type) { QualType qual_type = QualType::getFromOpaquePtr(type); - if (const TagType *tag_type = dyn_cast(qual_type)) + if (const TagType *tag_type = qual_type->getAs()) { TagDecl *tag_decl = tag_type->getDecl(); @@ -1136,7 +1136,7 @@ NameSearchContext::AddTypeDecl(void *type) return tag_decl; } - else if (const ObjCObjectType *objc_object_type = dyn_cast(qual_type)) + else if (const ObjCObjectType *objc_object_type = qual_type->getAs()) { ObjCInterfaceDecl *interface_decl = objc_object_type->getInterface(); -- cgit v1.2.3