mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Explicit SmallString->std::string conversion.
This is only needed temporarily until commit d7049213 from upstream LLVM hits the swift/master branch.
This commit is contained in:
@@ -56,7 +56,7 @@ void CompilerInvocation::setMainExecutablePath(StringRef Path) {
|
||||
llvm::sys::path::remove_filename(DiagnosticDocsPath); // Remove /bin
|
||||
llvm::sys::path::append(DiagnosticDocsPath, "share", "doc", "swift",
|
||||
"diagnostics");
|
||||
DiagnosticOpts.DiagnosticDocumentationPath = std::string(DiagnosticDocsPath);
|
||||
DiagnosticOpts.DiagnosticDocumentationPath = std::string(DiagnosticDocsPath.str());
|
||||
}
|
||||
|
||||
void CompilerInvocation::setDefaultPrebuiltCacheIfNecessary() {
|
||||
@@ -89,7 +89,7 @@ static void updateRuntimeLibraryPaths(SearchPathOptions &SearchPathOpts,
|
||||
|
||||
llvm::sys::path::append(LibPath, LibSubDir);
|
||||
SearchPathOpts.RuntimeLibraryPaths.clear();
|
||||
SearchPathOpts.RuntimeLibraryPaths.push_back(std::string(LibPath));
|
||||
SearchPathOpts.RuntimeLibraryPaths.push_back(std::string(LibPath.str()));
|
||||
if (Triple.isOSDarwin())
|
||||
SearchPathOpts.RuntimeLibraryPaths.push_back(DARWIN_OS_LIBRARY_PATH);
|
||||
|
||||
@@ -103,14 +103,14 @@ static void updateRuntimeLibraryPaths(SearchPathOptions &SearchPathOpts,
|
||||
|
||||
if (!Triple.isOSDarwin())
|
||||
llvm::sys::path::append(LibPath, swift::getMajorArchitectureName(Triple));
|
||||
SearchPathOpts.RuntimeLibraryImportPaths.push_back(std::string(LibPath));
|
||||
SearchPathOpts.RuntimeLibraryImportPaths.push_back(std::string(LibPath.str()));
|
||||
|
||||
if (!SearchPathOpts.SDKPath.empty()) {
|
||||
if (tripleIsMacCatalystEnvironment(Triple)) {
|
||||
LibPath = SearchPathOpts.SDKPath;
|
||||
llvm::sys::path::append(LibPath, "System", "iOSSupport");
|
||||
llvm::sys::path::append(LibPath, "usr", "lib", "swift");
|
||||
SearchPathOpts.RuntimeLibraryImportPaths.push_back(std::string(LibPath));
|
||||
SearchPathOpts.RuntimeLibraryImportPaths.push_back(std::string(LibPath.str()));
|
||||
}
|
||||
|
||||
LibPath = SearchPathOpts.SDKPath;
|
||||
@@ -119,7 +119,7 @@ static void updateRuntimeLibraryPaths(SearchPathOptions &SearchPathOpts,
|
||||
llvm::sys::path::append(LibPath, getPlatformNameForTriple(Triple));
|
||||
llvm::sys::path::append(LibPath, swift::getMajorArchitectureName(Triple));
|
||||
}
|
||||
SearchPathOpts.RuntimeLibraryImportPaths.push_back(std::string(LibPath));
|
||||
SearchPathOpts.RuntimeLibraryImportPaths.push_back(std::string(LibPath.str()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -751,7 +751,7 @@ static bool ParseSearchPathArgs(SearchPathOptions &Opts,
|
||||
return searchPath.str();
|
||||
SmallString<64> fullPath{workingDirectory};
|
||||
path::append(fullPath, searchPath);
|
||||
return std::string(fullPath);
|
||||
return std::string(fullPath.str());
|
||||
};
|
||||
|
||||
for (const Arg *A : Args.filtered(OPT_I)) {
|
||||
@@ -1160,7 +1160,7 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
|
||||
// TODO: Should we support -fdebug-compilation-dir?
|
||||
llvm::SmallString<256> cwd;
|
||||
llvm::sys::fs::current_path(cwd);
|
||||
Opts.DebugCompilationDir = std::string(cwd);
|
||||
Opts.DebugCompilationDir = std::string(cwd.str());
|
||||
}
|
||||
|
||||
if (const Arg *A = Args.getLastArg(options::OPT_debug_info_format)) {
|
||||
@@ -1484,8 +1484,8 @@ static bool ParseMigratorArgs(MigratorOptions &Opts,
|
||||
llvm::SmallString<128> authoredDataPath(basePath);
|
||||
llvm::sys::path::append(authoredDataPath, getScriptFileName("overlay", langVer));
|
||||
// Add authored list first to take higher priority.
|
||||
Opts.APIDigesterDataStorePaths.push_back(std::string(authoredDataPath));
|
||||
Opts.APIDigesterDataStorePaths.push_back(std::string(dataPath));
|
||||
Opts.APIDigesterDataStorePaths.push_back(std::string(authoredDataPath.str()));
|
||||
Opts.APIDigesterDataStorePaths.push_back(std::string(dataPath.str()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user