[cfe-users] Inline Clang functions

Saoni Mukherjee sayani.mookherjee at gmail.com
Mon Dec 30 17:48:33 PST 2013


Hello,

I am trying to *always* inline my functions (do not care about speed,
performance etc). Currently I am doing it the way it has been suggested:

static inline int add(int i, int j) { return i + j; }

int main() {
  int i = add(4, 5);
  return i;
}

However if I print the AST of the program (clang -cc1 ast-dump program.c),
it shows two functions, NOT the add inlined into main. Am I missing
something?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20131230/d8e6b6c7/attachment.html>


More information about the cfe-users mailing list