That's what the `external` keyword on a global means, but the thing
being declared if that's used still has external linkage.
> But when a linkage type is not specified, the system doesn't seem to behave that way; instead, such a global variable seems to be treated as a definition.
Yes. A definition of a variable with external linkage.
I think the syntax is rather quirky in that area, I expect it dates
from the earliest days of the LLVM project. If I was redesigning it
I'd probably make the `external` mandatory with an optional definition
(and maybe turn `extern_weak` into `weak` too).
The LangRef could almost certainly be improved, I think it conflates
the keywords used in the textual IR with the conceptual linkage that
every global has, because they are the same thing or near enough for
all except "external".
Cheers.
Tim.
_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev