summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei Mi <wmi@google.com>2019-10-07 16:45:47 +0000
committerWei Mi <wmi@google.com>2019-10-07 16:45:47 +0000
commit283df8cf742803ad0946dbb2b4ff1e9d1eaed7aa (patch)
tree9adfae078bfdd481a2ed206f7a3188d2bd0cddf1
parent7e38f0c408058ec104df4f92b9d0789ab07f21e8 (diff)
downloadbcm5719-llvm-283df8cf742803ad0946dbb2b4ff1e9d1eaed7aa.tar.gz
bcm5719-llvm-283df8cf742803ad0946dbb2b4ff1e9d1eaed7aa.zip
Fix build errors caused by rL373914.
llvm-svn: 373919
-rw-r--r--llvm/include/llvm/ProfileData/SampleProfWriter.h8
-rw-r--r--llvm/lib/ProfileData/SampleProfReader.cpp3
2 files changed, 6 insertions, 5 deletions
diff --git a/llvm/include/llvm/ProfileData/SampleProfWriter.h b/llvm/include/llvm/ProfileData/SampleProfWriter.h
index ae7ef2deaf0..ce60baf66c6 100644
--- a/llvm/include/llvm/ProfileData/SampleProfWriter.h
+++ b/llvm/include/llvm/ProfileData/SampleProfWriter.h
@@ -202,10 +202,10 @@ public:
private:
virtual void initSectionLayout() override {
- SectionLayout = {{SecProfSummary},
- {SecNameTable},
- {SecLBRProfile},
- {SecProfileSymbolList}};
+ SectionLayout = {{SecProfSummary, 0, 0, 0},
+ {SecNameTable, 0, 0, 0},
+ {SecLBRProfile, 0, 0, 0},
+ {SecProfileSymbolList, 0, 0, 0}};
};
virtual std::error_code
writeSections(const StringMap<FunctionSamples> &ProfileMap) override;
diff --git a/llvm/lib/ProfileData/SampleProfReader.cpp b/llvm/lib/ProfileData/SampleProfReader.cpp
index 075bd9412b0..6d00404b0bb 100644
--- a/llvm/lib/ProfileData/SampleProfReader.cpp
+++ b/llvm/lib/ProfileData/SampleProfReader.cpp
@@ -530,8 +530,9 @@ std::error_code SampleProfileReaderExtBinaryBase::decompressSection(
StringRef CompressedStrings(reinterpret_cast<const char *>(Data),
*CompressSize);
char *Buffer = Allocator.Allocate<char>(DecompressBufSize);
+ size_t UCSize = DecompressBufSize;
llvm::Error E =
- zlib::uncompress(CompressedStrings, Buffer, DecompressBufSize);
+ zlib::uncompress(CompressedStrings, Buffer, UCSize);
if (E)
return sampleprof_error::uncompress_failed;
DecompressBuf = reinterpret_cast<const uint8_t *>(Buffer);
OpenPOWER on IntegriCloud