[llvm] fef5f44 - [CSSPGO][llvm-profgen] Fix a missing initalization

Hongtao Yu via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 13 19:47:46 PDT 2021


Author: Hongtao Yu
Date: 2021-07-13T19:46:18-07:00
New Revision: fef5f4456abcb1ea052206db6c232468d70b07f2

URL: https://github.com/llvm/llvm-project/commit/fef5f4456abcb1ea052206db6c232468d70b07f2
DIFF: https://github.com/llvm/llvm-project/commit/fef5f4456abcb1ea052206db6c232468d70b07f2.diff

LOG: [CSSPGO][llvm-profgen] Fix a missing initalization

Fixing a missing initalization that accidentaly caused by https://reviews.llvm.org/D103178 .

Added: 
    

Modified: 
    llvm/tools/llvm-profgen/ProfiledBinary.h

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-profgen/ProfiledBinary.h b/llvm/tools/llvm-profgen/ProfiledBinary.h
index 8b456d4f669c..15a3451897d0 100644
--- a/llvm/tools/llvm-profgen/ProfiledBinary.h
+++ b/llvm/tools/llvm-profgen/ProfiledBinary.h
@@ -5,7 +5,7 @@
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
 //===----------------------------------------------------------------------===//
-
+#pragma clang optimize off
 #ifndef LLVM_TOOLS_LLVM_PROFGEN_PROFILEDBINARY_H
 #define LLVM_TOOLS_LLVM_PROFGEN_PROFILEDBINARY_H
 
@@ -100,7 +100,7 @@ class ProfiledBinary {
   // The target triple.
   Triple TheTriple;
   // The runtime base address that the first executable segment is loaded at.
-  uint64_t BaseAddress;
+  uint64_t BaseAddress = 0;
   // The preferred load address of each executable segment.
   std::vector<uint64_t> PreferredTextSegmentAddresses;
   // The file offset of each executable segment.
@@ -190,7 +190,7 @@ class ProfiledBinary {
   StringRef getName() const { return llvm::sys::path::filename(Path); }
   uint64_t getBaseAddress() const { return BaseAddress; }
   void setBaseAddress(uint64_t Address) { BaseAddress = Address; }
-  
+
   // Return the preferred load address for the first executable segment.
   uint64_t getPreferredBaseAddress() const { return PreferredTextSegmentAddresses[0]; }
   // Return the file offset for the first executable segment.


        


More information about the llvm-commits mailing list