[llvm] dea417f - [TableGen] Pass TreePatternNodePtr to InlinePatternFragments by const reference. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 10 15:05:06 PDT 2023
Author: Craig Topper
Date: 2023-04-10T15:04:24-07:00
New Revision: dea417f75e56bc87633bdd16711b401503a5a821
URL: https://github.com/llvm/llvm-project/commit/dea417f75e56bc87633bdd16711b401503a5a821
DIFF: https://github.com/llvm/llvm-project/commit/dea417f75e56bc87633bdd16711b401503a5a821.diff
LOG: [TableGen] Pass TreePatternNodePtr to InlinePatternFragments by const reference. NFC
Not all paths through this function require the reference count
to be incremened. Pass by reference so we don't increase the count
unnecessarily.
Added:
Modified:
llvm/utils/TableGen/CodeGenDAGPatterns.cpp
llvm/utils/TableGen/CodeGenDAGPatterns.h
Removed:
################################################################################
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
index c2c560117ca5..d4f87d2779ce 100644
--- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
+++ b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
@@ -2071,7 +2071,7 @@ void TreePatternNode::SubstituteFormalArguments(
/// fragments, return the set of inlined versions (this can be more than
/// one if a PatFrags record has multiple alternatives).
void TreePatternNode::InlinePatternFragments(
- TreePatternNodePtr T, TreePattern &TP,
+ const TreePatternNodePtr &T, TreePattern &TP,
std::vector<TreePatternNodePtr> &OutAlternatives) {
if (TP.hasError())
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.h b/llvm/utils/TableGen/CodeGenDAGPatterns.h
index d76f8edd4ab4..154c9f1ede4d 100644
--- a/llvm/utils/TableGen/CodeGenDAGPatterns.h
+++ b/llvm/utils/TableGen/CodeGenDAGPatterns.h
@@ -820,7 +820,7 @@ class TreePatternNode {
/// fragments, return the set of inlined versions (this can be more than
/// one if a PatFrags record has multiple alternatives).
static void
- InlinePatternFragments(TreePatternNodePtr T, TreePattern &TP,
+ InlinePatternFragments(const TreePatternNodePtr &T, TreePattern &TP,
std::vector<TreePatternNodePtr> &OutAlternatives);
/// ApplyTypeConstraints - Apply all of the type constraints relevant to
More information about the llvm-commits
mailing list