Skip to content

Commit 87d633b

Browse files
committed
[stringref-upgrade] Return a StringRef from suffixForPrincipalOutputFileForAction instead of a const char *.
This is in prepration for changing Strings.h to use StringLiteral.
1 parent da10607 commit 87d633b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

include/swift/Frontend/FrontendOptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ class FrontendOptions {
296296
static bool doesActionProduceOutput(ActionType);
297297
static bool doesActionProduceTextualOutput(ActionType);
298298
static bool needsProperModuleName(ActionType);
299-
static const char *suffixForPrincipalOutputFileForAction(ActionType);
299+
static StringRef suffixForPrincipalOutputFileForAction(ActionType);
300300
};
301301

302302
}

lib/Frontend/FrontendOptions.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,11 @@ void FrontendOptions::forAllOutputPaths(
127127
}
128128
}
129129

130-
const char *
130+
StringRef
131131
FrontendOptions::suffixForPrincipalOutputFileForAction(ActionType action) {
132132
switch (action) {
133133
case ActionType::NoneAction:
134-
return nullptr;
134+
return StringRef();
135135

136136
case ActionType::Parse:
137137
case ActionType::Typecheck:
@@ -142,7 +142,7 @@ FrontendOptions::suffixForPrincipalOutputFileForAction(ActionType action) {
142142
case ActionType::PrintAST:
143143
case ActionType::DumpScopeMaps:
144144
case ActionType::DumpTypeRefinementContexts:
145-
return nullptr;
145+
return StringRef();
146146

147147
case ActionType::EmitPCH:
148148
return PCH_EXTENSION;
@@ -162,7 +162,7 @@ FrontendOptions::suffixForPrincipalOutputFileForAction(ActionType action) {
162162
case ActionType::Immediate:
163163
case ActionType::REPL:
164164
// These modes have no frontend-generated output.
165-
return nullptr;
165+
return StringRef();
166166

167167
case ActionType::EmitAssembly:
168168
return "s";

0 commit comments

Comments
 (0)