[PATCH] D159516: [BOLT][NFC] Simplify RI::selectFunctionsToProcess
Amir Ayupov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 14 10:25:40 PDT 2023
Amir created this revision.
Amir added a reviewer: bolt.
Herald added a reviewer: rafauler.
Herald added subscribers: treapster, ayermolo.
Herald added a reviewer: maksfb.
Herald added a project: All.
Amir requested review of this revision.
Herald added subscribers: llvm-commits, yota9.
Herald added a project: LLVM.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D159516
Files:
bolt/lib/Rewrite/RewriteInstance.cpp
Index: bolt/lib/Rewrite/RewriteInstance.cpp
===================================================================
--- bolt/lib/Rewrite/RewriteInstance.cpp
+++ bolt/lib/Rewrite/RewriteInstance.cpp
@@ -2763,22 +2763,19 @@
return true;
// Non-regex check (-funcs-no-regex and -funcs-file-no-regex).
- std::optional<StringRef> Match =
- Function.forEachName([&ForceFunctionsNR](StringRef Name) {
- return ForceFunctionsNR.count(Name.str());
- });
- return Match.has_value();
+ for (const StringRef Name : Function.getNames())
+ if (ForceFunctionsNR.count(Name.str()))
+ return true;
+
+ return false;
}
if (opts::Lite) {
// Forcibly include functions specified in the -function-order file.
if (opts::ReorderFunctions == ReorderFunctions::RT_USER) {
- std::optional<StringRef> Match =
- Function.forEachName([&](StringRef Name) {
- return ReorderFunctionsUserSet.contains(Name);
- });
- if (Match.has_value())
- return true;
+ for (const StringRef Name : Function.getNames())
+ if (ReorderFunctionsUserSet.contains(Name))
+ return true;
for (const StringRef Name : Function.getNames())
if (std::optional<StringRef> LTOCommonName = getLTOCommonName(Name))
if (ReorderFunctionsLTOCommonSet.contains(*LTOCommonName))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D159516.556797.patch
Type: text/x-patch
Size: 1436 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230914/c8be4760/attachment.bin>
More information about the llvm-commits
mailing list