Could I explicitly tell clang not inline some functions?

Hi,

    I am wondering whether there are some ways I can tell clang not inline some or all functions.

    Thanks a lot!

                                                                                                                    Linhai

Linhai <songlh@cs.wisc.edu> writes:

   I am wondering whether there are some ways I can tell clang not
inline some or all functions.

Maybe

__attribute__ ((noinline)) int foo(int x) {
  return x+x;
}

Clang has its own mailing list, where most clang experts are. See
http://clang.llvm.org/

Hi,

For not inlining specific function - try to declare it attribute((noinline)).

For not inlining any function - generate LLVM IR from clang, then add only selected optimizations through opt, then codegen binary with llc:

$ clang -c test.c -O0 -emit-llvm -S -o - | opt | llc -filetype=obj -o test.o

  • D.

2013/1/31 Linhai <songlh@cs.wisc.edu>