aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2008-10-16 16:50:47 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2008-10-16 16:50:47 +0000
commit1e6759e9e33dcaa73ce14c8a908ac9f87ac16463 (patch)
treefdbe3c2f3175462c78da3fa82e5832accb3edf34
parent4fa4ab67dd9aa12752e1fa1421d9f4f7c937dec7 (diff)
Using dyn_cast_or_null here is redundant, use dyn_cast instead.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57642 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/AST/ASTContext.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index e8d7978bca..8d9dceb81c 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -931,23 +931,23 @@ QualType ASTContext::getFunctionType(QualType ResultTy,const QualType *ArgArray,
/// getTypeDeclType - Return the unique reference to the type for the
/// specified type declaration.
QualType ASTContext::getTypeDeclType(TypeDecl *Decl, TypeDecl* PrevDecl) {
+ assert(Decl && "Passed null for Decl param");
if (Decl->TypeForDecl) return QualType(Decl->TypeForDecl, 0);
- if (TypedefDecl *Typedef = dyn_cast_or_null<TypedefDecl>(Decl))
+ if (TypedefDecl *Typedef = dyn_cast<TypedefDecl>(Decl))
return getTypedefType(Typedef);
- else if (ObjCInterfaceDecl *ObjCInterface
- = dyn_cast_or_null<ObjCInterfaceDecl>(Decl))
+ else if (ObjCInterfaceDecl *ObjCInterface = dyn_cast<ObjCInterfaceDecl>(Decl))
return getObjCInterfaceType(ObjCInterface);
- if (CXXRecordDecl *CXXRecord = dyn_cast_or_null<CXXRecordDecl>(Decl)) {
+ if (CXXRecordDecl *CXXRecord = dyn_cast<CXXRecordDecl>(Decl)) {
Decl->TypeForDecl = PrevDecl ? PrevDecl->TypeForDecl
: new CXXRecordType(CXXRecord);
}
- else if (RecordDecl *Record = dyn_cast_or_null<RecordDecl>(Decl)) {
+ else if (RecordDecl *Record = dyn_cast<RecordDecl>(Decl)) {
Decl->TypeForDecl = PrevDecl ? PrevDecl->TypeForDecl
: new RecordType(Record);
}
- else if (EnumDecl *Enum = dyn_cast_or_null<EnumDecl>(Decl))
+ else if (EnumDecl *Enum = dyn_cast<EnumDecl>(Decl))
Decl->TypeForDecl = new EnumType(Enum);
else
assert(false && "TypeDecl without a type?");