[llvm] caa9d6e - Fix uninitialized pointer members in Target/X86
via llvm-commits
llvm-commits at lists.llvm.org
Sat Apr 15 01:35:26 PDT 2023
Author: Akshay Khadse
Date: 2023-04-15T16:35:09+08:00
New Revision: caa9d6e2f0c66ba956d5d31196fad080e8a80364
URL: https://github.com/llvm/llvm-project/commit/caa9d6e2f0c66ba956d5d31196fad080e8a80364
DIFF: https://github.com/llvm/llvm-project/commit/caa9d6e2f0c66ba956d5d31196fad080e8a80364.diff
LOG: Fix uninitialized pointer members in Target/X86
Reviewed By: LuoYuanke
Differential Revision: https://reviews.llvm.org/D148312
Added:
Modified:
llvm/lib/Target/X86/X86FixupBWInsts.cpp
llvm/lib/Target/X86/X86LoadValueInjectionLoadHardening.cpp
llvm/lib/Target/X86/X86PartialReduction.cpp
llvm/lib/Target/X86/X86PreTileConfig.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86FixupBWInsts.cpp b/llvm/lib/Target/X86/X86FixupBWInsts.cpp
index 5d207f54fc96a..5980e4572e7a9 100644
--- a/llvm/lib/Target/X86/X86FixupBWInsts.cpp
+++ b/llvm/lib/Target/X86/X86FixupBWInsts.cpp
@@ -148,8 +148,8 @@ class FixupBWInstPass : public MachineFunctionPass {
/// Register Liveness information after the current instruction.
LivePhysRegs LiveRegs;
- ProfileSummaryInfo *PSI;
- MachineBlockFrequencyInfo *MBFI;
+ ProfileSummaryInfo *PSI = nullptr;
+ MachineBlockFrequencyInfo *MBFI = nullptr;
};
char FixupBWInstPass::ID = 0;
}
diff --git a/llvm/lib/Target/X86/X86LoadValueInjectionLoadHardening.cpp b/llvm/lib/Target/X86/X86LoadValueInjectionLoadHardening.cpp
index 079d260e1fb5e..c17b96cc9fdde 100644
--- a/llvm/lib/Target/X86/X86LoadValueInjectionLoadHardening.cpp
+++ b/llvm/lib/Target/X86/X86LoadValueInjectionLoadHardening.cpp
@@ -154,9 +154,9 @@ class X86LoadValueInjectionLoadHardeningPass : public MachineFunctionPass {
using EdgeSet = MachineGadgetGraph::EdgeSet;
using NodeSet = MachineGadgetGraph::NodeSet;
- const X86Subtarget *STI;
- const TargetInstrInfo *TII;
- const TargetRegisterInfo *TRI;
+ const X86Subtarget *STI = nullptr;
+ const TargetInstrInfo *TII = nullptr;
+ const TargetRegisterInfo *TRI = nullptr;
std::unique_ptr<MachineGadgetGraph>
getGadgetGraph(MachineFunction &MF, const MachineLoopInfo &MLI,
diff --git a/llvm/lib/Target/X86/X86PartialReduction.cpp b/llvm/lib/Target/X86/X86PartialReduction.cpp
index c760a32e25794..a11be9507cead 100644
--- a/llvm/lib/Target/X86/X86PartialReduction.cpp
+++ b/llvm/lib/Target/X86/X86PartialReduction.cpp
@@ -33,8 +33,8 @@ using namespace llvm;
namespace {
class X86PartialReduction : public FunctionPass {
- const DataLayout *DL;
- const X86Subtarget *ST;
+ const DataLayout *DL = nullptr;
+ const X86Subtarget *ST = nullptr;
public:
static char ID; // Pass identification, replacement for typeid.
diff --git a/llvm/lib/Target/X86/X86PreTileConfig.cpp b/llvm/lib/Target/X86/X86PreTileConfig.cpp
index 479db8585ca03..7fe4c88b79f7d 100644
--- a/llvm/lib/Target/X86/X86PreTileConfig.cpp
+++ b/llvm/lib/Target/X86/X86PreTileConfig.cpp
@@ -98,8 +98,8 @@ struct BBInfo {
};
class X86PreTileConfig : public MachineFunctionPass {
- MachineRegisterInfo *MRI;
- const MachineLoopInfo *MLI;
+ MachineRegisterInfo *MRI = nullptr;
+ const MachineLoopInfo *MLI = nullptr;
SmallSet<MachineInstr *, 8> DefVisited;
DenseMap<MachineBasicBlock *, BBInfo> BBVisitedInfo;
DenseMap<MachineBasicBlock *, SmallVector<MIRef, 8>> ShapeBBs;
More information about the llvm-commits
mailing list