@@ -926,39 +926,26 @@ static bool checkInputExistence(const Driver &D, const DerivedArgList &Args,
926
926
void Driver::buildInputs (const ToolChain &TC,
927
927
const DerivedArgList &Args,
928
928
InputFileList &Inputs) const {
929
- types::ID InputType = types::TY_Nothing;
930
- Arg *InputTypeArg = nullptr ;
931
-
932
929
llvm::StringMap<StringRef> SourceFileNames;
933
930
934
931
for (Arg *A : Args) {
935
932
if (A->getOption ().getKind () == Option::InputClass) {
936
933
StringRef Value = A->getValue ();
937
934
types::ID Ty = types::TY_INVALID;
938
935
939
- if (InputType == types::TY_Nothing) {
940
- // If there was an explicit arg for this, claim it.
941
- if (InputTypeArg)
942
- InputTypeArg->claim ();
943
-
944
- // stdin must be handled specially.
945
- if (Value.equals (" -" )) {
946
- // By default, treat stdin as Swift input.
947
- // FIXME: should we limit this inference to specific modes?
948
- Ty = types::TY_Swift;
949
- } else {
950
- // Otherwise lookup by extension.
951
- Ty = TC.lookupTypeForExtension (llvm::sys::path::extension (Value));
936
+ // stdin must be handled specially.
937
+ if (Value.equals (" -" )) {
938
+ // By default, treat stdin as Swift input.
939
+ Ty = types::TY_Swift;
940
+ } else {
941
+ // Otherwise lookup by extension.
942
+ Ty = TC.lookupTypeForExtension (llvm::sys::path::extension (Value));
952
943
953
- if (Ty == types::TY_INVALID) {
954
- // FIXME: should we adjust this inference in certain modes?
955
- Ty = types::TY_Object;
956
- }
944
+ if (Ty == types::TY_INVALID) {
945
+ // By default, treat inputs with no extension, or with an
946
+ // extension that isn't recognized, as object files.
947
+ Ty = types::TY_Object;
957
948
}
958
- } else {
959
- assert (InputTypeArg && " InputType set w/o InputTypeArg" );
960
- InputTypeArg->claim ();
961
- Ty = InputType;
962
949
}
963
950
964
951
if (checkInputExistence (*this , Args, Diags, Value))
@@ -973,8 +960,6 @@ void Driver::buildInputs(const ToolChain &TC,
973
960
}
974
961
}
975
962
}
976
-
977
- // FIXME: add -x support (or equivalent)
978
963
}
979
964
}
980
965
0 commit comments