[LLVMdev] Coding Standards: Iterator begin and end functions.

Chris Lattner clattner at apple.com
Fri Aug 2 15:00:16 PDT 2013


On Aug 2, 2013, at 1:56 PM, Rafael EspĂ­ndola <rafael.espindola at gmail.com> wrote:

> One exception we have in the coding standard is that classes that look
> like STL ones should use similar names for the methods (begin(),
> push_back(), etc...).
> 
> But different parts of llvm have different opinions on how to handle
> the related case of classes that are not STL like, but have multiple
> collections that can be iterated over.
> 
> * llvm/IR uses global_begin, alias_begin, etc. I.E., singular name + _begin().
> * llvm/Object uses begin_symbols, begin_sections, etc. I.E, begin_ +
> plural name.
> * others (YAML, LoopIterator) use beginSequence, beginFlowSequence, etc.
> 
> I would like to propose adding the the format used by llvm/IR to the
> coding standard since it seems to be the most common.

+1

-Chris



More information about the llvm-dev mailing list