Add create methods for ObjCIvarDecl and ObjCInterfaceDecl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48408 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 4dd84d8..d5d658d 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -98,7 +98,8 @@
}
}
else {
- IDecl = new ObjCInterfaceDecl(AtInterfaceLoc, NumProtocols, ClassName);
+ IDecl = ObjCInterfaceDecl::Create(Context, AtInterfaceLoc, NumProtocols,
+ ClassName);
// Chain & install the interface decl into the identifier.
IDecl->setNext(ClassName->getFETokenInfo<ScopedDecl>());
@@ -382,8 +383,8 @@
if (!IDecl) {
// Legacy case of @implementation with no corresponding @interface.
// Build, chain & install the interface decl into the identifier.
- IDecl = new ObjCInterfaceDecl(AtClassImplLoc, 0, ClassName,
- false, true);
+ IDecl = ObjCInterfaceDecl::Create(Context, AtClassImplLoc, 0, ClassName,
+ false, true);
IDecl->setNext(ClassName->getFETokenInfo<ScopedDecl>());
ClassName->setFETokenInfo(IDecl);
IDecl->setSuperClass(SDecl);
@@ -589,7 +590,8 @@
}
ObjCInterfaceDecl *IDecl = dyn_cast_or_null<ObjCInterfaceDecl>(PrevDecl);
if (!IDecl) { // Not already seen? Make a forward decl.
- IDecl = new ObjCInterfaceDecl(AtClassLoc, 0, IdentList[i], true);
+ IDecl = ObjCInterfaceDecl::Create(Context, AtClassLoc, 0, IdentList[i],
+ true);
// Chain & install the interface decl into the identifier.
IDecl->setNext(IdentList[i]->getFETokenInfo<ScopedDecl>());
IdentList[i]->setFETokenInfo(IDecl);