This is an archive of the discontinued LLVM Phabricator instance.

[clang][docs] Defensively turn off exception behavior in dump_ast_matchers.py
ClosedPublic

Authored by t-rasmud on Jul 12 2023, 3:55 PM.

Details

Summary

This patch turns exceptions (that are being triggered in most cases) into defensive prints

Diff Detail

Event Timeline

t-rasmud created this revision.Jul 12 2023, 3:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 12 2023, 3:55 PM
t-rasmud requested review of this revision.Jul 12 2023, 3:55 PM
t-rasmud edited the summary of this revision. (Show Details)Jul 12 2023, 3:58 PM
NoQ added a comment.Jul 12 2023, 4:06 PM

Yes, as far as I understand, the URL request is more of an "assert" thing; it confirms that there's a doxygen page for the class mentioned in the code, but I'd be very surprised if there are any actual classes that you can use in the C++ code for which there's no doxygen page.

This check was running into problems on, uh, certain corporate networks with unusual SSL certificate manipulations, and I think it makes sense to make it less mandatory. It's still checking all URLs by default whenever it can, so it'll start flagging broken URLs anyway if they ever appear, it just unblocks progress for folks who need or prefer it to be offline for some reason. Which is really helpful when it's like your first time running this script and you've no idea what to expect.

clang/docs/tools/dump_ast_matchers.py
62–66

It's probably better to be explicit about what we expect to happen here. This is just a string operation, it probably can't go wrong in many ways.

t-rasmud updated this revision to Diff 540165.Jul 13 2023, 1:14 PM

Address feedback.

t-rasmud marked an inline comment as done.Jul 13 2023, 1:15 PM

nit: I would suggest splitting the update to the docs from the modification to the script itself, since they are unrelated.

t-rasmud updated this revision to Diff 540435.Jul 14 2023, 8:47 AM
t-rasmud edited the summary of this revision. (Show Details)
t-rasmud retitled this revision from [clang][docs] Update LibASTMatchersReference.html and defensively turn off exception behavior in dump_ast_matchers.py to [clang][docs] Defensively turn off exception behavior in dump_ast_matchers.py.

Splitting the update: Updates to LibASTMAtchersReference.html are now in https://reviews.llvm.org/D155304

jkorous accepted this revision.Jul 18 2023, 2:53 PM

LGTM

This revision is now accepted and ready to land.Jul 18 2023, 2:53 PM
This revision was landed with ongoing or failed builds.Jul 18 2023, 3:36 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 18 2023, 3:36 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript