[llvm] r202264 - Move getELFDynamicSymbolIterators to a public header.

Alexey Samsonov samsonov at google.com
Thu Feb 27 11:17:34 PST 2014


OK, thanks for clarification. I will be able to make functions in this
header just inline tomorrow, if you won't beat me in it :)
On 27 Feb 2014 23:05, "Rafael EspĂ­ndola" <rafael.espindola at gmail.com> wrote:

> >> > +static inline std::pair<symbol_iterator, symbol_iterator>
> >>
> >> Why static?
> >
> >
> > Mostly for consistency with other similar functions in this header. Why
> is
> > static bad here
> > (i.e. why do we want to emit this function in any module that includes
> > ELFOjbectFile.h)?
>
> With just inline we will emit it only if it is used. And will emit it
> with linkonce_odr, so that it can be merged by the linker.
>
> For example, given a c++ file with
>
> inline void foo1() {}
> inline void foo2() {}
> static inline void bar1() {}
> static inline void bar2() {}
> void zed() {
>   foo1();
>   bar1();
> }
>
> clang produces
>
> define void @_Z3zedv() #0 {
> define linkonce_odr void @_Z4foo1v() #1 {
> define internal void @_ZL4bar1v() #1 {
>
> Cheers,
> Rafael
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140227/94596ca9/attachment.html>


More information about the llvm-commits mailing list