diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-02-14 20:13:28 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-02-14 20:13:28 +0000 |
commit | f3710babc1ba40779c0fc64e6657cfc84dee7545 (patch) | |
tree | fea5ae5ea5cb5cd1835fe5f71cf23f871c12a99f /lib/AST/ASTContext.cpp | |
parent | 59843ad8835d497cd3c17ff91aa039e31d607791 (diff) |
Fixed a problem caused by foreward @class use
which consequently caused a Seg fault. during meta-data
generation. It also addresses an issue related to
late binding of newly synthesize ivars (when we support it).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64563 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r-- | lib/AST/ASTContext.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index d4fe26ed67..652fcdf808 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -1210,6 +1210,18 @@ QualType ASTContext::getObjCInterfaceType(ObjCInterfaceDecl *Decl) { return QualType(Decl->TypeForDecl, 0); } +/// buildObjCInterfaceType - Returns a new type for the interface +/// declaration, regardless. It also removes any previously built +/// record declaration so caller can rebuild it. +QualType ASTContext::buildObjCInterfaceType(ObjCInterfaceDecl *Decl) { + const RecordDecl *&RD = ASTRecordForInterface[Decl]; + if (RD) + RD = 0; + Decl->TypeForDecl = new(*this,8) ObjCInterfaceType(Type::ObjCInterface, Decl); + Types.push_back(Decl->TypeForDecl); + return QualType(Decl->TypeForDecl, 0); +} + /// \brief Retrieve the template type parameter type for a template /// parameter with the given depth, index, and (optionally) name. QualType ASTContext::getTemplateTypeParmType(unsigned Depth, unsigned Index, |