-
Notifications
You must be signed in to change notification settings - Fork 345
[CAS] Remove CAS dependency from LLVM_Utils module #11235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
[CAS] Remove CAS dependency from LLVM_Utils module #11235
Conversation
@swift-ci please test llvm |
|
||
/// Get CASBackedFile for read. | ||
virtual llvm::Expected<std::unique_ptr<CASBackedFile>> | ||
openCASBackedFileForRead(const Twine &Path) = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for having this be a separate API instead of just using openFileForRead
and cast<>
ing the result to a CASBackedFile
? Having both be virtual allows the posibility that a subclass returns different files from each one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because CASBackedFileSystem
implements openFileForRead
for all underlying classes and underlying classes just need to implement openCASBackedFileForRead
which returns a different file type. This allows user of CASBackedFileSystem
to use a different API to avoid casting between File
types.
4f6647b
to
82d3f2b
Compare
@swift-ci please test llvm |
82d3f2b
to
6cd1543
Compare
Fix the proper laying of the llvm library by splitting CAS reference away from FileSystem references. This has some behavior changes: * The common base class for FileSystem configured with a CAS-backing is now `llvm::cas::CASBackedFileSystem` and migrate CAS related FileSystem APIs to the new class. * ThreadSafeFileSystem is folded into CASBackedFileSystem to avoid diamond class hierachies. * llvm::vfs::File needs to be RTTIExtended, so that a user can tell if the file is CAS backed when there are overlaying file system. * When configured with multi-layer CAS backed file system, the file content is available in every CAS along the way the file is resolved and the returned CASID is from the top layer. This is a more deterministic behavior than current one, that only the lowest level CAS has the reference, and user actually don't know which CAS it is associated with unless know in advance which layer vended the file.
6cd1543
to
145c6bd
Compare
@swift-ci please test llvm |
Fix the proper laying of the llvm library by splitting CAS reference away from FileSystem references.
This has some behavior changes:
llvm::cas::CASBackedFileSystem
and migrate CAS related FileSystem APIs to the new class.