CGraph: Add functions for internal callback edge creation
New functions enable the creation of callback edges for internal calls.
This commit introduces the foundational logic within GCC’s call graph (cgraph) to create ‘internal callback edges’. These edges are designed for calls to outlined functions, such as IFN_ASSUME bodies, which are not typically represented in the main call graph. Unlike regular callback edges, internal ones do not initially have a ‘callback-carrying edge’, and this patch lays the groundwork for their creation, with the actual edge creation logic deferred to a later patch.
In Details
This patch introduces the cgraph_edge::make_callback_internal method and its helper callback_info::create_internal_summary. These are designed to create callgraph edges representing calls to internal functions (e.g., outlined IFN_ASSUME bodies) that lack the typical 'callback-carrying edge' found with regular callback edges. The logic is intended to be generic for future expansion, although its immediate use is for IFN_ASSUME outlined bodies. The actual invocation of make_callback_internal is postponed to a subsequent commit.
- cgraph
- GCC's internal representation of the call graph, which models function calls and relationships between functions in a program.
- callback edge
- A callgraph edge representing a function call that is invoked indirectly, often through a function pointer or a callback mechanism.
- internal callback edge
- A callgraph edge representing a call to an outlined function (like IFN_ASSUME bodies) that is not directly visible in the main call graph, differing from regular callback edges.
- callback-carrying edge
- A specific type of callgraph edge associated with callback edges, used to carry information or context related to the indirect call.
- IFN_ASSUME
- A special function or construct used in GCC, often related to outlining or assumptions made during interprocedural analysis, particularly for handling callback-like scenarios.