Add create methods for ObjCCategoryDecl, ObjCForwardProtocolDecl, ObjCClassDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48426 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 28a92c7..7bdfd9e 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -268,8 +268,8 @@
Protocols.push_back(PDecl);
}
- return new ObjCForwardProtocolDecl(AtProtocolLoc,
- &Protocols[0], Protocols.size());
+ return ObjCForwardProtocolDecl::Create(Context, AtProtocolLoc,
+ &Protocols[0], Protocols.size());
}
Sema::DeclTy *Sema::ActOnStartCategoryInterface(
@@ -280,8 +280,9 @@
SourceLocation EndProtoLoc) {
ObjCInterfaceDecl *IDecl = getObjCInterfaceDecl(ClassName);
- ObjCCategoryDecl *CDecl = new ObjCCategoryDecl(AtInterfaceLoc, NumProtoRefs,
- CategoryName);
+ ObjCCategoryDecl *CDecl =
+ ObjCCategoryDecl::Create(Context, AtInterfaceLoc, NumProtoRefs,
+ CategoryName);
CDecl->setClassInterface(IDecl);
/// Check that class of this category is already completely declared.
@@ -605,7 +606,8 @@
Interfaces.push_back(IDecl);
}
- return new ObjCClassDecl(AtClassLoc, &Interfaces[0], Interfaces.size());
+ return ObjCClassDecl::Create(Context, AtClassLoc,
+ &Interfaces[0], Interfaces.size());
}