<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 15, 2015 at 2:41 PM, Duncan P. N. Exon Smith <span dir="ltr"><<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> On 2015-May-15, at 13:15, Teresa Johnson <<a href="mailto:tejohnson@google.com">tejohnson@google.com</a>> wrote:<br>
><br>
> What isn't clear to me is what all uses the available<br>
> externally linkage type currently - do you happen to know?<br>
<br>
</span>It's used for the `inline` keyword in the C language.</blockquote><div><br>I was about to say... then I see you mentioned C. C's weird inline semantics are... weird. (but yes, available externally)<br><br>I think we also emit vtable constants as available externally to enable some constant-prop/inlining/devirtualization.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> If you do a<br>
`git grep available_externally -- test/` inside a clang checkout you<br>
might find some other uses.<br>
<br>
$ cat available-externally.c<br>
inline int foo(int i) { return i; }<br>
int bar(int i) { return foo(i); }<br>
$ clang -S -emit-llvm -O1 available-externally.c -o -<br>
; ModuleID = 'available-externally.c'<br>
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"<br>
target triple = "x86_64-apple-macosx10.10.0"<br>
<br>
; Function Attrs: nounwind readnone ssp uwtable<br>
define i32 @bar(i32 %i) #0 {<br>
%1 = tail call i32 @foo(i32 %i)<br>
ret i32 %1<br>
}<br>
<br>
; Function Attrs: inlinehint nounwind readnone ssp uwtable<br>
define available_externally i32 @foo(i32 %i) #1 {<br>
ret i32 %i<br>
}<br>
<br>
attributes #0 = { nounwind readnone ssp uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="core2" "unsafe-fp-math"="false" "use-soft-float"="false" }<br>
attributes #1 = { inlinehint nounwind readnone ssp uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="core2" "unsafe-fp-math"="false" "use-soft-float"="false" }<br>
<br>
!llvm.module.flags = !{!0}<br>
!llvm.ident = !{!1}<br>
<br>
!0 = !{i32 1, !"PIC Level", i32 2}<br>
!1 = !{!"Apple LLVM version 7.0.0 (clang-700.9.38.2)"}<br>
<br>
</blockquote></div><br></div></div>