Current LCG doesn't check aliased functions. So if an internal function has a public alias it will not be added to CG SCC, but it is still reachable from outside through the alias.
So this patch adds aliased functions to SCC.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Analysis/LazyCallGraph.cpp | ||
---|---|---|
192 ↗ | (On Diff #192507) | Presumably aliases with internal linkage themselves can be ignored. |
Comment Actions
Good catch!
lib/Analysis/LazyCallGraph.cpp | ||
---|---|---|
191 ↗ | (On Diff #192518) | I would rewrite the comment to more closely match the patch description: "Externally visible aliases of internal functions are also viable entry edges to the module." |
192–200 ↗ | (On Diff #192518) | All of this should go above I think, right after we walk the module. We want to have the complete entry edge set before we visit globals and do the reference visit walk. |
196–197 ↗ | (On Diff #192518) | Include the fact that it is being added due to an alias, and the name of that alias? |
test/Analysis/LazyCallGraph/alias.ll | ||
3 ↗ | (On Diff #192518) | Also test that internal aliases *don't* become reachable? |