summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-02-14 20:13:28 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-02-14 20:13:28 +0000
commit99bed6fd21ca033074897160af1d971f6b5a9249 (patch)
tree88f6f47f84c04e77a0e7da8629db9db90f36b672 /clang/lib/AST/ASTContext.cpp
parentb6ba4682b501e3d6072a3839e11366da2549ff91 (diff)
downloadbcm5719-llvm-99bed6fd21ca033074897160af1d971f6b5a9249.tar.gz
bcm5719-llvm-99bed6fd21ca033074897160af1d971f6b5a9249.zip
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). llvm-svn: 64563
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index d4fe26ed678..652fcdf8080 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/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,
OpenPOWER on IntegriCloud