MaskRay added a comment.

Several previous comments are FreeBSD specific. To we clang developers, the 
concrete request is

> Given that GCC will inline at -O, at least these days, ...

right? I think this makes sense, especially when `inline` is explicitly 
specified... This appears to be related to some -O1 work @echristo is working 
on.

  // gcc -O1 and g++ -O1 inline `foo`. Note that in C99 mode, `extern int foo` 
is needed to ask the compiler to provide an external definition.
  // clang -O1 and clang++ -O1 do not inline `foo`
  inline int foo(int a) {
    return a + a;
  }
  
  int bar(int a, int b) {
    return foo(a + b);
  }


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79916/new/

https://reviews.llvm.org/D79916

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to