From e971ca8765741b1d5c4d2d3b79c0be49a55a1b28 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Fri, 31 Mar 2023 23:35:43 -0700 Subject: [PATCH] [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. --- llvm/utils/TableGen/DAGISelMatcherGen.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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; } -- 2.7.4