Skip to content

Commit 8b725d8

Browse files
committed
[NFC] Inline inputFileKindCanHaveTBDValidated
1 parent 513d108 commit 8b725d8

File tree

3 files changed

+4
-21
lines changed

3 files changed

+4
-21
lines changed

lib/FrontendTool/FrontendTool.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2104,7 +2104,10 @@ static bool validateTBDIfNeeded(const CompilerInvocation &Invocation,
21042104

21052105
// If we can't validate the given input file, bail early. This covers cases
21062106
// like passing raw SIL as a primary file.
2107-
if (!inputFileKindCanHaveTBDValidated(Invocation.getInputKind())) {
2107+
const auto &IO = Invocation.getFrontendOptions().InputsAndOutputs;
2108+
// FIXME: This would be a good test of the interface format.
2109+
if (IO.shouldTreatAsModuleInterface() || IO.shouldTreatAsSIL() ||
2110+
IO.shouldTreatAsLLVM() || IO.shouldTreatAsObjCHeader()) {
21082111
return false;
21092112
}
21102113

lib/FrontendTool/TBD.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -56,25 +56,6 @@ bool swift::writeTBD(ModuleDecl *M, StringRef OutputFilename,
5656
return false;
5757
}
5858

59-
bool swift::inputFileKindCanHaveTBDValidated(InputFileKind kind) {
60-
// Only things that involve an AST can have a TBD file computed, at the
61-
// moment.
62-
switch (kind) {
63-
case InputFileKind::Swift:
64-
case InputFileKind::SwiftLibrary:
65-
return true;
66-
case InputFileKind::SwiftModuleInterface:
67-
// FIXME: This would be a good test of the interface format.
68-
return false;
69-
case InputFileKind::None:
70-
case InputFileKind::SIL:
71-
case InputFileKind::LLVM:
72-
case InputFileKind::ObjCHeader:
73-
return false;
74-
}
75-
llvm_unreachable("unhandled kind");
76-
}
77-
7859
static bool validateSymbols(DiagnosticEngine &diags,
7960
const std::vector<std::string> &symbols,
8061
const llvm::Module &IRModule,

lib/FrontendTool/TBD.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ struct TBDGenOptions;
2727

2828
bool writeTBD(ModuleDecl *M, StringRef OutputFilename,
2929
const TBDGenOptions &Opts);
30-
bool inputFileKindCanHaveTBDValidated(InputFileKind kind);
3130
bool validateTBD(ModuleDecl *M,
3231
const llvm::Module &IRModule,
3332
const TBDGenOptions &opts,

0 commit comments

Comments
 (0)