Pietro Fezzardi de2d795f19 Avoid emission of duplicate functions
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.
2019-03-07 19:13:28 +01:00
2019-02-10 16:20:42 +01:00
2019-03-07 19:13:28 +01:00
2019-02-10 16:20:42 +01:00
S
Description
Automated archival mirror of github.com/revng/revng
GPL-2.0 24 MiB
Languages
C++ 77.1%
Python 12.6%
MLIR 4.4%
CMake 1.9%
LLVM 1.4%
Other 2.5%