[Lldb-commits] [PATCH] D50587: Straight forward FastDemangle replacement in SubsPrimitiveParmItanium

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Aug 13 00:54:41 PDT 2018


JDevlieghere added inline comments.


================
Comment at: source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp:281
                                             llvm::StringRef replace) {
-  Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE);
-
-  const size_t max_len =
-      mangled.size() + mangled.count(search) * replace.size() + 1;
+  struct SwapParms {
+    llvm::StringRef mangled;
----------------
I had to look at the old code to understand the name of this struct. How about DemangleContext or even just Context?


================
Comment at: source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp:292
+
+    void Substitude(llvm::StringRef tail) {
+      if (tail.startswith(search)) {
----------------
typo: substitute


================
Comment at: source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp:316
+  bool err = llvm::itaniumFindTypesInMangledName(mangled.data(), &context,
+                                                 SwapParms::Hook);
+
----------------
In the other patch you call this argument a callback, maybe do the same here for consistency? 


https://reviews.llvm.org/D50587





More information about the lldb-commits mailing list