Skip to content

Commit a3cf373

Browse files
authored
Merge pull request swiftlang#30471 from benlangmuir/more-str
More explicit StringRef -> std::string conversions
2 parents 6412581 + a46b35b commit a3cf373

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

include/swift/Basic/PathRemapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class PathRemapper {
3939
/// Adds a mapping such that any paths starting with `FromPrefix` have that
4040
/// portion replaced with `ToPrefix`.
4141
void addMapping(StringRef FromPrefix, StringRef ToPrefix) {
42-
PathMappings.emplace_back(FromPrefix, ToPrefix);
42+
PathMappings.emplace_back(FromPrefix.str(), ToPrefix.str());
4343
}
4444

4545
/// Returns a remapped `Path` if it starts with a prefix in the map; otherwise

lib/Driver/FineGrainedDependencyDriverGraph.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ std::vector<const Job *> ModuleDepGraph::jobsContaining(
178178
void ModuleDepGraph::registerJob(const Job *job) {
179179
// No need to create any nodes; that will happen when the swiftdeps file is
180180
// read. Just record the correspondence.
181-
jobsBySwiftDeps.insert(std::make_pair(getSwiftDeps(job), job));
181+
jobsBySwiftDeps.insert(std::make_pair(getSwiftDeps(job).str(), job));
182182
}
183183

184184
std::vector<const Job *> ModuleDepGraph::getAllJobs() const {

lib/Driver/ParseableOutput.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class DetailedCommandBasedMessage : public CommandBasedMessage {
136136
if (PrimaryOutputType != file_types::TY_Nothing) {
137137
for (llvm::StringRef OutputFileName :
138138
Cmd.getOutput().getPrimaryOutputFilenames()) {
139-
Outputs.push_back(OutputPair(PrimaryOutputType, OutputFileName));
139+
Outputs.push_back(OutputPair(PrimaryOutputType, OutputFileName.str()));
140140
}
141141
}
142142
file_types::forAllTypes([&](file_types::ID Ty) {

0 commit comments

Comments
 (0)