[ASan] Use common flags parsing machinery.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159933 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/asan/asan_internal.h b/lib/asan/asan_internal.h
index 2e6f5a1..2ee1b12 100644
--- a/lib/asan/asan_internal.h
+++ b/lib/asan/asan_internal.h
@@ -136,30 +136,34 @@
 # define PLATFORM_HAS_DIFFERENT_MEMCPY_AND_MEMMOVE true
 #endif  // __APPLE__
 
-extern uptr  FLAG_quarantine_size;
-extern s64 FLAG_demangle;
-extern bool    FLAG_symbolize;
-extern s64 FLAG_v;
-extern uptr  FLAG_redzone;
-extern s64 FLAG_debug;
-extern bool    FLAG_poison_shadow;
-extern s64 FLAG_report_globals;
-extern uptr  FLAG_malloc_context_size;
-extern bool    FLAG_replace_str;
-extern bool    FLAG_replace_intrin;
-extern bool    FLAG_replace_cfallocator;
-extern bool    FLAG_mac_ignore_invalid_free;
-extern bool    FLAG_fast_unwind;
-extern bool    FLAG_use_fake_stack;
-extern uptr  FLAG_max_malloc_fill_size;
-extern s64 FLAG_exitcode;
-extern bool    FLAG_allow_user_poisoning;
-extern s64 FLAG_sleep_before_dying;
-extern bool    FLAG_handle_segv;
-extern bool    FLAG_use_sigaltstack;
-extern bool    FLAG_check_malloc_usable_size;
-extern bool    FLAG_unmap_shadow_on_exit;
-extern bool    FLAG_abort_on_error;
+struct Flags {
+  int quarantine_size;
+  bool symbolize;
+  int  verbosity;
+  int redzone;
+  int  debug;
+  bool poison_shadow;
+  int  report_globals;
+  int malloc_context_size;
+  bool replace_str;
+  bool replace_intrin;
+  bool replace_cfallocator;
+  bool mac_ignore_invalid_free;
+  bool use_fake_stack;
+  int max_malloc_fill_size;
+  int  exitcode;
+  bool allow_user_poisoning;
+  int  sleep_before_dying;
+  bool handle_segv;
+  bool use_sigaltstack;
+  bool check_malloc_usable_size;
+  bool unmap_shadow_on_exit;
+  bool abort_on_error;
+  bool atexit;
+  bool disable_core;
+};
+Flags *flags();
+void InitializeFlags(Flags *f, const char *env);
 
 extern int asan_inited;
 // Used to avoid infinite recursion in __asan_init().