Ilod added a comment.

I don't think weak linkage defines this.

For example, in:

  struct A {
    inline int foo() { return 0; }
    int bar() { return 1; }
    int baz();
  };
  int A::baz() { return 2; }

With /Ob1, we should inline foo and bar, but never baz. But baz doesn't have 
weak linkage, does it?
But indeed, if in CodeGenFunctions.cpp, instead of adding InlineHint attribute 
when we have isInlined(), I add noinline attribute if we don't have it (with 
/Ob1 or equivalent clang flag), I could avoid the work I started to inline only 
hinted functions at http://reviews.llvm.org/D20603


http://reviews.llvm.org/D20647



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

Reply via email to