[cfe-commits] r51299 - in /cfe/trunk: include/clang/AST/Decl.h lib/AST/Decl.cpp

Steve Naroff snaroff at apple.com
Fri May 23 17:24:37 PDT 2008


On May 19, 2008, at 9:49 PM, Ted Kremenek wrote:

> Author: kremenek
> Date: Mon May 19 23:49:55 2008
> New Revision: 51299
>
> URL: http://llvm.org/viewvc/llvm-project?rev=51299&view=rev
> Log:
> Reclaim memory from chains of ScopedDecls, and reclaim memory for  
> the initializers of EnumConstantDecls.
>
> Modified:
>    cfe/trunk/include/clang/AST/Decl.h
>    cfe/trunk/lib/AST/Decl.cpp
>

Ted,

The following doesn't appear to work with VC++.

I get an error "clang::NamespaceDecl' class does not have a destructor  
called ~Decl.

Thoughts?

snaroff

> +void NamespaceDecl::Destroy(ASTContext& C) {
> +  // NamespaceDecl uses "NextDeclarator" to chain namespace  
> declarations
> +  // together. They are all top-level Decls.
> +
> +  this->~Decl();
> +  C.getAllocator().Deallocate((void *)this);
> +}
> +
> +

>



More information about the cfe-commits mailing list