This is an archive of the discontinued LLVM Phabricator instance.

factor out an abstract base class for File
ClosedPublic

Authored by lawrence_danna on Oct 1 2019, 8:56 PM.

Details

Summary

This patch factors out File as an abstract base
class and moves most of its actual functionality into
a subclass called NativeFile. In the next patch,
I'm going to be adding subclasses of File that
don't necessarily have any connection to actual OS files,
so they will not inherit from NativeFile.

This patch was split out as a prerequisite for
https://reviews.llvm.org/D68188

Event Timeline

lawrence_danna created this revision.Oct 1 2019, 8:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 1 2019, 8:56 PM
labath added a comment.Oct 2 2019, 2:16 AM

Makes sense to me, just delete the custom make_shared stuff.

lldb/include/lldb/Host/File.h
377–381

Please delete this stuff, and just use regular std::make_shared. (BTW, shared_ptr<Derived> is implicitly convertible to shared_ptr<Base>)

lawrence_danna marked 2 inline comments as done.

rm NativeFile::make_shared

lldb/include/lldb/Host/File.h
377–381

Huh, I swear when i tried that yesterday the compiler was saying it wasn't implicitly convertible. Now, it is as you say. Must have been gremlins.

labath accepted this revision.Oct 2 2019, 10:55 AM
This revision is now accepted and ready to land.Oct 2 2019, 10:55 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptOct 2 2019, 9:33 PM