summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_options.h
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2017-08-23 08:57:51 -0700
committerAndreas Gampe <agampe@google.com>2017-10-06 13:22:08 -0700
commit097f34cc09caf46945ec17e198f57ac9c156e904 (patch)
tree2f478bcc58ac21017431505ca87e83f4606355b4 /compiler/driver/compiler_options.h
parent42e482f0615bd935d1426a749a413be2c3f79114 (diff)
ART: Use CmdlineParser in dex2oat
Refactor dex2oat and the compiler to use the cmdline parser. In an effort to standardize command-line parsing and make it easier to add new properties in a principled manner. Test: m test-art-host Change-Id: Ia077a56234dbf579d7ca3430fef325b57aa06333
Diffstat (limited to 'compiler/driver/compiler_options.h')
-rw-r--r--compiler/driver/compiler_options.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/compiler/driver/compiler_options.h b/compiler/driver/compiler_options.h
index a9372c4844..311dbd569e 100644
--- a/compiler/driver/compiler_options.h
+++ b/compiler/driver/compiler_options.h
@@ -231,7 +231,9 @@ class CompilerOptions FINAL {
return no_inline_from_;
}
- bool ParseCompilerOption(const StringPiece& option, UsageFn Usage);
+ bool ParseCompilerOptions(const std::vector<std::string>& options,
+ bool ignore_unrecognized,
+ std::string* error_msg);
void SetNonPic() {
compile_pic_ = false;
@@ -258,7 +260,7 @@ class CompilerOptions FINAL {
}
private:
- void ParseDumpInitFailures(const StringPiece& option, UsageFn Usage);
+ bool ParseDumpInitFailures(const std::string& option, std::string* error_msg);
void ParseDumpCfgPasses(const StringPiece& option, UsageFn Usage);
void ParseInlineMaxCodeUnits(const StringPiece& option, UsageFn Usage);
void ParseNumDexMethods(const StringPiece& option, UsageFn Usage);
@@ -266,7 +268,7 @@ class CompilerOptions FINAL {
void ParseSmallMethodMax(const StringPiece& option, UsageFn Usage);
void ParseLargeMethodMax(const StringPiece& option, UsageFn Usage);
void ParseHugeMethodMax(const StringPiece& option, UsageFn Usage);
- void ParseRegisterAllocationStrategy(const StringPiece& option, UsageFn Usage);
+ bool ParseRegisterAllocationStrategy(const std::string& option, std::string* error_msg);
CompilerFilter::Filter compiler_filter_;
size_t huge_method_threshold_;
@@ -327,6 +329,9 @@ class CompilerOptions FINAL {
friend class CommonCompilerTest;
friend class verifier::VerifierDepsTest;
+ template <class Base>
+ friend bool ReadCompilerOptions(Base& map, CompilerOptions* options, std::string* error_msg);
+
DISALLOW_COPY_AND_ASSIGN(CompilerOptions);
};