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
Diff Detail
Event Timeline
lib/Analysis/LazyCallGraph.cpp | ||
---|---|---|
205 | Presumably aliases with internal linkage themselves can be ignored. |
Good catch!
lib/Analysis/LazyCallGraph.cpp | ||
---|---|---|
204 | 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." | |
205–213 | 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. | |
209–210 | Include the fact that it is being added due to an alias, and the name of that alias? | |
test/Analysis/LazyCallGraph/alias.ll | ||
4 | Also test that internal aliases *don't* become reachable? |
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."