This patch enables functionality in clang frontend and adds call site info
generation support for RISCV targets (riscv64, riscv32).
Debug entry values functionality provides debug information about
call sites and function parameters values at the call entry spot.
Condition for generating this type of information is
compiling with -g option and optimization level higher than zero(-O0).
In ISEL phase, while lowering call instructions, collect info about registers
that forward arguments into following function frame.
We store such info into MachineFunction of the caller function.
This is used very late, when dumping DWARF info about call site parameters.
The call site info is visible at MIR level, as callSites attribute of MachineFunction.
To deal with callSites attribute, we should pass -emit-call-site-info option to llc.
When parameter's value is loaded into a register by RISCV instructions
(which are processed by the solution) , it could be described correctly and emitted
as DW_TAG_call_site_parameter.
We can see increased numbers of parameters (DW_TAG_call_site_parameter) as a consequence of the implemented solution:
- clang binary file (compile with "-g -O3")
$ llvm-dwarfdump --statistics clang
... "call site parameter DIEs": 558 ...
- opt binary file (compile with "-g -O3")
$ llvm-dwarfdump --statistics opt
... "call site parameter DIEs": 1184 ...
- llc binary file (compile with "-g -O3")
$ llvm-dwarfdump --statistics llc
... "call site parameter DIEs": 375 ...
This is an invariant, could we hoist it outside the loop?