This is an archive of the discontinued LLVM Phabricator instance.

[lldb/docs] Silence warnings when generating website
ClosedPublic

Authored by mib on Aug 28 2023, 2:23 PM.

Details

Summary

This patch does various things to silence the warnings that show up when
generating the website documentation.

First, this patch adds the missing definition for special member methods
in every SBAPI class. If the class cannot implement one of the special
member method, we just define it as a null operation (pass).

This should fix the following warnings:

WARNING: missing attribute __int__ in object lldb.SB*
WARNING: missing attribute __len__ in object lldb.SB*
WARNING: missing attribute __hex__ in object lldb.SB*
WARNING: missing attribute __oct__ in object lldb.SB*
WARNING: missing attribute __iter__ in object lldb.SB*

Then, it un-skips the various static methods that we didn't generate
the methods for, since it's not necessary thanks to the automod-api module.

Finally, this comments out the _static directory in the sphinx config,
since we don't need it anymore.

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>

Diff Detail

Event Timeline

mib created this revision.Aug 28 2023, 2:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 28 2023, 2:23 PM
Herald added a subscriber: Michael137. · View Herald Transcript
mib requested review of this revision.Aug 28 2023, 2:23 PM
mib updated this revision to Diff 554102.Aug 28 2023, 4:37 PM
JDevlieghere accepted this revision.Aug 28 2023, 9:07 PM

Overall this LGTM. It's really unfortunate we have to define things like __hex__ for every class. Is there a way to either (1) silence this warning on (2) have SWIG generate this for us?

This revision is now accepted and ready to land.Aug 28 2023, 9:07 PM
mib added inline comments.Aug 29 2023, 5:39 AM
lldb/docs/conf.py
46

@JDevlieghere AFAIK, if we want to silence the warnings, we should disable generating special members (such as __hex__) however I think this would be a missed opportunity since they can make using SB classes in python more ergonomic, for example using hex(SBAddress) instead of hex(SBAddress.GetLoadAddress)