mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Swap InputFileKind for ParseInputMode
Tying InputFile to this option meant that every input that was not one of the explictly-blessed kinds was modeled as a Swift file. With the new InputFile that infers file kinds, we no longer need CompilerInvocation::setInputKind
This commit is contained in:
@@ -1859,7 +1859,7 @@ CompilerInvocation::setUpInputForSILTool(
|
||||
// If it looks like we have an AST, set the source file kind to SIL and the
|
||||
// name of the module to the file's name.
|
||||
getFrontendOptions().InputsAndOutputs.addInput(
|
||||
InputFile(inputFilename, bePrimary, fileBufOrErr.get().get()));
|
||||
InputFile(inputFilename, bePrimary, fileBufOrErr.get().get(), file_types::TY_SIL));
|
||||
|
||||
auto result = serialization::validateSerializedAST(
|
||||
fileBufOrErr.get()->getBuffer(), &extendedInfo);
|
||||
@@ -1870,13 +1870,14 @@ CompilerInvocation::setUpInputForSILTool(
|
||||
? moduleNameArg
|
||||
: llvm::sys::path::stem(inputFilename);
|
||||
setModuleName(stem);
|
||||
setInputKind(InputFileKind::SwiftLibrary);
|
||||
getFrontendOptions().InputMode =
|
||||
FrontendOptions::ParseInputMode::SwiftLibrary;
|
||||
} else {
|
||||
const StringRef name = (alwaysSetModuleToMain || moduleNameArg.empty())
|
||||
? "main"
|
||||
: moduleNameArg;
|
||||
setModuleName(name);
|
||||
setInputKind(InputFileKind::SIL);
|
||||
getFrontendOptions().InputMode = FrontendOptions::ParseInputMode::SIL;
|
||||
}
|
||||
return fileBufOrErr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user