[llvm] 048f533 - [Hexagon] Fix -Wuninitialized warning (#125565)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 4 20:11:19 PST 2025
Author: Brian Cain
Date: 2025-02-04T22:11:15-06:00
New Revision: 048f533244d537a1451ab2d2979faa762252d37d
URL: https://github.com/llvm/llvm-project/commit/048f533244d537a1451ab2d2979faa762252d37d
DIFF: https://github.com/llvm/llvm-project/commit/048f533244d537a1451ab2d2979faa762252d37d.diff
LOG: [Hexagon] Fix -Wuninitialized warning (#125565)
`gcc (GCC) 14.2.1 20240910` reports the warning below on the baseline,
this change fixes the warning.
In file included from
/home/user/CLionProjects/llvm-project/llvm/lib/Target/Hexagon/BitTracker.cpp:55:
/home/user/CLionProjects/llvm-project/llvm/lib/Target/Hexagon/BitTracker.h:
In constructor ‘llvm::BitTracker::UseQueueType::UseQueueType()’:
/home/user/CLionProjects/llvm-project/llvm/lib/Target/Hexagon/BitTracker.h:75:27:
warning: member ‘llvm::BitTracker::UseQueueType::Dist’ is used
uninitialized [-Wuninitialized]
75 | UseQueueType() : Uses(Dist) {}
| ^~~~
Fixes #125545
Added:
Modified:
llvm/lib/Target/Hexagon/BitTracker.h
Removed:
################################################################################
diff --git a/llvm/lib/Target/Hexagon/BitTracker.h b/llvm/lib/Target/Hexagon/BitTracker.h
index 08c0359a4b7f06a..6d52070c1a11181 100644
--- a/llvm/lib/Target/Hexagon/BitTracker.h
+++ b/llvm/lib/Target/Hexagon/BitTracker.h
@@ -100,9 +100,9 @@ struct BitTracker {
bool operator()(const MachineInstr *MI, const MachineInstr *MJ) const;
DenseMap<const MachineInstr*,unsigned> &Dist;
};
- std::priority_queue<MachineInstr*, std::vector<MachineInstr*>, Cmp> Uses;
DenseSet<const MachineInstr*> Set; // Set to avoid adding duplicate entries.
DenseMap<const MachineInstr*,unsigned> Dist;
+ std::priority_queue<MachineInstr *, std::vector<MachineInstr *>, Cmp> Uses;
};
void reset();
More information about the llvm-commits
mailing list