Skip to content

Commit c3e33be

Browse files
committed
[NFC] Drop getSourceFileKind
1 parent 8b725d8 commit c3e33be

File tree

3 files changed

+0
-24
lines changed

3 files changed

+0
-24
lines changed

include/swift/Frontend/Frontend.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,6 @@ class CompilerInvocation {
294294
InputFileKind getInputKind() const {
295295
return FrontendOpts.InputKind;
296296
}
297-
298-
SourceFileKind getSourceFileKind() const;
299-
300297
void setModuleName(StringRef Name) {
301298
FrontendOpts.ModuleName = Name.str();
302299
IRGenOpts.ModuleName = Name.str();

lib/Frontend/CompilerInvocation.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -226,25 +226,6 @@ void CompilerInvocation::setSDKPath(const std::string &Path) {
226226
updateRuntimeLibraryPaths(SearchPathOpts, LangOpts.Target);
227227
}
228228

229-
SourceFileKind CompilerInvocation::getSourceFileKind() const {
230-
switch (getInputKind()) {
231-
case InputFileKind::Swift:
232-
return SourceFileKind::Main;
233-
case InputFileKind::SwiftLibrary:
234-
return SourceFileKind::Library;
235-
case InputFileKind::SwiftModuleInterface:
236-
return SourceFileKind::Interface;
237-
case InputFileKind::SIL:
238-
return SourceFileKind::SIL;
239-
case InputFileKind::None:
240-
case InputFileKind::LLVM:
241-
case InputFileKind::ObjCHeader:
242-
llvm_unreachable("Trying to convert from unsupported InputFileKind");
243-
}
244-
245-
llvm_unreachable("Unhandled InputFileKind in switch.");
246-
}
247-
248229
static bool ParseFrontendArgs(
249230
FrontendOptions &opts, ArgList &args, DiagnosticEngine &diags,
250231
SmallVectorImpl<std::unique_ptr<llvm::MemoryBuffer>> *buffers) {

lib/Frontend/Frontend.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -783,8 +783,6 @@ bool CompilerInstance::createFilesForMainModule(
783783
ModuleDecl *mod, SmallVectorImpl<FileUnit *> &files) const {
784784
// Make sure the main file is the first file in the module.
785785
if (MainBufferID != NO_SUCH_BUFFER) {
786-
auto *mainFile = createSourceFileForMainModule(
787-
mod, Invocation.getSourceFileKind(), MainBufferID);
788786
files.push_back(mainFile);
789787
}
790788

0 commit comments

Comments
 (0)