[cfe-dev] [analyzer][tooling] Architectural questions about Clang and ClangTooling

Endre Fülöp via cfe-dev cfe-dev at lists.llvm.org
Tue Apr 28 01:31:49 PDT 2020


Hi!

Question:
Why is the dependency on ClangTooling ill-advised inside ClangSA (also meaning the Clang binary) itself ?

Context:
Currently I am working on an alternative way to import external TU AST-s during analysis ( https://reviews.llvm.org/D75665 ).
In order to produce AST-s, I use a compilation database to extract the necessary flags, and finally use ClangTool::buildAST.
I am aware that I have other options for this as well (like manually coding the compdb handling for my specific case for the
first step, and maybe even dumping ASTs as pch-s into an in-memory buffer), but still consuming JSONCompilationDatabase
is just too convenient. I would not want to introduce another format when compilation database is just right for this purpose.

Elaboration:
While I understand that introducing dependencies has its downsides, but not being able to reuse code from Tooling is also not ideal.
I would very much like to be enlightened by someone more familiar with architectural decision already made why this is the case,
and optionally how I could proceed with my efforts so that I can come up with the most fitting solution i.e. not a hack.

Thanks,
Endre Fülöp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200428/2e43a125/attachment.html>


More information about the cfe-dev mailing list