From: Craig Topper Date: Sat, 1 Apr 2023 06:35:43 +0000 (-0700) Subject: [TableGen] Simplify some code. NFC X-Git-Tag: upstream/17.0.6~12987 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e971ca8765741b1d5c4d2d3b79c0be49a55a1b28;p=platform%2Fupstream%2Fllvm.git [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. --- diff --git a/llvm/utils/TableGen/DAGISelMatcherGen.cpp b/llvm/utils/TableGen/DAGISelMatcherGen.cpp index ab75181d..9992535 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 ResultVTs = {{ N->getSimpleType(0) }}; - std::array 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; }