[llvm] ba7cf9d - [ModuleInliner] Initialize variables (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 2 13:31:20 PST 2022
Author: Kazu Hirata
Date: 2022-12-02T13:31:13-08:00
New Revision: ba7cf9d18a0d8726885ab87df3cf3fa5c68c34c7
URL: https://github.com/llvm/llvm-project/commit/ba7cf9d18a0d8726885ab87df3cf3fa5c68c34c7
DIFF: https://github.com/llvm/llvm-project/commit/ba7cf9d18a0d8726885ab87df3cf3fa5c68c34c7.diff
LOG: [ModuleInliner] Initialize variables (NFC)
This patch initializes all class variables in InlineOrder.cpp for
safety just in case we miss them in constructors. Currently, all
these variables are properly initialized in their respective
constructors.
Differential Revision: https://reviews.llvm.org/D139225
Added:
Modified:
llvm/lib/Analysis/InlineOrder.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/InlineOrder.cpp b/llvm/lib/Analysis/InlineOrder.cpp
index 274096f62a37..ae2c4366ef4c 100644
--- a/llvm/lib/Analysis/InlineOrder.cpp
+++ b/llvm/lib/Analysis/InlineOrder.cpp
@@ -84,7 +84,7 @@ class SizePriority {
}
private:
- unsigned Size;
+ unsigned Size = UINT_MAX;
};
class CostPriority {
@@ -104,7 +104,7 @@ class CostPriority {
}
private:
- int Cost;
+ int Cost = INT_MAX;
};
class CostBenefitPriority {
@@ -170,8 +170,8 @@ class CostBenefitPriority {
}
private:
- int Cost;
- int StaticBonusApplied;
+ int Cost = INT_MAX;
+ int StaticBonusApplied = 0;
Optional<CostBenefitPair> CostBenefit;
};
More information about the llvm-commits
mailing list