summaryrefslogtreecommitdiff
path: root/lib/ProfileData/InstrProf.cpp
diff options
context:
space:
mode:
authorRong Xu <xur@google.com>2016-10-19 22:51:17 +0000
committerRong Xu <xur@google.com>2016-10-19 22:51:17 +0000
commitc8872308b4373814bf1e944c91821c0b82278d68 (patch)
tree179bc9e109f4c6562efe2cb0a4fdc8f01181924b /lib/ProfileData/InstrProf.cpp
parent207b6abad40835f1f8a05a3050a5731c86c9b953 (diff)
[PGO] Fix bogus warning for merging empty llvm profile file
Profile runtime can generate an empty raw profile (when there is no function in the shared library). This empty profile is treated as a text format profile. A test format profile without the flag of "#IR" is thought to be a clang generated profile. So in llvm profile merging, we will get a bogus warning of "Merge IR generated profile with Clang generated profile." The fix here is to skip the empty profile (when the buffer size is 0) for profile merge. Reviewers: vsk, davidxl Differential Revision: http://reviews.llvm.org/D25687 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284659 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ProfileData/InstrProf.cpp')
-rw-r--r--lib/ProfileData/InstrProf.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/ProfileData/InstrProf.cpp b/lib/ProfileData/InstrProf.cpp
index dac91950183..b512f543e95 100644
--- a/lib/ProfileData/InstrProf.cpp
+++ b/lib/ProfileData/InstrProf.cpp
@@ -70,6 +70,8 @@ std::string getInstrProfErrString(instrprof_error Err) {
return "Failed to compress data (zlib)";
case instrprof_error::uncompress_failed:
return "Failed to uncompress data (zlib)";
+ case instrprof_error::empty_raw_profile:
+ return "Empty raw profile file";
}
llvm_unreachable("A value of instrprof_error has no message.");
}