aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-objcopy/CopyConfig.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2020-07-06 15:39:42 -0700
committerEric Christopher <echristo@gmail.com>2020-07-06 15:40:14 -0700
commit4029f8ede42f69f5fb5affb3eb008e03d448f407 (patch)
treeca8a799364bb62cf3abc6e32b1c511396a6d4034 /llvm/tools/llvm-objcopy/CopyConfig.cpp
parent1e495e10e6c87c2e7dd9ee7cac9352223b72006b (diff)
downloadllvm-4029f8ede42f69f5fb5affb3eb008e03d448f407.zip
llvm-4029f8ede42f69f5fb5affb3eb008e03d448f407.tar.gz
llvm-4029f8ede42f69f5fb5affb3eb008e03d448f407.tar.bz2
Temporarily Revert "[llvm-install-name-tool] Merge install-name options" as it breaks the objcopy build.
This reverts commit c143900a0851b2c7b7d52e4825c7f073b3474cf6.
Diffstat (limited to 'llvm/tools/llvm-objcopy/CopyConfig.cpp')
-rw-r--r--llvm/tools/llvm-objcopy/CopyConfig.cpp37
1 files changed, 20 insertions, 17 deletions
diff --git a/llvm/tools/llvm-objcopy/CopyConfig.cpp b/llvm/tools/llvm-objcopy/CopyConfig.cpp
index 1fde54dd..f93406f 100644
--- a/llvm/tools/llvm-objcopy/CopyConfig.cpp
+++ b/llvm/tools/llvm-objcopy/CopyConfig.cpp
@@ -874,39 +874,42 @@ parseInstallNameToolOptions(ArrayRef<const char *> ArgsArr) {
auto Match = [=](StringRef RPath) { return RPath == Old || RPath == New; };
// Cannot specify duplicate -rpath entries
- auto It1 = find_if(
- Config.RPathsToUpdate,
- [&Match](const DenseMap<StringRef, StringRef>::value_type &OldNew) {
- return Match(OldNew.getFirst()) || Match(OldNew.getSecond());
- });
+ auto It1 = find_if(Config.RPathsToUpdate,
+ [&Match](const std::pair<StringRef, StringRef> &OldNew) {
+ return Match(OldNew.first) || Match(OldNew.second);
+ });
if (It1 != Config.RPathsToUpdate.end())
- return createStringError(errc::invalid_argument,
- "cannot specify both -rpath " + It1->getFirst() +
- " " + It1->getSecond() + " and -rpath " +
- Old + " " + New);
+ return createStringError(
+ errc::invalid_argument,
+ "cannot specify both -rpath %s %s and -rpath %s %s",
+ It1->first.str().c_str(), It1->second.str().c_str(),
+ Old.str().c_str(), New.str().c_str());
// Cannot specify the same rpath under both -delete_rpath and -rpath
auto It2 = find_if(Config.RPathsToRemove, Match);
if (It2 != Config.RPathsToRemove.end())
- return createStringError(errc::invalid_argument,
- "cannot specify both -delete_rpath " + *It2 +
- " and -rpath " + Old + " " + New);
+ return createStringError(
+ errc::invalid_argument,
+ "cannot specify both -delete_rpath %s and -rpath %s %s",
+ It2->str().c_str(), Old.str().c_str(), New.str().c_str());
// Cannot specify the same rpath under both -add_rpath and -rpath
auto It3 = find_if(Config.RPathToAdd, Match);
if (It3 != Config.RPathToAdd.end())
- return createStringError(errc::invalid_argument,
- "cannot specify both -add_rpath " + *It3 +
- " and -rpath " + Old + " " + New);
+ return createStringError(
+ errc::invalid_argument,
+ "cannot specify both -add_rpath %s and -rpath %s %s",
+ It3->str().c_str(), Old.str().c_str(), New.str().c_str());
- Config.RPathsToUpdate.insert({Old, New});
+ Config.RPathsToUpdate.emplace_back(Old, New);
}
if (auto *Arg = InputArgs.getLastArg(INSTALL_NAME_TOOL_id))
Config.SharedLibId = Arg->getValue();
for (auto *Arg : InputArgs.filtered(INSTALL_NAME_TOOL_change)) {
- Config.InstallNamesToUpdate.insert({Arg->getValue(0), Arg->getValue(1)});
+ Config.InstallNamesToUpdate.emplace_back(Arg->getValue(0),
+ Arg->getValue(1));
}
SmallVector<StringRef, 2> Positional;