Skip to content

Commit

Permalink
[CSSPGO][llvm-profgen] Fix a missing initalization
Browse files Browse the repository at this point in the history
Fixing a missing initalization that accidentaly caused by https://reviews.llvm.org/D103178 .
  • Loading branch information
htyu committed Jul 14, 2021
1 parent 1100e4a commit fef5f44
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions llvm/tools/llvm-profgen/ProfiledBinary.h
Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit fef5f44

Please sign in to comment.