Reputation: 7694
LLVM defines aliases for global values:
@<Name> = [Linkage] [PreemptionSpecifier] [Visibility] [DLLStorageClass] [ThreadLocal] [(unnamed_addr|local_unnamed_addr)] alias <AliaseeTy>, <AliaseeTy>* @<Aliasee>
What are valid <Aliasee>
values?
I thought inter-module aliases were permitted but I cannot get it to work. I keep getting errors of this type:
<string>:5:39: error: use of undefined value '@my_name'
@"MyAlias" = external alias i32, i32* @my_name
^
Note: @my_name
is not defined in the current module. It is defined in another module.
Upvotes: 0
Views: 267
Reputation: 9324
Anything represented in LLVM IR needs to be declared. Your my_name
should be declared as well. Note, however, that aliases are created to the existing definition. See the section "Restrictions" in the manual:
Since aliases are only a second name, some restrictions apply, of which some can only be checked when producing an object file:
Upvotes: 0