[llvm] fae1369 - [Demangle] fix another test on windows
Nick Desaulniers via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 20 17:24:03 PDT 2023
Author: Nick Desaulniers
Date: 2023-04-20T17:23:49-07:00
New Revision: fae136960744aff6ef51c6f38add992bb84d7c13
URL: https://github.com/llvm/llvm-project/commit/fae136960744aff6ef51c6f38add992bb84d7c13
DIFF: https://github.com/llvm/llvm-project/commit/fae136960744aff6ef51c6f38add992bb84d7c13.diff
LOG: [Demangle] fix another test on windows
Alan spotted another test failure that was a result of
https://reviews.llvm.org/D148546 when running expensive checks tests
locally on windows.
Reviewed By: ayzhao
Differential Revision: https://reviews.llvm.org/D148861
Added:
Modified:
llvm/lib/ProfileData/ItaniumManglingCanonicalizer.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ProfileData/ItaniumManglingCanonicalizer.cpp b/llvm/lib/ProfileData/ItaniumManglingCanonicalizer.cpp
index d9f8f0ea75251..afbb09ed35fc1 100644
--- a/llvm/lib/ProfileData/ItaniumManglingCanonicalizer.cpp
+++ b/llvm/lib/ProfileData/ItaniumManglingCanonicalizer.cpp
@@ -23,7 +23,10 @@ struct FoldingSetNodeIDBuilder {
llvm::FoldingSetNodeID &ID;
void operator()(const Node *P) { ID.AddPointer(P); }
void operator()(std::string_view Str) {
- ID.AddString(llvm::StringRef(&*Str.begin(), Str.size()));
+ if (Str.empty())
+ ID.AddString({});
+ else
+ ID.AddString(llvm::StringRef(&*Str.begin(), Str.size()));
}
template <typename T>
std::enable_if_t<std::is_integral_v<T> || std::is_enum_v<T>> operator()(T V) {
More information about the llvm-commits
mailing list