[lldb-dev] lldb_private namespace usage

Greg Clayton gclayton at apple.com
Tue Mar 11 10:44:23 PDT 2014


Anonymous namespace is good for classes that are local to the implementation file. Otherwise we should use a namespace for each plugin. 

We have a few ways we can go with namespaces within plugins:

namespace lldb_plugin {
  namespace process {
    namespace linux {
}}}

Or just omit the lldb_plugin and combine the type of plugin "process" with the plug-in name "linux":

namespace process_linux {
}

Again, only use namespaces for each plug-in if the file has a .h and .cpp.

On Mar 11, 2014, at 10:29 AM, Todd Fiala <tfiala at google.com> wrote:

> Hi all,
> 
> I've been running into several classes that are declared in the global namespace (i.e. not within lldb_private or lldb).  One such example would be source/Plugins/Process/Linux/LinuxSignals.h.
> 
> Is our intent to have all non-public API to be declared within lldb_private?  (I would guess so, but wanted to ask in case there was something else at play here).  What I wouldn't expect is for classes to exist in the global namespace.
> 
> Thanks!
> -- 
> Todd Fiala |	 Software Engineer |	 tfiala at google.com |	 650-943-3180
> 
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev




More information about the lldb-dev mailing list