Revert "Revert "Add option to generate compressed backtrace info.""

This reverts commit 8546cc9aeb05e866e1fb6a9e4130d53ea330baa8.

Change-Id: I676fdf9af27fa3b16fa8921778ff8832ab8c437d
diff --git a/compiler/driver/compiler_options.cc b/compiler/driver/compiler_options.cc
index 2644528..e0b1d8b 100644
--- a/compiler/driver/compiler_options.cc
+++ b/compiler/driver/compiler_options.cc
@@ -37,6 +37,7 @@
       debuggable_(false),
       native_debuggable_(kDefaultNativeDebuggable),
       generate_debug_info_(kDefaultGenerateDebugInfo),
+      generate_mini_debug_info_(kDefaultGenerateMiniDebugInfo),
       implicit_null_checks_(true),
       implicit_so_checks_(true),
       implicit_suspend_checks_(false),
@@ -91,6 +92,7 @@
     debuggable_(debuggable),
     native_debuggable_(kDefaultNativeDebuggable),
     generate_debug_info_(generate_debug_info),
+    generate_mini_debug_info_(kDefaultGenerateMiniDebugInfo),
     implicit_null_checks_(implicit_null_checks),
     implicit_so_checks_(implicit_so_checks),
     implicit_suspend_checks_(implicit_suspend_checks),
@@ -215,6 +217,10 @@
     generate_debug_info_ = true;
   } else if (option == "--no-generate-debug-info") {
     generate_debug_info_ = false;
+  } else if (option == "--generate-mini-debug-info") {
+    generate_mini_debug_info_ = true;
+  } else if (option == "--no-generate-mini-debug-info") {
+    generate_mini_debug_info_ = false;
   } else if (option == "--debuggable") {
     debuggable_ = true;
   } else if (option == "--native-debuggable") {
diff --git a/compiler/driver/compiler_options.h b/compiler/driver/compiler_options.h
index d47fc2a..5294af8 100644
--- a/compiler/driver/compiler_options.h
+++ b/compiler/driver/compiler_options.h
@@ -51,6 +51,7 @@
   static constexpr double kDefaultTopKProfileThreshold = 90.0;
   static const bool kDefaultNativeDebuggable = false;
   static const bool kDefaultGenerateDebugInfo = false;
+  static const bool kDefaultGenerateMiniDebugInfo = false;
   static const bool kDefaultIncludePatchInformation = false;
   static const size_t kDefaultInlineDepthLimit = 3;
   static const size_t kDefaultInlineMaxCodeUnits = 32;
@@ -170,10 +171,20 @@
     return native_debuggable_;
   }
 
+  // This flag controls whether the compiler collects debugging information.
+  // The other flags control how the information is written to disk.
+  bool GenerateAnyDebugInfo() const {
+    return GetGenerateDebugInfo() || GetGenerateMiniDebugInfo();
+  }
+
   bool GetGenerateDebugInfo() const {
     return generate_debug_info_;
   }
 
+  bool GetGenerateMiniDebugInfo() const {
+    return generate_mini_debug_info_;
+  }
+
   bool GetImplicitNullChecks() const {
     return implicit_null_checks_;
   }
@@ -266,6 +277,7 @@
   bool debuggable_;
   bool native_debuggable_;
   bool generate_debug_info_;
+  bool generate_mini_debug_info_;
   bool implicit_null_checks_;
   bool implicit_so_checks_;
   bool implicit_suspend_checks_;