[llvm] r370189 - [DAGCombine] Remove LoadedSlice::Cost default 'ForCodeSize' constructor arguments. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 28 04:50:36 PDT 2019
Author: rksimon
Date: Wed Aug 28 04:50:36 2019
New Revision: 370189
URL: http://llvm.org/viewvc/llvm-project?rev=370189&view=rev
Log:
[DAGCombine] Remove LoadedSlice::Cost default 'ForCodeSize' constructor arguments. NFCI.
These were always being passed in and it allowed me to add the explicit tag to stop a cppcheck warning about 1 argument constructors.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=370189&r1=370188&r2=370189&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Wed Aug 28 04:50:36 2019
@@ -14132,7 +14132,7 @@ struct LoadedSlice {
/// Helper structure used to compute the cost of a slice.
struct Cost {
/// Are we optimizing for code size.
- bool ForCodeSize;
+ bool ForCodeSize = false;
/// Various cost.
unsigned Loads = 0;
@@ -14141,10 +14141,10 @@ struct LoadedSlice {
unsigned ZExts = 0;
unsigned Shift = 0;
- Cost(bool ForCodeSize = false) : ForCodeSize(ForCodeSize) {}
+ explicit Cost(bool ForCodeSize) : ForCodeSize(ForCodeSize) {}
/// Get the cost of one isolated slice.
- Cost(const LoadedSlice &LS, bool ForCodeSize = false)
+ Cost(const LoadedSlice &LS, bool ForCodeSize)
: ForCodeSize(ForCodeSize), Loads(1) {
EVT TruncType = LS.Inst->getValueType(0);
EVT LoadedType = LS.getLoadedType();
More information about the llvm-commits
mailing list