[PATCH] D116314: [clang-format] Add style to separate definition blocks

ksyx via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 31 05:44:23 PST 2021


ksyx added inline comments.


================
Comment at: clang/lib/Format/DefinitionBlockSeparator.cpp:25
+    FormatTokenLexer &Tokens) {
+  if (Style.SeparateDefinitionBlocks == FormatStyle::SDS_Leave)
+    return {{}, 0};
----------------
HazardyKnusperkeks wrote:
> Better, but I still think we should have the assert here. The class should not be instantiated at all, if you don't want to use it.
My idea is that it would be too redundant to have every user of this method to check style once before it calls it?


================
Comment at: clang/lib/Format/DefinitionBlockSeparator.cpp:35
+    return;
+  auto likelyDefinition = [this](AnnotatedLine *Line) {
+    if (Line->MightBeFunctionDecl && Line->mightBeFunctionDefinition())
----------------
HazardyKnusperkeks wrote:
> ksyx wrote:
> > HazardyKnusperkeks wrote:
> > > 
> > [[ https://github.com/llvm/llvm-project/blob/298367ee6e36eeb1b193ad9fa92082c2ef2345a3/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp#L2393 | Some other lambdas ]] I found use lowercased leading letter, as it looks like a function (call).
> Okay, then I don't know what the LLVM Style is, probably there is none in this regard. I think the lambdas I saw in clang-format are with a capital letter.
Ok. Then I will make changes.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116314/new/

https://reviews.llvm.org/D116314



More information about the cfe-commits mailing list