This is an archive of the discontinued LLVM Phabricator instance.

Move ConnectionFileDescriptor to posix-subfolder in preparation for implementing on Windows
ClosedPublic

Authored by zturner on Sep 30 2014, 1:22 PM.

Details

Summary

ConnectionFileDescriptor needs a different implementation on Windows and non-Windows platforms due to some fundamental differences. This patch moves source\Core\ConnectionFileDescriptor.cpp to source\Core\posix\ConnectionFileDescriptorPosix.cpp, and similarly for the corresponding header file. Then, the original ConnectionFileDescriptor.h is replaced with a new implementation that includes the platform specific header file.

Currently this patch does not actually implement Windows' version of ConnectionFileDescriptor. It only makes the organizational changes necessary for this to happen in a subsequent patch. As such, with this patch, Windows will actually be compiling source\Core\posix\ConnectionFileDescriptor.cpp. When the windows version of CFD goes in, the CMake will be updated accordingly to compile the windows CFD.

This patch contains no functional changes, only code move.

Diff Detail

Repository
rL LLVM

Event Timeline

zturner updated this revision to Diff 14244.Sep 30 2014, 1:22 PM
zturner retitled this revision from to Move ConnectionFileDescriptor to posix-subfolder in preparation for implementing on Windows.
zturner updated this object.
zturner edited the test plan for this revision. (Show Details)
zturner added reviewers: clayborg, jingham.
zturner added a subscriber: Unknown Object (MLST).
emaste added a subscriber: emaste.Sep 30 2014, 1:42 PM

I haven't looked closely at the proposed patch, but should CFD instead migrate to source/Host/...?

Good question. Logically it seems a little too high level for Host to me.
Conceptually speaking, CFD is just a wrapper around one of any number of
host primitives. For example, it's a wrapper around a file, or a socket,
or a pipe, etc. It just allows you to treat all those things using the
same interface. Host seems more appropriate for providing lower-level
primitives. It's kind of a grey area here though, because the
implementation of CFD uses select(), which doesn't lend itself to a nice
port on Windows, basically the whole thing has to be re-written.

I brainstormed ways of lowering a select-like abstraction into Host so that
CFD could just be implemented without any platform specific stuff, but it's
not that easy since the semantics have some subtle differences that make it
difficult to present a generic interface.

zturner updated this revision to Diff 14288.Oct 1 2014, 11:14 AM

Same change as before, but with CFD moved to Host instead of to a platform-specific folder in Core. There's no functionality change here, just file re-organization.

clayborg accepted this revision.Oct 6 2014, 1:22 PM
clayborg edited edge metadata.

Looks good.

This revision is now accepted and ready to land.Oct 6 2014, 1:22 PM
zturner closed this revision.Oct 6 2014, 2:33 PM
zturner updated this revision to Diff 14473.

Closed by commit rL219143 (authored by @zturner).

lldb/trunk/source/API/SBCommunication.cpp