Commit 7bc00ce5 authored by Sunho Kim's avatar Sunho Kim
Browse files

[clang-repl] Remove memory leak of ASTContext/TargetMachine.

Removes memory leak of ASTContext and TargetMachine. When DisableFree is turned on, it intentionally leaks these instances as they can be trivially deallocated. This patch turns this off and delete Parser instance early so that they will not reference dangling pargma headers.

Asan shouldn't detect these as leaks normally, since burypointer is called for them. But, every invocation of incremental parser createa an additional leak of TargetMachine. If there are many invocations within a single test case, we easily reach number of leaks exceeding kGraveYardMaxSize (which is 12) and leaks start to get reported by asan buildbots.

Reviewed By: v.g.vassilev

Differential Revision: https://reviews.llvm.org/D127991
parent 8da8b614
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment