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

Rafael EspĂ­ndola rafael.espindola at gmail.com
Thu Feb 27 11:05:55 PST 2014


>> > +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



More information about the llvm-commits mailing list