Reland r219810 "Fix late template parsing leak with incremental processing"
authorReid Kleckner <reid@kleckner.net>
Wed, 22 Oct 2014 17:50:19 +0000 (17:50 +0000)
committerReid Kleckner <reid@kleckner.net>
Wed, 22 Oct 2014 17:50:19 +0000 (17:50 +0000)
commit89bd8d62f3c3305d4ec433307dc4c0b1df1d4be7
tree80abf7c31dda4fb53511773fb0dc72324b862f6c
parentdb0856658810b47f29986a9a1dea5b6ae9ceab35
Reland r219810 "Fix late template parsing leak with incremental processing"

Original message:
Add a second late template parser callback meant to cleanup any
resources allocated by late template parsing.  Call it from the
Sema::ActOnEndOfTranslationUnit method after all pending template
instantiations have been completed.  Teach Parser::ParseTopLevelDecl to
install the cleanup callback when incremental processing is enabled so
that Parser::TemplateIds can be freed.

Patch by Brad King!

llvm-svn: 220400
clang/include/clang/Parse/Parser.h
clang/include/clang/Sema/Sema.h
clang/lib/Parse/Parser.cpp
clang/lib/Sema/Sema.cpp
clang/unittests/Frontend/FrontendActionTest.cpp