mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
de2d795f191e5660848831ec06ec6cdb076a7e4e
In the Decompiler::HandleTranslationUnit method we abuse clang::tooling to call clang on an empty file, each time a new Function is decompiled. To do this we use clang::tooling's CommonOptionParser, which appends the names of the parsed files to a static cl::list. The fact that this list is static, means that it is never cleaned between calls to DecompilationPass, which means that at each successive call clang::tooling thinks we have more and more input files, meaning that it creates multiple translation units. For each translation unit we run a DecompilationAction, hence we emit multiple identical copies of the same function. To disable this we have to create CommonOptionParser only once, making it static as well.
Description
Languages
C++
77.1%
Python
12.6%
MLIR
4.4%
CMake
1.9%
LLVM
1.4%
Other
2.5%