[Lldb-commits] [PATCH] D133259: [lldb] Don't assume name of libc++ inline namespace in LibCxxUnorderedMap

Dave Lee via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Sep 16 08:29:55 PDT 2022


kastiglione added inline comments.


================
Comment at: lldb/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp:70
 
+static void consumeNamespace(llvm::StringRef &name) {
+  // Delete past an inline namespace, if any: __[a-zA-Z0-9_]+::
----------------
JDevlieghere wrote:
> rupprecht wrote:
> > nit: this consumes just the inline namespace, so I think `consumeInlineNamespace` might be a better name. I don't feel that strongly though so I'll leave it up to you.
> Rather than modifying the passed-in string, would it make sense to return a `llvm::StringRef`? 
@JDevlieghere My answer is twofold: It follows the  "consume" APIs on StringRef. And I prefer to avoid find expressions where you assign to a var being used on the right side:

```
someVar = someVar.method(...)
```

If you'd like me to change it, I will.


================
Comment at: lldb/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp:70
 
+static void consumeNamespace(llvm::StringRef &name) {
+  // Delete past an inline namespace, if any: __[a-zA-Z0-9_]+::
----------------
kastiglione wrote:
> JDevlieghere wrote:
> > rupprecht wrote:
> > > nit: this consumes just the inline namespace, so I think `consumeInlineNamespace` might be a better name. I don't feel that strongly though so I'll leave it up to you.
> > Rather than modifying the passed-in string, would it make sense to return a `llvm::StringRef`? 
> @JDevlieghere My answer is twofold: It follows the  "consume" APIs on StringRef. And I prefer to avoid find expressions where you assign to a var being used on the right side:
> 
> ```
> someVar = someVar.method(...)
> ```
> 
> If you'd like me to change it, I will.
@rupprecht I agree, `consumeInlineNamespace` it is.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133259



More information about the lldb-commits mailing list