[llvm-dev] GlobalValue::AvailableExternallyLinkage

Mehdi Amini via llvm-dev llvm-dev at lists.llvm.org
Sat Nov 19 12:32:25 PST 2016

> On Nov 19, 2016, at 12:00 PM, Simone Atzeni via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> Hi,
> could anybody explain what GlobalValue::AvailableExternallyLinkage means?

It means that the function will not be codegen in this module, it will be available at link time from another object.
The IR is available for the purpose of inlining mainly.

> I implemented an instrumentation pass that creates a clone of a function.
> For some programs I noticed that also function such as “atoi”, “atof”, “__strspn_c2”, etc. they get cloned even if I am not implementing them in the module.
> I would like to avoid cloning those functions, so I noticed that they have GlobalValue::AvailableExternallyLinkage linkage.
> Checking if they have GlobalValue::AvailableExternallyLinkage would it be enough to ignore them?

I don’t really understand what you’re doing or why, so I can’t answer this question.


More information about the llvm-dev mailing list