]> granicus.if.org Git - clang/commit
[Frontend] 'Show hotness' can be used with a sampling profile
authorBrian Gesiak <modocache@gmail.com>
Fri, 23 Jun 2017 02:38:45 +0000 (02:38 +0000)
committerBrian Gesiak <modocache@gmail.com>
Fri, 23 Jun 2017 02:38:45 +0000 (02:38 +0000)
commit742c4c842393005d91a6f805f665b077014d061a
treea2b11befd86b432757097889f165fb5b4bab53a7
parent516572b01686e96be619f9ae090ca4bb0166cb30
[Frontend] 'Show hotness' can be used with a sampling profile

Summary:
Prior to this change, using `-fdiagnostics-show-hotness` with a sampling
profile specified via `-fprofile-sample-use=` would result in the Clang
frontend emitting a warning: "argument '-fdiagnostics-show-hotness' requires
profile-guided optimization information". Of course, a sampling profile
*is* profile-guided optimization information, so the warning is misleading.
Furthermore, despite the warning, hotness was displayed based on the data in
the sampling profile.

Prevent the warning from being emitted when a sampling profile is used, and
add a test that verifies this.

Reviewers: anemet, davidxl

Reviewed By: davidxl

Subscribers: danielcdh, cfe-commits

Differential Revision: https://reviews.llvm.org/D34082

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306079 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Frontend/CompilerInvocation.cpp
test/Frontend/Inputs/optimization-remark-with-hotness-sample.proftext [new file with mode: 0644]
test/Frontend/optimization-remark-with-hotness.c