clang::CompilerInstance leaks memory on compilation failures

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

clang::CompilerInstance leaks memory on compilation failures

ajay gopalakrishnan
Hi,

I am using the clang::CompilerInstance to compile a piece of code. I am running my tests through Clang -fsanitize=address.
The test case where the compilation succeeds does not leak any memory. But if the compilation fails, then it seems to leak memory.

Is this a known bug?

Am I supposed to explicitly freeup somethings when the compilation fails (The code already calls llvm::shut_down() towards the end of the process)

if(!clang.ExecuteAction(*action)) { throw new CompilationError("failed to compile", std::move(errors)); }

I am using Clang3.5

Thanks!
Ajay

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev