From 36ac1cae1f3bf74f474b960c9c80d75f580154b3 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 16 Mar 2008 20:53:07 +0000 Subject: add two more Create methods. llvm-svn: 48428 --- clang/lib/Sema/SemaDeclObjC.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'clang/lib/Sema/SemaDeclObjC.cpp') diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index e07d3c59e67..f9da77ff2c5 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -330,8 +330,8 @@ Sema::DeclTy *Sema::ActOnStartCategoryImplementation( IdentifierInfo *ClassName, SourceLocation ClassLoc, IdentifierInfo *CatName, SourceLocation CatLoc) { ObjCInterfaceDecl *IDecl = getObjCInterfaceDecl(ClassName); - ObjCCategoryImplDecl *CDecl = new ObjCCategoryImplDecl(AtCatImplLoc, - CatName, IDecl); + ObjCCategoryImplDecl *CDecl = + ObjCCategoryImplDecl::Create(Context, AtCatImplLoc, CatName, IDecl); /// Check that class of this category is already completely declared. if (!IDecl || IDecl->isForwardDecl()) Diag(ClassLoc, diag::err_undef_interface, ClassName->getName()); @@ -401,10 +401,12 @@ Sema::DeclTy *Sema::ActOnStartClassImplementation( } ObjCImplementationDecl* IMPDecl = - new ObjCImplementationDecl(AtClassImplLoc, ClassName, IDecl, SDecl); + ObjCImplementationDecl::Create(Context, AtClassImplLoc, ClassName, + IDecl, SDecl); // Check that there is no duplicate implementation of this class. if (ObjCImplementations[ClassName]) + // FIXME: Don't leak everything! Diag(ClassLoc, diag::err_dup_implementation_class, ClassName->getName()); else // add it to the list. ObjCImplementations[ClassName] = IMPDecl; -- cgit v1.2.3