This is an archive of the discontinued LLVM Phabricator instance.

[lldb] (Semi-automatically) format .swig files
ClosedPublic

Authored by labath on Dec 14 2021, 8:28 AM.

Details

Summary

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.

Diff Detail

Event Timeline

labath requested review of this revision.Dec 14 2021, 8:28 AM
labath created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptDec 14 2021, 8:28 AM
This revision is now accepted and ready to land.Dec 14 2021, 10:42 AM
mib accepted this revision.Dec 14 2021, 10:44 AM

LGTM

This revision was automatically updated to reflect the committed changes.