@@ -234,12 +234,12 @@ namespace swift {
234
234
// / SIL of all files in the module is present in the SILModule.
235
235
std::unique_ptr<SILModule>
236
236
performSILGeneration (ModuleDecl *M, Lowering::TypeConverter &TC,
237
- SILOptions &options);
237
+ const SILOptions &options);
238
238
239
239
// / Turn a source file into SIL IR.
240
240
std::unique_ptr<SILModule>
241
241
performSILGeneration (FileUnit &SF, Lowering::TypeConverter &TC,
242
- SILOptions &options);
242
+ const SILOptions &options);
243
243
244
244
using ModuleOrSourceFile = PointerUnion<ModuleDecl *, SourceFile *>;
245
245
@@ -269,7 +269,7 @@ namespace swift {
269
269
// / and return the generated LLVM IR module.
270
270
// / If you set an outModuleHash, then you need to call performLLVM.
271
271
std::unique_ptr<llvm::Module>
272
- performIRGeneration (IRGenOptions &Opts, ModuleDecl *M,
272
+ performIRGeneration (const IRGenOptions &Opts, ModuleDecl *M,
273
273
std::unique_ptr<SILModule> SILMod,
274
274
StringRef ModuleName, const PrimarySpecificPaths &PSPs,
275
275
llvm::LLVMContext &LLVMContext,
@@ -281,7 +281,7 @@ namespace swift {
281
281
// / and return the generated LLVM IR module.
282
282
// / If you set an outModuleHash, then you need to call performLLVM.
283
283
std::unique_ptr<llvm::Module>
284
- performIRGeneration (IRGenOptions &Opts, SourceFile &SF,
284
+ performIRGeneration (const IRGenOptions &Opts, SourceFile &SF,
285
285
std::unique_ptr<SILModule> SILMod,
286
286
StringRef ModuleName, const PrimarySpecificPaths &PSPs,
287
287
StringRef PrivateDiscriminator,
@@ -292,15 +292,15 @@ namespace swift {
292
292
// / Given an already created LLVM module, construct a pass pipeline and run
293
293
// / the Swift LLVM Pipeline upon it. This does not cause the module to be
294
294
// / printed, only to be optimized.
295
- void performLLVMOptimizations (IRGenOptions &Opts, llvm::Module *Module,
295
+ void performLLVMOptimizations (const IRGenOptions &Opts, llvm::Module *Module,
296
296
llvm::TargetMachine *TargetMachine);
297
297
298
298
// / Wrap a serialized module inside a swift AST section in an object file.
299
299
void createSwiftModuleObjectFile (SILModule &SILMod, StringRef Buffer,
300
300
StringRef OutputPath);
301
301
302
302
// / Turn the given LLVM module into native code and return true on error.
303
- bool performLLVM (IRGenOptions &Opts, ASTContext &Ctx, llvm::Module *Module,
303
+ bool performLLVM (const IRGenOptions &Opts, ASTContext &Ctx, llvm::Module *Module,
304
304
StringRef OutputFilename,
305
305
UnifiedStatsReporter *Stats=nullptr );
306
306
@@ -315,7 +315,7 @@ namespace swift {
315
315
// / \param TargetMachine target of code gen, required.
316
316
// / \param effectiveLanguageVersion version of the language, effectively.
317
317
// / \param OutputFilename Filename for output.
318
- bool performLLVM (IRGenOptions &Opts, DiagnosticEngine *Diags,
318
+ bool performLLVM (const IRGenOptions &Opts, DiagnosticEngine *Diags,
319
319
llvm::sys::Mutex *DiagMutex,
320
320
llvm::GlobalVariable *HashGlobal,
321
321
llvm::Module *Module,
@@ -325,13 +325,13 @@ namespace swift {
325
325
UnifiedStatsReporter *Stats=nullptr );
326
326
327
327
// / Dump YAML describing all fixed-size types imported from the given module.
328
- bool performDumpTypeInfo (IRGenOptions &Opts,
328
+ bool performDumpTypeInfo (const IRGenOptions &Opts,
329
329
SILModule &SILMod,
330
330
llvm::LLVMContext &LLVMContext);
331
331
332
332
// / Creates a TargetMachine from the IRGen opts and AST Context.
333
333
std::unique_ptr<llvm::TargetMachine>
334
- createTargetMachine (IRGenOptions &Opts, ASTContext &Ctx);
334
+ createTargetMachine (const IRGenOptions &Opts, ASTContext &Ctx);
335
335
336
336
// / A convenience wrapper for Parser functionality.
337
337
class ParserUnit {
0 commit comments