I don’t think we have a coding style guide (yet - we should have one), and 
there are some “undefined” areas, or cases where you’ll see difference in style 
depending on when the code was written.

Main differences I can think of between LLDB and LLVM coding styles:

- 4 spaces instead of 2
- functions are written as

qualifiers RetType
FunctionName (args)
                      ^ space here
{
…
}

- member variables are named m_SomeNiceThingHere and globals g_OneMoreNiceThing

- instead of STL-style iterators, the LLDB convention is to use
size_t GetNumFoos()
Foo GetFooAtIndex(size_t)

- a shared pointer to something is named aSharedPtr_sp, a unique/auto_ptr 
aUniquePtr_ap, if you want to make a typedef for shared_ptr<Foo> you name it 
FooSP

Others probably exist that I am forgetting right now...

Enrico Granata
📩 egranata@.com
☎️ 27683

On Sep 23, 2013, at 7:56 AM, Joerg Sonnenberger <[email protected]> wrote:

> Hi all,
> what are the code formatting rules for LLDB? It is obviously not the
> normal LLVM style, but it doesn't come with a pre-made .clang_format
> config either. There are also inconsistencies in other ways, i.e. LLVM
> normally prefers the C++ wrappers like <cstddef> over stddef.h etc.
> 
> Joerg
> _______________________________________________
> lldb-dev mailing list
> [email protected]
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev

_______________________________________________
lldb-dev mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev

Reply via email to