diff options
Diffstat (limited to 'lib/AST/Type.cpp')
-rw-r--r-- | lib/AST/Type.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 31af6fb661..4f884989ae 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -360,6 +360,17 @@ const ObjCObjectPointerType *Type::getAsObjCInterfacePointerType() const { return 0; } +ObjCInterfaceDecl *ObjCInterfaceType::getDecl() const { + for (ObjCInterfaceDecl::redecl_iterator I = Decl->redecls_begin(), + E = Decl->redecls_end(); + I != E; ++I) { + if (I->isDefinition()) + return *I; + } + // If we can't find a definition, return whatever we have. + return Decl; +} + const CXXRecordDecl *Type::getCXXRecordDeclForPointerType() const { if (const PointerType *PT = getAs<PointerType>()) if (const RecordType *RT = PT->getPointeeType()->getAs<RecordType>()) |