diff options
author | Bob Wilson <bob.wilson@apple.com> | 2012-10-07 01:11:19 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2012-10-07 01:11:19 +0000 |
commit | e0b1dea26732f06cbee78984335ad703b1f6a5b0 (patch) | |
tree | 10d600cd6d5458e0a624daf5520e59e3db9613ad /clang/lib/Tooling/JSONCompilationDatabase.cpp | |
parent | ec2a51c154e0546c36d8ee1967c8c5d283accdeb (diff) | |
download | llvm-e0b1dea26732f06cbee78984335ad703b1f6a5b0.zip llvm-e0b1dea26732f06cbee78984335ad703b1f6a5b0.tar.gz llvm-e0b1dea26732f06cbee78984335ad703b1f6a5b0.tar.bz2 |
Make sure always-inline functions get inlined. <rdar://problem/12423986>
Without this change, when the estimated cost for inlining a function with
an "alwaysinline" attribute was lower than the inlining threshold, the
getInlineCost function was returning that estimated cost rather than the
special InlineCost::AlwaysInlineCost value. That is fine in the normal
inlining case, but it can fail when the inliner considers the opportunity
cost of inlining into an internal or linkonce-odr function. It may decide
not to inline the always-inline function in that case. The fix here is just
to make getInlineCost always return the special value for always-inline
functions. I ran into this building clang with libc++. Tablegen failed to
link because of an always-inline function that was not inlined. I have been
unable to reduce the testcase down to a reasonable size.
llvm-svn: 165367
Diffstat (limited to 'clang/lib/Tooling/JSONCompilationDatabase.cpp')
0 files changed, 0 insertions, 0 deletions