This is an archive of the discontinued LLVM Phabricator instance.

clang-format: introduce InlineOnly short function style
ClosedPublic

Authored by Typz on Jun 20 2017, 5:52 AM.

Details

Summary

This is the same as Inline, except it does not imply all empty
functions are merged: with this style, empty functions are merged only
if they also match the 'inline' criteria (i.e. defined in a class).

This is helpful to avoid inlining functions in implementations files.

Event Timeline

Typz created this revision.Jun 20 2017, 5:52 AM
djasper added inline comments.Jun 21 2017, 1:23 AM
include/clang/Format/Format.h
234

I'd prefer these functions not to be in the public header file. They are implementation details. Either find a header/cpp-file in the lib/ directory to place them in or just remove them for now. They are both still quite small and called only twice each.

unittests/Format/FormatTest.cpp
6530

Missing line break.

6548

Missing line break. Generally use clang-format on the patches :).

Typz marked 3 inline comments as done.Jun 21 2017, 4:52 AM
Typz added inline comments.
include/clang/Format/Format.h
234

This is similar to the isCpp() method, to provide a better abstraction in the implementation.
I cannot find any better place, so I will remove them.

Typz updated this revision to Diff 103357.Jun 21 2017, 5:02 AM
Typz marked an inline comment as done.

Fix according to review comments

djasper accepted this revision.Jun 21 2017, 5:08 AM

Looks good.

This revision is now accepted and ready to land.Jun 21 2017, 5:08 AM
This revision was automatically updated to reflect the committed changes.