summaryrefslogtreecommitdiffstats
path: root/lld/Common/Args.cpp
diff options
context:
space:
mode:
authorRyan Prichard <rprichard@google.com>2018-09-26 20:50:39 +0000
committerRyan Prichard <rprichard@google.com>2018-09-26 20:50:39 +0000
commited5bb932a202dd5ede1cb70a032f094b35bbd176 (patch)
treee5ab993c529910279c1af8bdb9f57caf616ba12a /lld/Common/Args.cpp
parentb7c8d2d405fb418e1c02004a8be3e541383ac2a1 (diff)
downloadbcm5719-llvm-ed5bb932a202dd5ede1cb70a032f094b35bbd176.tar.gz
bcm5719-llvm-ed5bb932a202dd5ede1cb70a032f094b35bbd176.zip
Allow later -z name=<int> args to override earlier args
Summary: lld already gives later -z options precedence in getZFlag(). This matches the behavior of ld.bfd and ld.gold, where later options override earlier ones. (I tested with -z max-page-size and -z stack-size.) Reviewers: ruiu, espindola, grimar Reviewed By: ruiu, grimar Subscribers: grimar, emaste, arichardson, llvm-commits Differential Revision: https://reviews.llvm.org/D52526 llvm-svn: 343145
Diffstat (limited to 'lld/Common/Args.cpp')
-rw-r--r--lld/Common/Args.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lld/Common/Args.cpp b/lld/Common/Args.cpp
index 854b50a1783..3f0671d72a6 100644
--- a/lld/Common/Args.cpp
+++ b/lld/Common/Args.cpp
@@ -41,7 +41,7 @@ std::vector<StringRef> lld::args::getStrings(opt::InputArgList &Args, int Id) {
uint64_t lld::args::getZOptionValue(opt::InputArgList &Args, int Id,
StringRef Key, uint64_t Default) {
- for (auto *Arg : Args.filtered(Id)) {
+ for (auto *Arg : Args.filtered_reverse(Id)) {
std::pair<StringRef, StringRef> KV = StringRef(Arg->getValue()).split('=');
if (KV.first == Key) {
uint64_t Result = Default;
OpenPOWER on IntegriCloud