From 2d533d6c5674ed9b53b1ab42676cab34a8f3ceda Mon Sep 17 00:00:00 2001 From: Andrea Di Biagio Date: Wed, 24 Mar 2021 11:20:15 +0000 Subject: [PATCH] [MCA] Fix for uninitialised member in constructor. NFC --- include/llvm/MCA/HardwareUnits/RegisterFile.h | 4 +++- lib/MCA/HardwareUnits/RegisterFile.cpp | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/llvm/MCA/HardwareUnits/RegisterFile.h b/include/llvm/MCA/HardwareUnits/RegisterFile.h index 735ed747028..510cff4b593 100644 --- a/include/llvm/MCA/HardwareUnits/RegisterFile.h +++ b/include/llvm/MCA/HardwareUnits/RegisterFile.h @@ -45,7 +45,9 @@ class WriteRef { static const unsigned INVALID_IID; public: - WriteRef() : IID(INVALID_IID), WriteBackCycle(), WriteResID(), Write() {} + WriteRef() + : IID(INVALID_IID), WriteBackCycle(), WriteResID(), RegisterID(), + Write() {} WriteRef(unsigned SourceIndex, WriteState *WS); unsigned getSourceIndex() const { return IID; } diff --git a/lib/MCA/HardwareUnits/RegisterFile.cpp b/lib/MCA/HardwareUnits/RegisterFile.cpp index eface5b3711..a48915dbed7 100644 --- a/lib/MCA/HardwareUnits/RegisterFile.cpp +++ b/lib/MCA/HardwareUnits/RegisterFile.cpp @@ -25,7 +25,8 @@ namespace mca { const unsigned WriteRef::INVALID_IID = std::numeric_limits::max(); WriteRef::WriteRef(unsigned SourceIndex, WriteState *WS) - : IID(SourceIndex), WriteBackCycle(), WriteResID(), Write(WS) {} + : IID(SourceIndex), WriteBackCycle(), WriteResID(), RegisterID(), + Write(WS) {} void WriteRef::commit() { assert(Write && Write->isExecuted() && "Cannot commit before write back!");