-
Notifications
You must be signed in to change notification settings - Fork 10.5k
tool for compiling a swiftmodule in memory #26848
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
Conversation
@swift-ci please test tensorflow |
2c5fa9c
to
6160946
Compare
@swift-ci please test tensorflow |
@swift-ci please test tensorflow linux |
include/swift/Subsystems.h
Outdated
const SerializationOptions &options, | ||
std::unique_ptr<llvm::MemoryBuffer> *moduleBuffer, | ||
std::unique_ptr<llvm::MemoryBuffer> *moduleDocBuffer, | ||
const SILModule *M); |
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.
Why does the method above default to M == nullptr and this one doesn't?
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.
I'll change this to be consistent.
lib/Serialization/Serialization.cpp
Outdated
std::unique_ptr<llvm::MemoryBuffer> *moduleBuffer, | ||
std::unique_ptr<llvm::MemoryBuffer> *moduleDocBuffer, const SILModule *M) { | ||
if (moduleBuffer) { | ||
SharedTimer timer("Serialization, swiftmodule, to buffer"); |
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.
to memory?
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.
done
lib/Serialization/Serialization.cpp
Outdated
} | ||
|
||
if (moduleDocBuffer) { | ||
SharedTimer timer("Serialization, swiftdoc, to buffer"); |
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.
Ditto.
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.
done
|
||
using namespace swift; | ||
|
||
class StreamDiagConsumer : public DiagnosticConsumer { |
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.
Looks like this is a copy/paste of StreamDiagConsumer from SwiftASTManager, but I don't mind that for apple/swift:tensorflow.
6160946
to
7aa7d98
Compare
@swift-ci please test tensorflow |
This is a tool for compiling swiftmodules in memory. There is a single entry point
compileSwiftModule
with comments. There are also tests.The purpose is to make it possible to develop a code intelligence server that doesn't rely on an external build system to build dependencies and that doesn't write to the filesystem. See https://forums.swift.org/t/building-swiftmodules-for-sourcekit/28030 for more discussion.
This should be very upstreamable, but I want to get it into the tensorflow branch first so that I can unblock development of the internal google code intelligence server.