switch the rest of the C decl classes to do their
allocation through ASTContext.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48403 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp
index 4bd04e3..f4c271c 100644
--- a/lib/Sema/Sema.cpp
+++ b/lib/Sema/Sema.cpp
@@ -116,8 +116,8 @@
RecordDecl *ObjectTag =
RecordDecl::Create(Context, Decl::Struct, SourceLocation(),
&IT.get("objc_object"), 0);
- FieldDecl *IsaDecl = new FieldDecl(SourceLocation(), 0,
- Context.getObjCClassType());
+ FieldDecl *IsaDecl = FieldDecl::Create(Context, SourceLocation(), 0,
+ Context.getObjCClassType());
ObjectTag->defineBody(&IsaDecl, 1);
QualType ObjT = Context.getPointerType(Context.getTagDeclType(ObjectTag));
TypedefDecl *IdTypedef = TypedefDecl::Create(Context, SourceLocation(),
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 7914e86..28b396a 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -1332,7 +1332,7 @@
FieldDecl *NewFD;
if (isa<RecordDecl>(static_cast<Decl *>(TagDecl)))
- NewFD = new FieldDecl(Loc, II, T, BitWidth);
+ NewFD = FieldDecl::Create(Context, Loc, II, T, BitWidth);
else if (isa<ObjCInterfaceDecl>(static_cast<Decl *>(TagDecl)) ||
isa<ObjCImplementationDecl>(static_cast<Decl *>(TagDecl)) ||
isa<ObjCCategoryDecl>(static_cast<Decl *>(TagDecl)) ||
@@ -1750,7 +1750,7 @@
ExprTy *expr) {
StringLiteral *AsmString = cast<StringLiteral>((Expr*)expr);
- return new FileScopeAsmDecl(Loc, AsmString);
+ return FileScopeAsmDecl::Create(Context, Loc, AsmString);
}
Sema::DeclTy* Sema::ActOnLinkageSpec(SourceLocation Loc,
@@ -1771,7 +1771,7 @@
}
// FIXME: Add all the various semantics of linkage specifications
- return new LinkageSpecDecl(Loc, Language, dcl);
+ return LinkageSpecDecl::Create(Context, Loc, Language, dcl);
}
void Sema::HandleDeclAttribute(Decl *New, AttributeList *Attr) {