aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/IPO/MergeFunctions.cpp
diff options
context:
space:
mode:
authorStephen Tozer <stephen.tozer@sony.com>2024-03-14 12:19:15 +0000
committerGitHub <noreply@github.com>2024-03-14 12:19:15 +0000
commit2e865353ed6baa35609e94bf5de9f2061df6eacf (patch)
tree25ba906fafce3dae1ebe5caf1cae4bfb3d9ddb6c /llvm/lib/Transforms/IPO/MergeFunctions.cpp
parent5f774619eac5db73398225a4c924a9c1d437fb40 (diff)
downloadllvm-2e865353ed6baa35609e94bf5de9f2061df6eacf.zip
llvm-2e865353ed6baa35609e94bf5de9f2061df6eacf.tar.gz
llvm-2e865353ed6baa35609e94bf5de9f2061df6eacf.tar.bz2
[RemoveDIs][NFC] Move DPValue::filter -> filterDbgVars (#85208)
This patch changes DPValue::filter to be a non-member method filterDbgVars. There are two reasons for this: firstly, the name of DPValue is about to change to DbgVariableRecord, which will result in every `for` loop that uses DPValue::filter to require a line break. This is a small thing, but it makes the rename patch more difficult to review, and is just generally more awkward for what is a fairly common loop. Secondly, the intent is to later break up the DPValue class into subclasses, at which point it would be better to have a non-member function that allows template arguments for the cases we want to filter with greater specificity.
Diffstat (limited to 'llvm/lib/Transforms/IPO/MergeFunctions.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/MergeFunctions.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/MergeFunctions.cpp b/llvm/lib/Transforms/IPO/MergeFunctions.cpp
index ed5352e..4ff14b6 100644
--- a/llvm/lib/Transforms/IPO/MergeFunctions.cpp
+++ b/llvm/lib/Transforms/IPO/MergeFunctions.cpp
@@ -643,7 +643,7 @@ void MergeFunctions::filterInstsUnrelatedToPDI(
BI != BIE; ++BI) {
// Examine DPValues as they happen "before" the instruction. Are they
// connected to parameters?
- for (DPValue &DPV : DPValue::filter(BI->getDbgRecordRange())) {
+ for (DPValue &DPV : filterDbgVars(BI->getDbgRecordRange())) {
if (DPV.isDbgValue() || DPV.isDbgAssign()) {
ExamineDbgValue(&DPV, PDPVRelated);
} else {
@@ -686,7 +686,7 @@ void MergeFunctions::filterInstsUnrelatedToPDI(
// Collect the set of unrelated instructions and debug records.
for (Instruction &I : *GEntryBlock) {
- for (DPValue &DPV : DPValue::filter(I.getDbgRecordRange()))
+ for (DPValue &DPV : filterDbgVars(I.getDbgRecordRange()))
IsPDIRelated(&DPV, PDPVRelated, PDPVUnrelatedWL);
IsPDIRelated(&I, PDIRelated, PDIUnrelatedWL);
}