[Lldb-commits] [PATCH] D115736: [lldb] (Semi-automatically) format .swig files

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Dec 14 08:28:47 PST 2021


labath created this revision.
labath added reviewers: JDevlieghere, mib.
labath requested review of this revision.
Herald added a project: LLDB.

I've found my recent ventures into the swig land painful because
of the strange way they are formatted. This patch attempts to alleviate
future headaches by formatting these files into something resembling the
normal llvm style.

Unfortunately, completely formatting these files automatically does not
work because clang format gets confused by swigs % syntax, so I have
employed a hybrid approach where I formatted blocks of c++ code with
clang-format and then manually massaged the code until it looked
reasonable (and compiled).

I don't expect these files to remain perfectly formatted (although, if
one's editor is configured to configure the current line/block on
request, one can get pretty good results by using it judiciously), but
at least it will prevent the (mangled form of the) old lldb style being
proliferated endlessly.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D115736

Files:
  lldb/bindings/lua/lua-swigsafecast.swig
  lldb/bindings/lua/lua-typemaps.swig
  lldb/bindings/lua/lua-wrapper.swig
  lldb/bindings/python/python-typemaps.swig
  lldb/bindings/python/python-wrapper.swig

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115736.394267.patch
Type: text/x-patch
Size: 105608 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20211214/8411b221/attachment-0001.bin>


More information about the lldb-commits mailing list