aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-config/llvm-config.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-config/llvm-config.cpp')
-rw-r--r--llvm/tools/llvm-config/llvm-config.cpp28
1 files changed, 12 insertions, 16 deletions
diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp
index a54538b..49df8fd 100644
--- a/llvm/tools/llvm-config/llvm-config.cpp
+++ b/llvm/tools/llvm-config/llvm-config.cpp
@@ -142,9 +142,8 @@ static void VisitComponent(const std::string &Name,
if (AC->Library) {
if (Missing && GetComponentLibraryPath) {
std::string path = (*GetComponentLibraryPath)(AC->Library);
- if (DirSep == "\\") {
- std::replace(path.begin(), path.end(), '/', '\\');
- }
+ if (DirSep == "\\")
+ llvm::replace(path, '/', '\\');
if (!sys::fs::exists(path))
Missing->push_back(path);
}
@@ -396,13 +395,12 @@ int main(int argc, char **argv) {
} else {
StaticExt = "lib";
DirSep = "\\";
- std::replace(ActiveObjRoot.begin(), ActiveObjRoot.end(), '/', '\\');
- std::replace(ActivePrefix.begin(), ActivePrefix.end(), '/', '\\');
- std::replace(ActiveBinDir.begin(), ActiveBinDir.end(), '/', '\\');
- std::replace(ActiveLibDir.begin(), ActiveLibDir.end(), '/', '\\');
- std::replace(ActiveCMakeDir.begin(), ActiveCMakeDir.end(), '/', '\\');
- std::replace(ActiveIncludeOption.begin(), ActiveIncludeOption.end(), '/',
- '\\');
+ llvm::replace(ActiveObjRoot, '/', '\\');
+ llvm::replace(ActivePrefix, '/', '\\');
+ llvm::replace(ActiveBinDir, '/', '\\');
+ llvm::replace(ActiveLibDir, '/', '\\');
+ llvm::replace(ActiveCMakeDir, '/', '\\');
+ llvm::replace(ActiveIncludeOption, '/', '\\');
}
SharedDir = ActiveBinDir;
StaticDir = ActiveLibDir;
@@ -437,9 +435,8 @@ int main(int argc, char **argv) {
if (BuiltDyLib) {
std::string path((SharedDir + DirSep + DyLibName).str());
- if (DirSep == "\\") {
- std::replace(path.begin(), path.end(), '/', '\\');
- }
+ if (DirSep == "\\")
+ llvm::replace(path, '/', '\\');
DyLibExists = sys::fs::exists(path);
if (!DyLibExists) {
// The shared library does not exist: don't error unless the user
@@ -554,9 +551,8 @@ int main(int argc, char **argv) {
Components.push_back(AC.Name);
if (AC.Library && !IsInDevelopmentTree) {
std::string path(GetComponentLibraryPath(AC.Library, false));
- if (DirSep == "\\") {
- std::replace(path.begin(), path.end(), '/', '\\');
- }
+ if (DirSep == "\\")
+ llvm::replace(path, '/', '\\');
if (DyLibExists && !sys::fs::exists(path)) {
Components =
GetAllDyLibComponents(IsInDevelopmentTree, true, DirSep);