[llvm] 3cbe0bc - [CodeGen] Use default member initialization (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 18 12:01:40 PDT 2022
Author: Kazu Hirata
Date: 2022-06-18T12:01:34-07:00
New Revision: 3cbe0bc4a1fa6f6156dc7bd7769d91212468cee4
URL: https://github.com/llvm/llvm-project/commit/3cbe0bc4a1fa6f6156dc7bd7769d91212468cee4
DIFF: https://github.com/llvm/llvm-project/commit/3cbe0bc4a1fa6f6156dc7bd7769d91212468cee4.diff
LOG: [CodeGen] Use default member initialization (NFC)
Identified with modernize-use-default-member-init.
Added:
Modified:
llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp b/llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp
index e90eb2e8ab5b..43858071025a 100644
--- a/llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp
+++ b/llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp
@@ -171,10 +171,10 @@ class Polynomial {
};
/// Number of Error Bits e
- unsigned ErrorMSBs;
+ unsigned ErrorMSBs = (unsigned)-1;
/// Value
- Value *V;
+ Value *V = nullptr;
/// Coefficient B
SmallVector<std::pair<BOps, APInt>, 4> B;
@@ -183,7 +183,7 @@ class Polynomial {
APInt A;
public:
- Polynomial(Value *V) : ErrorMSBs((unsigned)-1), V(V) {
+ Polynomial(Value *V) : V(V) {
IntegerType *Ty = dyn_cast<IntegerType>(V->getType());
if (Ty) {
ErrorMSBs = 0;
@@ -193,12 +193,12 @@ class Polynomial {
}
Polynomial(const APInt &A, unsigned ErrorMSBs = 0)
- : ErrorMSBs(ErrorMSBs), V(nullptr), A(A) {}
+ : ErrorMSBs(ErrorMSBs), A(A) {}
Polynomial(unsigned BitWidth, uint64_t A, unsigned ErrorMSBs = 0)
- : ErrorMSBs(ErrorMSBs), V(nullptr), A(BitWidth, A) {}
+ : ErrorMSBs(ErrorMSBs), A(BitWidth, A) {}
- Polynomial() : ErrorMSBs((unsigned)-1), V(nullptr) {}
+ Polynomial() = default;
/// Increment and clamp the number of undefined bits.
void incErrorMSBs(unsigned amt) {
More information about the llvm-commits
mailing list