[PATCH] D148861: [Demangle] fix another test on windows

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 20 17:24:18 PDT 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGfae136960744: [Demangle] fix another test on windows (authored by nickdesaulniers).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148861/new/

https://reviews.llvm.org/D148861

Files:
  llvm/lib/ProfileData/ItaniumManglingCanonicalizer.cpp


Index: llvm/lib/ProfileData/ItaniumManglingCanonicalizer.cpp
===================================================================
--- llvm/lib/ProfileData/ItaniumManglingCanonicalizer.cpp
+++ llvm/lib/ProfileData/ItaniumManglingCanonicalizer.cpp
@@ -23,7 +23,10 @@
   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) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148861.515543.patch
Type: text/x-patch
Size: 691 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230421/8348deef/attachment.bin>


More information about the llvm-commits mailing list