[PATCH] D139225: [ModuleInliner] Initialize variables (NFC)
Kazu Hirata via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 2 12:53:10 PST 2022
kazu created this revision.
Herald added a subscriber: hiraditya.
Herald added a project: All.
kazu requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
This patch initializes all class variables in InlineOrder.cpp for
safety just in case we miss them in constructors. Currently, all
these variables are properly initialized in their respective
constructors.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D139225
Files:
llvm/lib/Analysis/InlineOrder.cpp
Index: llvm/lib/Analysis/InlineOrder.cpp
===================================================================
--- llvm/lib/Analysis/InlineOrder.cpp
+++ llvm/lib/Analysis/InlineOrder.cpp
@@ -84,7 +84,7 @@
}
private:
- unsigned Size;
+ unsigned Size = UINT_MAX;
};
class CostPriority {
@@ -104,7 +104,7 @@
}
private:
- int Cost;
+ int Cost = INT_MAX;
};
class CostBenefitPriority {
@@ -170,8 +170,8 @@
}
private:
- int Cost;
- int StaticBonusApplied;
+ int Cost = INT_MAX;
+ int StaticBonusApplied = 0;
Optional<CostBenefitPair> CostBenefit;
};
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139225.479724.patch
Type: text/x-patch
Size: 582 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221202/3bb5a5bd/attachment.bin>
More information about the llvm-commits
mailing list