File tree Expand file tree Collapse file tree 4 files changed +12
-9
lines changed Expand file tree Collapse file tree 4 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -548,7 +548,7 @@ class FrontendOptions {
548
548
549
549
static bool doesActionProduceOutput (ActionType);
550
550
static bool doesActionProduceTextualOutput (ActionType);
551
- static bool doesActionImplyMainModule (ActionType);
551
+ static bool needsProperModuleName (ActionType);
552
552
};
553
553
554
554
}
Original file line number Diff line number Diff line change @@ -640,7 +640,7 @@ bool FrontendArgsToOptionsConverter::computeModuleName() {
640
640
(Opts.ModuleName != STDLIB_NAME || Opts.ParseStdlib )) {
641
641
return false ;
642
642
}
643
- if (FrontendOptions::doesActionImplyMainModule (Opts.RequestedAction ) ||
643
+ if (! FrontendOptions::needsProperModuleName (Opts.RequestedAction ) ||
644
644
Opts.isCompilingExactlyOneSwiftFile ()) {
645
645
Opts.ModuleName = " main" ;
646
646
return false ;
@@ -681,8 +681,9 @@ bool FrontendArgsToOptionsConverter::computeFallbackModuleName() {
681
681
}
682
682
683
683
bool FrontendArgsToOptionsConverter::computeOutputFilenames () {
684
+ assert (Opts.OutputFilenames .empty () &&
685
+ " Output filename should not be set at this point" );
684
686
if (!FrontendOptions::doesActionProduceOutput (Opts.RequestedAction )) {
685
- Opts.OutputFilenames .clear ();
686
687
return false ;
687
688
}
688
689
ArrayRef<std::string> outputFilenamesFromCommandLineOrFilelist =
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ void FrontendInputs::transformInputFilenames(
96
96
}
97
97
}
98
98
99
- bool FrontendOptions::doesActionImplyMainModule (ActionType action) {
99
+ bool FrontendOptions::needsProperModuleName (ActionType action) {
100
100
switch (action) {
101
101
case ActionType::NoneAction:
102
102
case ActionType::Parse:
@@ -108,24 +108,24 @@ bool FrontendOptions::doesActionImplyMainModule(ActionType action) {
108
108
case ActionType::PrintAST:
109
109
case ActionType::DumpScopeMaps:
110
110
case ActionType::DumpTypeRefinementContexts:
111
- return true ;
111
+ return false ;
112
112
case ActionType::EmitPCH:
113
113
case ActionType::EmitSILGen:
114
114
case ActionType::EmitSIL:
115
115
case ActionType::EmitSIBGen:
116
116
case ActionType::EmitSIB:
117
117
case ActionType::EmitModuleOnly:
118
118
case ActionType::MergeModules:
119
- return false ;
119
+ return true ;
120
120
case ActionType::Immediate:
121
121
case ActionType::REPL:
122
- return true ;
122
+ return false ;
123
123
case ActionType::EmitAssembly:
124
124
case ActionType::EmitIR:
125
125
case ActionType::EmitBC:
126
126
case ActionType::EmitObject:
127
127
case ActionType::EmitImportedModules:
128
- return false ;
128
+ return true ;
129
129
}
130
130
llvm_unreachable (" Unknown ActionType" );
131
131
}
Original file line number Diff line number Diff line change 1
- // RUN: rm -rf %t && mkdir -p %t && cd %t && echo >test.swift && %swift -interpret test.swift && rm test.swift && test `ls | wc -w` -eq 0
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: cd %t && %target-swift-frontend -interpret %S/../Inputs/empty.swift
3
+ // RUN: not ls %t/*
You can’t perform that action at this time.
0 commit comments