[llvm] ce2b5f1 - Fix gcc9.2 -Winit-list-lifetime warning. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 15 08:49:30 PST 2020
Author: Simon Pilgrim
Date: 2020-02-15T16:48:51Z
New Revision: ce2b5f1569ad2fff7e5a49d99066b29fd9338abb
URL: https://github.com/llvm/llvm-project/commit/ce2b5f1569ad2fff7e5a49d99066b29fd9338abb
DIFF: https://github.com/llvm/llvm-project/commit/ce2b5f1569ad2fff7e5a49d99066b29fd9338abb.diff
LOG: Fix gcc9.2 -Winit-list-lifetime warning. NFCI.
Reported by @lbenes (Luke Benes)
Added:
Modified:
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index aa3a848bb1c4..f1ca734217a7 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -3295,9 +3295,9 @@ void SelectionDAGBuilder::visitSelect(const User &I) {
SDValue Cond = getValue(I.getOperand(0));
SDValue LHSVal = getValue(I.getOperand(1));
SDValue RHSVal = getValue(I.getOperand(2));
- auto BaseOps = {Cond};
- ISD::NodeType OpCode = Cond.getValueType().isVector() ?
- ISD::VSELECT : ISD::SELECT;
+ SmallVector<SDValue, 1> BaseOps(1, Cond);
+ ISD::NodeType OpCode =
+ Cond.getValueType().isVector() ? ISD::VSELECT : ISD::SELECT;
bool IsUnaryAbs = false;
@@ -3380,13 +3380,13 @@ void SelectionDAGBuilder::visitSelect(const User &I) {
OpCode = Opc;
LHSVal = getValue(LHS);
RHSVal = getValue(RHS);
- BaseOps = {};
+ BaseOps.clear();
}
if (IsUnaryAbs) {
OpCode = Opc;
LHSVal = getValue(LHS);
- BaseOps = {};
+ BaseOps.clear();
}
}
More information about the llvm-commits
mailing list