aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
diff options
context:
space:
mode:
authorJay Foad <jay.foad@amd.com>2025-01-16 13:20:41 +0000
committerGitHub <noreply@github.com>2025-01-16 13:20:41 +0000
commit4e8c9d28132039a98feb97cec2759cddeb37d934 (patch)
treef74b9dabf1bb71e135e432bf34d6eea33b175ed9 /llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
parent4481030a0388a98d1d426d86bed0ac012dfe3b6b (diff)
downloadllvm-4e8c9d28132039a98feb97cec2759cddeb37d934.zip
llvm-4e8c9d28132039a98feb97cec2759cddeb37d934.tar.gz
llvm-4e8c9d28132039a98feb97cec2759cddeb37d934.tar.bz2
[TableGen] Use std::pair instead of std::make_pair. NFC. (#123174)
Also use brace initialization and emplace to avoid explicitly constructing std::pair, and the same for std::tuple.
Diffstat (limited to 'llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp')
-rw-r--r--llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
index 1a61d32..013135a 100644
--- a/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
+++ b/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
@@ -3006,7 +3006,7 @@ TreePatternNodePtr TreePattern::ParseTreePattern(const Init *TheInit,
// Check that the ComplexPattern uses are consistent: "(MY_PAT $a, $b)"
// and "(MY_PAT $b, $a)" should not be allowed in the same pattern;
// neither should "(MY_PAT_1 $a, $b)" and "(MY_PAT_2 $a, $b)".
- auto OperandId = std::make_pair(Operator, i);
+ auto OperandId = std::pair(Operator, i);
auto [PrevOp, Inserted] =
ComplexPatternOperands.try_emplace(Child->getName(), OperandId);
if (!Inserted && PrevOp->getValue() != OperandId) {
@@ -3218,7 +3218,7 @@ void CodeGenDAGPatterns::ParseNodeInfo() {
const CodeGenHwModes &CGH = getTargetInfo().getHwModes();
for (const Record *R : reverse(Records.getAllDerivedDefinitions("SDNode")))
- SDNodes.insert(std::pair(R, SDNodeInfo(R, CGH)));
+ SDNodes.try_emplace(R, SDNodeInfo(R, CGH));
// Get the builtin intrinsic nodes.
intrinsic_void_sdnode = getSDNodeNamed("intrinsic_void");
@@ -3348,8 +3348,7 @@ void CodeGenDAGPatterns::ParseDefaultOperands() {
// SomeSDnode so that we can parse this.
std::vector<std::pair<const Init *, const StringInit *>> Ops;
for (unsigned op = 0, e = DefaultInfo->getNumArgs(); op != e; ++op)
- Ops.push_back(
- std::pair(DefaultInfo->getArg(op), DefaultInfo->getArgName(op)));
+ Ops.emplace_back(DefaultInfo->getArg(op), DefaultInfo->getArgName(op));
const DagInit *DI = DagInit::get(SomeSDNode, nullptr, Ops);
// Create a TreePattern to parse this.