[llvm] r373919 - Fix build errors caused by rL373914.

Wei Mi via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 7 09:45:47 PDT 2019


Author: wmi
Date: Mon Oct  7 09:45:47 2019
New Revision: 373919

URL: http://llvm.org/viewvc/llvm-project?rev=373919&view=rev
Log:
Fix build errors caused by rL373914.

Modified:
    llvm/trunk/include/llvm/ProfileData/SampleProfWriter.h
    llvm/trunk/lib/ProfileData/SampleProfReader.cpp

Modified: llvm/trunk/include/llvm/ProfileData/SampleProfWriter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ProfileData/SampleProfWriter.h?rev=373919&r1=373918&r2=373919&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ProfileData/SampleProfWriter.h (original)
+++ llvm/trunk/include/llvm/ProfileData/SampleProfWriter.h Mon Oct  7 09:45:47 2019
@@ -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;

Modified: llvm/trunk/lib/ProfileData/SampleProfReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ProfileData/SampleProfReader.cpp?rev=373919&r1=373918&r2=373919&view=diff
==============================================================================
--- llvm/trunk/lib/ProfileData/SampleProfReader.cpp (original)
+++ llvm/trunk/lib/ProfileData/SampleProfReader.cpp Mon Oct  7 09:45:47 2019
@@ -530,8 +530,9 @@ std::error_code SampleProfileReaderExtBi
   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);




More information about the llvm-commits mailing list