[PATCH] D24891: [ELF] Support -z max-page-size option
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 26 10:27:02 PDT 2016
ruiu added inline comments.
================
Comment at: ELF/Driver.cpp:267-268
@@ -266,4 +266,4 @@
static Optional<StringRef>
getZOptionValue(opt::InputArgList &Args, StringRef Key) {
for (auto *Arg : Args.filtered(OPT_z)) {
----------------
I think you could change this function to take one more parameter and return an integer.
uint64_t getZOptionValue(opt::InputArgList &Args, StringRef Key, uint64_t Default)
================
Comment at: ELF/Driver.cpp:495-497
@@ -494,5 +494,5 @@
if (Optional<StringRef> Value = getZOptionValue(Args, "stack-size"))
if (Value->getAsInteger(0, Config->ZStackSize))
error("invalid stack size: " + *Value);
----------------
then you could do
Config->ZStackSize = getZOptionValue(Args, "stack-size", -1);
================
Comment at: ELF/Driver.cpp:671-672
@@ +670,4 @@
+ // value is defined by the target, but it can be overriden using the option.
+ SetZOptValue("common-page-size", Config->CommonPageSize, Target->PageSize);
+ SetZOptValue("max-page-size", Config->MaxPageSize, Target->MaxPageSize);
+
----------------
and
Config->CommonPageSize = getZOption(Args, "common-page-size", Target->PageSize);
Config->MaxPageSize = getZOption(Args, "max-page-size", Target->PageSize);
https://reviews.llvm.org/D24891
More information about the llvm-commits
mailing list