[PATCH] D142073: [BOLT] Handle __uniq prefix added by -funique-internal-linkage-names
Amir Ayupov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 20 15:35:40 PST 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 updated this revision to Diff 490372.
Amir added a comment.
Amir updated this revision to Diff 490992.
Amir published this revision for review.
Herald added subscribers: llvm-commits, yota9.
Herald added a project: LLVM.
bugfix
Amir added a comment.
Remove hasVolatileName changes
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D142073
Files:
bolt/lib/Profile/DataReader.cpp
Index: bolt/lib/Profile/DataReader.cpp
===================================================================
--- bolt/lib/Profile/DataReader.cpp
+++ bolt/lib/Profile/DataReader.cpp
@@ -42,13 +42,11 @@
namespace bolt {
std::optional<StringRef> getLTOCommonName(const StringRef Name) {
- size_t LTOSuffixPos = Name.find(".lto_priv.");
- if (LTOSuffixPos != StringRef::npos)
- return Name.substr(0, LTOSuffixPos + 10);
- if ((LTOSuffixPos = Name.find(".constprop.")) != StringRef::npos)
- return Name.substr(0, LTOSuffixPos + 11);
- if ((LTOSuffixPos = Name.find(".llvm.")) != StringRef::npos)
- return Name.substr(0, LTOSuffixPos + 6);
+ for (StringRef Suffix : {".__uniq.", ".lto_priv.", ".constprop.", ".llvm."}) {
+ size_t LTOSuffixPos = Name.find(Suffix);
+ if (LTOSuffixPos != StringRef::npos)
+ return Name.substr(0, LTOSuffixPos + Suffix.size());
+ }
return std::nullopt;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142073.490992.patch
Type: text/x-patch
Size: 913 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230120/2571a178/attachment.bin>
More information about the llvm-commits
mailing list