Are there tools to transform source code in C++ to the source code in C/C++, but with instantiated (unrolled) templates? This is necessary for an unambiguous understanding, into the what code C++ templates converted. May be it is present in the IDEs(MSVS, QtCreator, ...) or in the compilers(ICC, GCC, MSVC, Clang)?
This seems already answered on SO
The Idea/principle from Alexey Frunze to use the disassembled code is quite good, together with the use of simplified templates there is a pretty good chance to understand exactly what it does.
Edit 1 There are a few other possibilities on how to get an understanding of the things which the compiler had done
gcc -S -O1 {yourcode.cpp}
to get the assembly and use the tool c++filt
(its a part of binutils to convert the disassembly to C-Code if you feel more comfortable with C-Codeg++ -fdump-tree-original file.cpp
to get some (pseudo) C++ code-emit-llvm
to get the LLVM IR, and use llvm-dis
to convert it to textIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With