Remove the vast majority of the Destroy methods from the AST library,
since we aren't going to be calling them ever. llvm-svn: 109377
This commit is contained in:
@@ -107,18 +107,6 @@ FunctionTemplateDecl *FunctionTemplateDecl::Create(ASTContext &C,
|
||||
return new (C) FunctionTemplateDecl(DC, L, Name, Params, Decl);
|
||||
}
|
||||
|
||||
void FunctionTemplateDecl::Destroy(ASTContext &C) {
|
||||
if (Common *CommonPtr = CommonOrPrev.dyn_cast<Common*>()) {
|
||||
for (llvm::FoldingSet<FunctionTemplateSpecializationInfo>::iterator
|
||||
Spec = CommonPtr->Specializations.begin(),
|
||||
SpecEnd = CommonPtr->Specializations.end();
|
||||
Spec != SpecEnd; ++Spec)
|
||||
C.Deallocate(&*Spec);
|
||||
}
|
||||
|
||||
Decl::Destroy(C);
|
||||
}
|
||||
|
||||
FunctionDecl *
|
||||
FunctionTemplateDecl::findSpecialization(const TemplateArgument *Args,
|
||||
unsigned NumArgs, void *&InsertPos) {
|
||||
@@ -177,10 +165,6 @@ ClassTemplateDecl *ClassTemplateDecl::Create(ASTContext &C,
|
||||
return New;
|
||||
}
|
||||
|
||||
void ClassTemplateDecl::Destroy(ASTContext& C) {
|
||||
Decl::Destroy(C);
|
||||
}
|
||||
|
||||
ClassTemplateSpecializationDecl *
|
||||
ClassTemplateDecl::findSpecialization(const TemplateArgument *Args,
|
||||
unsigned NumArgs, void *&InsertPos) {
|
||||
@@ -478,13 +462,6 @@ StructuredArguments.setPointer(NewArgs);
|
||||
StructuredArguments.setInt(0); // Doesn't own the pointer.
|
||||
}
|
||||
|
||||
void TemplateArgumentList::Destroy(ASTContext &C) {
|
||||
if (FlatArguments.getInt())
|
||||
C.Deallocate((void*)FlatArguments.getPointer());
|
||||
if (StructuredArguments.getInt())
|
||||
C.Deallocate((void*)StructuredArguments.getPointer());
|
||||
}
|
||||
|
||||
TemplateArgumentList::~TemplateArgumentList() {}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
@@ -534,16 +511,6 @@ ClassTemplateSpecializationDecl::Create(ASTContext &Context, EmptyShell Empty) {
|
||||
new (Context)ClassTemplateSpecializationDecl(ClassTemplateSpecialization);
|
||||
}
|
||||
|
||||
void ClassTemplateSpecializationDecl::Destroy(ASTContext &C) {
|
||||
delete ExplicitInfo;
|
||||
|
||||
if (SpecializedPartialSpecialization *PartialSpec
|
||||
= SpecializedTemplate.dyn_cast<SpecializedPartialSpecialization*>())
|
||||
C.Deallocate(PartialSpec);
|
||||
|
||||
CXXRecordDecl::Destroy(C);
|
||||
}
|
||||
|
||||
void
|
||||
ClassTemplateSpecializationDecl::getNameForDiagnostic(std::string &S,
|
||||
const PrintingPolicy &Policy,
|
||||
|
||||
Reference in New Issue
Block a user