[Lldb-commits] [PATCH] D120836: [LLDB] Remove cases of using namespace llvm:: from header file

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 2 11:18:12 PST 2022


labath added a comment.

I think it's reasonable to be able to refer to the dwarf constants from within the dwarf plugin via their base names alone. The implementation -- a top-level `using namespace llvm::dwarf` -- is not reasonable, but that's because the plugin is very old, and completely unnamespaced.

For the newer plugins, we've started putting them in a sub-namespace of lldb_private, which means they cannot be accidentally referenced from the core code, but they can easily reference (without qualification) symbols defined in the core libraries.

If we put the dwarf plugin into a (e.g.) `lldb_private::dwarf` namespace, then I think it would be ok to put a `using namespace llvm::dwarf` into that namespace, even in a header -- because those symbols would only be visible to symbols which are in that namespace.

In other words, I'd have the dwarf plugin do what the minidump plugin is doing (disclaimer: I wrote most of that plugin).

Anyway, I'm not married to that approach, but that's what I would do...


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

https://reviews.llvm.org/D120836



More information about the lldb-commits mailing list