[llvm] e971ca8 - [TableGen] Simplify some code. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 31 23:38:01 PDT 2023
Author: Craig Topper
Date: 2023-03-31T23:35:48-07:00
New Revision: e971ca8765741b1d5c4d2d3b79c0be49a55a1b28
URL: https://github.com/llvm/llvm-project/commit/e971ca8765741b1d5c4d2d3b79c0be49a55a1b28
DIFF: https://github.com/llvm/llvm-project/commit/e971ca8765741b1d5c4d2d3b79c0be49a55a1b28.diff
LOG: [TableGen] Simplify some code. NFC
This code was creating 1 entry or 0 entry std::array to pass to
to ArrayRef arguments. ArrayRef has a constructor from a single
object and we can use std::nullopt for an empty ArrayRef.
Added:
Modified:
llvm/utils/TableGen/DAGISelMatcherGen.cpp
Removed:
################################################################################
diff --git a/llvm/utils/TableGen/DAGISelMatcherGen.cpp b/llvm/utils/TableGen/DAGISelMatcherGen.cpp
index ab75181d3244..999253529008 100644
--- a/llvm/utils/TableGen/DAGISelMatcherGen.cpp
+++ b/llvm/utils/TableGen/DAGISelMatcherGen.cpp
@@ -695,12 +695,11 @@ void MatcherGen::EmitResultLeafAsOperand(const TreePatternNode *N,
}
if (Def->getName() == "undef_tied_input") {
- std::array<MVT::SimpleValueType, 1> ResultVTs = {{ N->getSimpleType(0) }};
- std::array<unsigned, 0> InstOps;
+ MVT::SimpleValueType ResultVT = N->getSimpleType(0);
auto IDOperandNo = NextRecordedOperandNo++;
AddMatcher(new EmitNodeMatcher("TargetOpcode::IMPLICIT_DEF",
- ResultVTs, InstOps, false, false, false,
- false, -1, IDOperandNo));
+ ResultVT, std::nullopt, false, false,
+ false, false, -1, IDOperandNo));
ResultOps.push_back(IDOperandNo);
return;
}
More information about the llvm-commits
mailing list