[PATCH] D117142: [clang-format] Fix short functions being considered as inline inside an indented namespace.

Marek Kurdej via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 12 12:30:49 PST 2022


curdeius added a comment.

Still WIP but I'd like to have some feedback.



================
Comment at: clang/lib/Format/UnwrappedLineFormatter.cpp:283
+
+              // FIXME: Use IndentTracker to avoid loop?
+              // Find the last line with lower level.
----------------
Because of this I consider this patch as a WIP still.
I'm all ears if anyone has an idea how to efficiently find the "parent" line of the current one, i.e. a line with level smaller by one.
There are places where we use a stack for similar purposes. I'm not sure if there's already something existing I could use.

As a last resort, I'll add a stack of Lines that start a new level in `LevelIndentTracker` and update it in `nextLine()`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117142



More information about the cfe-commits mailing list