summaryrefslogtreecommitdiff
path: root/compiler/dex/pass.h
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/dex/pass.h')
-rw-r--r--compiler/dex/pass.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/compiler/dex/pass.h b/compiler/dex/pass.h
index 4ce040e9ab..b4906d67df 100644
--- a/compiler/dex/pass.h
+++ b/compiler/dex/pass.h
@@ -89,6 +89,21 @@ class Pass {
return false;
}
+ static void BasePrintMessage(CompilationUnit* c_unit, const char* pass_name, const char* message, ...) {
+ // Check if we want to log something or not.
+ if (c_unit->print_pass) {
+ // Stringify the message.
+ va_list args;
+ va_start(args, message);
+ std::string stringified_message;
+ StringAppendV(&stringified_message, message, args);
+ va_end(args);
+
+ // Log the message and ensure to include pass name.
+ LOG(INFO) << pass_name << ": " << stringified_message;
+ }
+ }
+
protected:
/** @brief The pass name: used for searching for a pass when running a particular pass or debugging. */
const char* const pass_name_;