From bd25d4bff69e4775b7844d48630618b5ad8d3343 Mon Sep 17 00:00:00 2001 From: Razvan A Lupusoru Date: Wed, 2 Jul 2014 18:16:51 -0700 Subject: ART: Add capability for a pass to have options This patch adds capability to have pass options. These are needed when a pass has multiple flags that can be tweaked. The user is now allowed to pass those options via command line. Since passes are treated as singletons and they are immutable, the overridden options provided by user are set on the compilation unit. Doing this way also allows a selectivity system to tweak the option per compilation instead of doing it globally (due to the single pass existing). The following command line flags have been added: --print-pass-options - This prints all passes that have options along with their defaults. --pass-options= - This is used to pass the overridden options in format of PassName:PassOption:PassOptionSetting Change-Id: Ib5156f5d2ff51a0c64c4ea0fa050bd2170663417 Signed-off-by: Razvan A Lupusoru Signed-off-by: Jean Christophe Beyler --- compiler/dex/compiler_ir.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'compiler/dex/compiler_ir.h') diff --git a/compiler/dex/compiler_ir.h b/compiler/dex/compiler_ir.h index 67bf88aef8..b20840adbc 100644 --- a/compiler/dex/compiler_ir.h +++ b/compiler/dex/compiler_ir.h @@ -17,6 +17,7 @@ #ifndef ART_COMPILER_DEX_COMPILER_IR_H_ #define ART_COMPILER_DEX_COMPILER_IR_H_ +#include #include #include "compiler_enums.h" @@ -91,6 +92,15 @@ struct CompilationUnit { std::unique_ptr cg; // Target-specific codegen. TimingLogger timings; bool print_pass; // Do we want to print a pass or not? + + /** + * @brief Holds pass options for current pass being applied to compilation unit. + * @details This is updated for every pass to contain the overridden pass options + * that were specified by user. The pass itself will check this to see if the + * default settings have been changed. The key is simply the option string without + * the pass name. + */ + SafeMap overridden_pass_options; }; } // namespace art -- cgit v1.2.3-59-g8ed1b