Add a flag for pattern initialization

Add the flag so we can turn on pattern initialization from
https://reviews.llvm.org/D54604 in the future.

Bug: 966551
Change-Id: I631bd71f5e1da553ec7a9e480537adc8573d1047
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1835027
Commit-Queue: Jian Cai <jiancai@google.com>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721174}
diff --git a/build/config/chromeos/BUILD.gn b/build/config/chromeos/BUILD.gn
index 1e9f783..ecadcf6 100644
--- a/build/config/chromeos/BUILD.gn
+++ b/build/config/chromeos/BUILD.gn
@@ -11,6 +11,9 @@
   # https://research.fb.com/wp-content/uploads/2017/01/cgo2017-hfsort-final1.pdf?
   # to a file, used for generating orderfiles in Chrome OS
   dump_call_chain_clustering_order = ""
+
+  # Enable pattern initialization. Disabled by default. http://crbug.com/966551
+  enable_pattern_initialization = false
 }
 
 declare_args() {
@@ -31,4 +34,8 @@
     cflags = [ "-fexperimental-new-pass-manager" ]
     ldflags = [ "-fexperimental-new-pass-manager" ]
   }
+
+  if (enable_pattern_initialization) {
+    cflags = [ "-ftrivial-auto-var-init=pattern" ]
+  }
 }