[all-commits] [llvm/llvm-project] 5afd9f: [CodingStandards] Clarify C++ Standard Library usage

Johannes Doerfert via All-commits all-commits at lists.llvm.org
Mon Feb 10 18:30:45 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 5afd9fd916beab15b8fe2e269b3c7466c9ffa574
      https://github.com/llvm/llvm-project/commit/5afd9fd916beab15b8fe2e269b3c7466c9ffa574
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2020-02-10 (Mon, 10 Feb 2020)

  Changed paths:
    M llvm/docs/CodingStandards.rst

  Log Message:
  -----------
  [CodingStandards] Clarify C++ Standard Library usage

The existing wording leaves it unclear if C++ standard library data
structures should be preferred over custom LLVM ones, e.g., SmallVector,
even though common practice seems clear on the issue. This change makes
the wording more explicit and aligns it better with the code base.

Some motivating statistics:

```
ag SmallVector llvm/lib/ | wc
  8846   40306  901421
 ag 'std::vector' llvm/lib/ | wc
  2123    8990  214482

ag SmallVector clang/lib/ | wc
  3023   13824  281691
ag 'std::vector' clang/lib/ | wc
   719    2914   72817
```

Differential Revision: https://reviews.llvm.org/D74340




More information about the All-commits mailing list