[llvm] r352506 - [SelectionDAGBuilder] Remove redundant variable. NFCI.
Nirav Dave via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 29 07:14:07 PST 2019
Author: niravd
Date: Tue Jan 29 07:14:07 2019
New Revision: 352506
URL: http://llvm.org/viewvc/llvm-project?rev=352506&view=rev
Log:
[SelectionDAGBuilder] Remove redundant variable. NFCI.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp?rev=352506&r1=352505&r2=352506&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Tue Jan 29 07:14:07 2019
@@ -7846,15 +7846,11 @@ void SelectionDAGBuilder::visitInlineAsm
SmallVector<SDValue, 8> OutChains;
llvm::Type *CSResultType = CS.getType();
- unsigned NumReturns = 0;
ArrayRef<Type *> ResultTypes;
- if (StructType *StructResult = dyn_cast<StructType>(CSResultType)) {
- NumReturns = StructResult->getNumElements();
+ if (StructType *StructResult = dyn_cast<StructType>(CSResultType))
ResultTypes = StructResult->elements();
- } else if (!CSResultType->isVoidTy()) {
- NumReturns = 1;
+ else if (!CSResultType->isVoidTy())
ResultTypes = makeArrayRef(CSResultType);
- }
auto CurResultType = ResultTypes.begin();
auto handleRegAssign = [&](SDValue V) {
@@ -7919,7 +7915,7 @@ void SelectionDAGBuilder::visitInlineAsm
if (!ResultValues.empty()) {
assert(CurResultType == ResultTypes.end() &&
"Mismatch in number of ResultTypes");
- assert(ResultValues.size() == NumReturns &&
+ assert(ResultValues.size() == ResultTypes.size() &&
"Mismatch in number of output operands in asm result");
SDValue V = DAG.getNode(ISD::MERGE_VALUES, getCurSDLoc(),
More information about the llvm-commits
mailing list