mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Switch the TargetMachine back to being IGM-specific instead of global to the IRGenerator.
My understanding is that this *should* be read-only, but there are test cases that are failing that suggest it might not be.
This commit is contained in:
@@ -114,19 +114,22 @@ static clang::CodeGenerator *createClangCodeGenerator(ASTContext &Context,
|
||||
return ClangCodeGen;
|
||||
}
|
||||
|
||||
IRGenModule::IRGenModule(IRGenerator &irgen, SourceFile *SF,
|
||||
ASTContext &Context,
|
||||
IRGenModule::IRGenModule(IRGenerator &irgen,
|
||||
std::unique_ptr<llvm::TargetMachine> &&target,
|
||||
SourceFile *SF,
|
||||
llvm::LLVMContext &LLVMContext,
|
||||
StringRef ModuleName,
|
||||
StringRef OutputFilename)
|
||||
: Context(Context),
|
||||
: IRGen(irgen),
|
||||
Context(irgen.SIL.getASTContext()),
|
||||
ClangCodeGen(createClangCodeGenerator(Context, LLVMContext,
|
||||
irgen.Opts, ModuleName)),
|
||||
Module(*ClangCodeGen->GetModule()),
|
||||
LLVMContext(Module.getContext()),
|
||||
DataLayout(irgen.TargetMachine->createDataLayout()),
|
||||
DataLayout(target->createDataLayout()),
|
||||
Triple(Context.LangOpts.Target),
|
||||
OutputFilename(OutputFilename), IRGen(irgen),
|
||||
TargetMachine(std::move(target)),
|
||||
OutputFilename(OutputFilename),
|
||||
TargetInfo(SwiftTargetInfo::get(*this)),
|
||||
DebugInfo(0), ModuleHash(nullptr),
|
||||
ObjCInterop(Context.LangOpts.EnableObjCInterop),
|
||||
|
||||
Reference in New Issue
Block a user