This patch addresses two issues related to adding inline functions to the import list while recursively going through the profiling data.
- For callsite samples, only add an inlined function to the import list if it's from outside of the module (i.e. only has a declaration inside the module).
- For body samples, add each target function to the import list if it's from outside of the module (i.e. only has a declaration inside the module). Previously we were using getSubProgram() to check whether it has dbg info, which is inaccurate. This fix properly add imports and could improve the quality of the pass.
Added a few changes to the test to catch these cases.
I think we need F->isDeclaration() here, getSubprogram() tells us whether debug metadata (!dbg) is available for this function.