Skip to content

[stringref-upgrade] Return a StringRef from suffixForPrincipalOutputF… #15949

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/swift/Frontend/FrontendOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ class FrontendOptions {
static bool doesActionProduceOutput(ActionType);
static bool doesActionProduceTextualOutput(ActionType);
static bool needsProperModuleName(ActionType);
static const char *suffixForPrincipalOutputFileForAction(ActionType);
static StringRef suffixForPrincipalOutputFileForAction(ActionType);
};

}
Expand Down
8 changes: 4 additions & 4 deletions lib/Frontend/FrontendOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ void FrontendOptions::forAllOutputPaths(
}
}

const char *
StringRef
FrontendOptions::suffixForPrincipalOutputFileForAction(ActionType action) {
switch (action) {
case ActionType::NoneAction:
return nullptr;
return StringRef();

case ActionType::Parse:
case ActionType::Typecheck:
Expand All @@ -142,7 +142,7 @@ FrontendOptions::suffixForPrincipalOutputFileForAction(ActionType action) {
case ActionType::PrintAST:
case ActionType::DumpScopeMaps:
case ActionType::DumpTypeRefinementContexts:
return nullptr;
return StringRef();

case ActionType::EmitPCH:
return PCH_EXTENSION;
Expand All @@ -162,7 +162,7 @@ FrontendOptions::suffixForPrincipalOutputFileForAction(ActionType action) {
case ActionType::Immediate:
case ActionType::REPL:
// These modes have no frontend-generated output.
return nullptr;
return StringRef();

case ActionType::EmitAssembly:
return "s";
Expand Down