This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [ConnectionFileDescriptorPosix] Refactor scheme matching
ClosedPublic

Authored by mgorny on Oct 7 2021, 9:01 AM.

Details

Summary

Move the POSIX-specific fd:// and file:// scheme handling into
separate methods. Replace the custom GetURLAddress() matching with
splitting into scheme and path, and matching scheme via
llvm::StringSwitch.

Diff Detail

Event Timeline

mgorny requested review of this revision.Oct 7 2021, 9:01 AM
mgorny created this revision.
mgorny updated this revision to Diff 377948.Oct 7 2021, 12:04 PM

Rebase to match the original termios code without other of my patches.

labath accepted this revision.Oct 8 2021, 1:27 AM

thanks

lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp
140–141

Maybe just drop std::function?

161–171

Could you also please convert this to early returns, while you're inside. I spent 10 minutes looking at this, and I'm still not sure whether the error strings are correctly related to the individual checks.

This revision is now accepted and ready to land.Oct 8 2021, 1:27 AM
mgorny marked 2 inline comments as done.Oct 8 2021, 2:47 AM
This revision was landed with ongoing or failed builds.Oct 8 2021, 2:48 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptOct 8 2021, 2:48 AM