diff options
author | Francois Ferrand <thetypz@gmail.com> | 2017-06-30 20:00:02 +0000 |
---|---|---|
committer | Francois Ferrand <thetypz@gmail.com> | 2017-06-30 20:00:02 +0000 |
commit | d2130f51a197dafb969f12f98cde62b148c318d4 (patch) | |
tree | 4e25d305f78d6fea2bb4209ab88e433d18cf948b /llvm/lib/Target/Hexagon/HexagonTargetObjectFile.cpp | |
parent | 5372f0a73e5711a0508280b5f5e655df9edadf80 (diff) | |
download | bcm5719-llvm-d2130f51a197dafb969f12f98cde62b148c318d4.tar.gz bcm5719-llvm-d2130f51a197dafb969f12f98cde62b148c318d4.zip |
clang-format: Do not binpack initialization lists
Summary:
This patch tries to avoid binpacking when initializing lists/arrays, to allow things like:
static int types[] = {
registerType1(),
registerType2(),
registerType3(),
};
std::map<int, std::string> x = {
{ 0, "foo fjakfjaklf kljj" },
{ 1, "bar fjakfjaklf kljj" },
{ 2, "stuff fjakfjaklf kljj" },
};
This is similar to how dictionnaries are formatted, and actually corresponds to the same conditions: when initializing a container (and not just 'calling' a constructor).
Such formatting involves 2 things:
* Line breaks around the content of the block. This can be forced by adding a comma or comment after the last element
* Elements should not be binpacked
This patch considers the block is an initializer list if it either ends with a comma, or follows an assignment, which seems to provide a sensible approximation.
Reviewers: krasimir, djasper
Reviewed By: djasper
Subscribers: malcolm.parsons, klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D34238
llvm-svn: 306868
Diffstat (limited to 'llvm/lib/Target/Hexagon/HexagonTargetObjectFile.cpp')
0 files changed, 0 insertions, 0 deletions