diff options
author | Wei Mi <wmi@google.com> | 2019-08-31 03:17:49 +0000 |
---|---|---|
committer | Wei Mi <wmi@google.com> | 2019-08-31 03:17:49 +0000 |
commit | 198009ae8db11d7c0b0517f17358870dc486fcfb (patch) | |
tree | 76b236db6f6d01ea1aaa92cfffa357b41b039ea8 /llvm/lib/ProfileData/SampleProf.cpp | |
parent | 798e59b81fb7a92cd5f3b1bb0761283f99adcd46 (diff) | |
download | bcm5719-llvm-198009ae8db11d7c0b0517f17358870dc486fcfb.tar.gz bcm5719-llvm-198009ae8db11d7c0b0517f17358870dc486fcfb.zip |
Fix some errors introduced by rL370563 which were not exposed on my local machine.
1. zlib::compress accept &size_t but the param is an uint64_t.
2. Some systems don't have zlib installed. Don't use compression by default.
llvm-svn: 370564
Diffstat (limited to 'llvm/lib/ProfileData/SampleProf.cpp')
-rw-r--r-- | llvm/lib/ProfileData/SampleProf.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/ProfileData/SampleProf.cpp b/llvm/lib/ProfileData/SampleProf.cpp index 36c39c12432..e94848df24e 100644 --- a/llvm/lib/ProfileData/SampleProf.cpp +++ b/llvm/lib/ProfileData/SampleProf.cpp @@ -211,7 +211,8 @@ std::error_code ProfileSymbolList::read(uint64_t CompressSize, StringRef CompressedStrings(reinterpret_cast<const char *>(Data), CompressSize); char *Buffer = Allocator.Allocate<char>(UncompressSize); - llvm::Error E = zlib::uncompress(CompressedStrings, Buffer, UncompressSize); + size_t UCSize = UncompressSize; + llvm::Error E = zlib::uncompress(CompressedStrings, Buffer, UCSize); if (E) return sampleprof_error::uncompress_failed; ListStart = Buffer; |