Skip to content
  • Ted Kremenek's avatar
    Try to plug some memory leaks... · ce20e8fe
    Ted Kremenek authored
    1) Sema::ParseAST now constructs a TranslationUnit object to own the top-level Decls, which releases the top-level Decls upon exiting ParseAST.
    
    2) Bug fix: TranslationUnit::~TranslationUnit handles the case where a Decl is added more than once as a top-level Decl.
    
    3) Decl::Destroy is now a virtual method, obviating the need for a special dispatch based on DeclKind.
    
    3) FunctionDecl::Destroy now releases its Body using its Destroy method.
    
    4) Added Stmt::Destroy and Stmt::DestroyChildren, which recursively delete the child ASTs of a Stmt and call their dstors.  We may need to special case dstor/Destroy methods for particular Stmt subclasses that own other dynamically allocated objects besides AST nodes.
    
    5) REGRESSION: We temporarily are not deallocating attributes; a FIXME is provided.
    
    llvm-svn: 51286
    ce20e8fe
Loading