Calling getFunctionLinkage(CalleeInfo.getCalleeDecl()) will crash when the declaration does not have a body, e.g., extern void foo();. Instead, we can use isExternallyVisible() to see if the delcaration has internal linkage.
I believe using !isExternallyVisible() is correct because the clang linkage must be InternalLinkage or UniqueExternalLinkage, both of which are "internal linkage" in llvm.
https://github.com/llvm/llvm-project/blob/9c26f51f5e178ac0fda98419e3a61d205d3b58b1/clang/include/clang/Basic/Linkage.h#L28-L40