mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SIL: Share TypeConverter between SILModules in batch mode
This commit is contained in:
@@ -55,6 +55,10 @@ class SerializedModuleLoader;
|
||||
class MemoryBufferSerializedModuleLoader;
|
||||
class SILModule;
|
||||
|
||||
namespace Lowering {
|
||||
class TypeConverter;
|
||||
}
|
||||
|
||||
/// The abstract configuration of the compiler, including:
|
||||
/// - options for all stages of translation,
|
||||
/// - information about the build environment,
|
||||
@@ -372,6 +376,7 @@ class CompilerInstance {
|
||||
SourceManager SourceMgr;
|
||||
DiagnosticEngine Diagnostics{SourceMgr};
|
||||
std::unique_ptr<ASTContext> Context;
|
||||
std::unique_ptr<Lowering::TypeConverter> TheSILTypes;
|
||||
std::unique_ptr<SILModule> TheSILModule;
|
||||
|
||||
std::unique_ptr<PersistentParserState> PersistentState;
|
||||
@@ -422,8 +427,6 @@ class CompilerInstance {
|
||||
|
||||
bool isWholeModuleCompilation() { return PrimaryBufferIDs.empty(); }
|
||||
|
||||
void createSILModule();
|
||||
|
||||
public:
|
||||
// Out of line to avoid having to import SILModule.h.
|
||||
CompilerInstance();
|
||||
@@ -448,6 +451,10 @@ public:
|
||||
SILOptions &getSILOptions() { return Invocation.getSILOptions(); }
|
||||
const SILOptions &getSILOptions() const { return Invocation.getSILOptions(); }
|
||||
|
||||
Lowering::TypeConverter &getSILTypes();
|
||||
|
||||
void createSILModule();
|
||||
|
||||
void addDiagnosticConsumer(DiagnosticConsumer *DC) {
|
||||
Diagnostics.addConsumer(*DC);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user