diff options
Diffstat (limited to 'runtime/parsed_options.cc')
-rw-r--r-- | runtime/parsed_options.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/runtime/parsed_options.cc b/runtime/parsed_options.cc index 25b5e49b3d..7f82497531 100644 --- a/runtime/parsed_options.cc +++ b/runtime/parsed_options.cc @@ -18,6 +18,7 @@ #include <sstream> +#include "base/out.h" #include "base/stringpiece.h" #include "debugger.h" #include "gc/heap.h" @@ -41,12 +42,11 @@ ParsedOptions::ParsedOptions() // Runtime::Abort } -ParsedOptions* ParsedOptions::Create(const RuntimeOptions& options, bool ignore_unrecognized, - RuntimeArgumentMap* runtime_options) { - CHECK(runtime_options != nullptr); - +ParsedOptions* ParsedOptions::Create(const RuntimeOptions& options, + bool ignore_unrecognized, + out<RuntimeArgumentMap> runtime_options) { std::unique_ptr<ParsedOptions> parsed(new ParsedOptions()); - if (parsed->Parse(options, ignore_unrecognized, runtime_options)) { + if (parsed->Parse(options, ignore_unrecognized, outof_forward(runtime_options))) { return parsed.release(); } return nullptr; @@ -293,6 +293,7 @@ std::unique_ptr<RuntimeParser> ParsedOptions::MakeParser(bool ignore_unrecognize // As a side-effect, populate the hooks from options. bool ParsedOptions::ProcessSpecialOptions(const RuntimeOptions& options, RuntimeArgumentMap* runtime_options, + // TODO: should be an optional_out here. std::vector<std::string>* out_options) { using M = RuntimeArgumentMap; @@ -399,7 +400,7 @@ static void MaybeOverrideVerbosity() { } bool ParsedOptions::Parse(const RuntimeOptions& options, bool ignore_unrecognized, - RuntimeArgumentMap* runtime_options) { + out<RuntimeArgumentMap> runtime_options) { for (size_t i = 0; i < options.size(); ++i) { if (true && options[0].first == "-Xzygote") { LOG(INFO) << "option[" << i << "]=" << options[i].first; @@ -410,7 +411,9 @@ bool ParsedOptions::Parse(const RuntimeOptions& options, bool ignore_unrecognize // Convert to a simple string list (without the magic pointer options) std::vector<std::string> argv_list; - if (!ProcessSpecialOptions(options, nullptr, &argv_list)) { + if (!ProcessSpecialOptions(options, + nullptr, // No runtime argument map + outof(argv_list))) { return false; } |