[all-commits] [llvm/llvm-project] 9d5e37: [lldb] (Semi-automatically) format .swig files

Pavel Labath via All-commits all-commits at lists.llvm.org
Thu Dec 16 04:58:51 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9d5e37ed8c3d8124be7a4022868e961045c618d5
      https://github.com/llvm/llvm-project/commit/9d5e37ed8c3d8124be7a4022868e961045c618d5
  Author: Pavel Labath <pavel at labath.sk>
  Date:   2021-12-16 (Thu, 16 Dec 2021)

  Changed paths:
    M lldb/bindings/lua/lua-swigsafecast.swig
    M lldb/bindings/lua/lua-typemaps.swig
    M lldb/bindings/lua/lua-wrapper.swig
    M lldb/bindings/python/python-typemaps.swig
    M lldb/bindings/python/python-wrapper.swig

  Log Message:
  -----------
  [lldb] (Semi-automatically) format .swig files

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.

Differential Revision: https://reviews.llvm.org/D115736




More information about the All-commits mailing list