[next] Convert const char * fields to StringRef

llvm/llvm-project d0262c2394f46bb7da2a75529413d625c70908e5 added a new
default bool param to the two constructors in `SmallVectorMemoryBuffer`.
Since `options.OutputPath` is a `const char *` and that can be promoted
to a `bool`, the constructor being called was changed to the first
constructor (with a default buffer name) - promotion is preferred over
conversion.

Convert the various output paths to a `StringRef` - all their uses
converted to `StringRef` anyway. Also specify the default parameter in
order to maintain the old behaviour, which didn't require a null
terminator.
This commit is contained in:
Ben Barham
2022-05-11 16:34:12 -07:00
parent 50ecb47a46
commit 427a689a96
7 changed files with 24 additions and 21 deletions

View File

@@ -273,7 +273,7 @@ bool ModuleInterfaceBuilder::buildSwiftModuleInternal(
// optimization pipeline.
SerializationOptions SerializationOpts;
std::string OutPathStr = OutPath.str();
SerializationOpts.OutputPath = OutPathStr.c_str();
SerializationOpts.OutputPath = OutPathStr;
SerializationOpts.ModuleLinkName = FEOpts.ModuleLinkName;
SerializationOpts.AutolinkForceLoad =
!subInvocation.getIRGenOptions().ForceLoadSymbolName.empty();