summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/ClangASTSource.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Expression/ClangASTSource.cpp')
-rw-r--r--lldb/source/Expression/ClangASTSource.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/lldb/source/Expression/ClangASTSource.cpp b/lldb/source/Expression/ClangASTSource.cpp
index b18536b5f9e..a23547d83dd 100644
--- a/lldb/source/Expression/ClangASTSource.cpp
+++ b/lldb/source/Expression/ClangASTSource.cpp
@@ -240,26 +240,26 @@ NameSearchContext::AddGenericFunDecl()
clang::NamedDecl *
NameSearchContext::AddTypeDecl(void *type)
{
- QualType qual_type = QualType::getFromOpaquePtr(type);
-
- if (TagType *tag_type = dyn_cast<clang::TagType>(qual_type))
- {
- TagDecl *tag_decl = tag_type->getDecl();
-
- m_decls.push_back(tag_decl);
-
- return tag_decl;
- }
- else if (ObjCObjectType *objc_object_type = dyn_cast<clang::ObjCObjectType>(qual_type))
- {
- ObjCInterfaceDecl *interface_decl = objc_object_type->getInterface();
-
- m_decls.push_back((NamedDecl*)interface_decl);
-
- return (NamedDecl*)interface_decl;
- }
- else
+ if (type)
{
- return NULL;
+ QualType qual_type = QualType::getFromOpaquePtr(type);
+
+ if (TagType *tag_type = dyn_cast<clang::TagType>(qual_type))
+ {
+ TagDecl *tag_decl = tag_type->getDecl();
+
+ m_decls.push_back(tag_decl);
+
+ return tag_decl;
+ }
+ else if (ObjCObjectType *objc_object_type = dyn_cast<clang::ObjCObjectType>(qual_type))
+ {
+ ObjCInterfaceDecl *interface_decl = objc_object_type->getInterface();
+
+ m_decls.push_back((NamedDecl*)interface_decl);
+
+ return (NamedDecl*)interface_decl;
+ }
}
+ return NULL;
}
OpenPOWER on IntegriCloud