Merge constant array and structures. This will create a global variables for arrays and structs that are constant and their initializer is constant. It is on by default but can be disable with the flag -fno-merge-all-constants.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85991 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 521c90d..b4c27a2 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -703,6 +703,9 @@
     CmdArgs.push_back("--debug-pass=Structure");
   if (Args.hasArg(options::OPT_fdebug_pass_arguments))
     CmdArgs.push_back("--debug-pass=Arguments");
+  if (!Args.hasFlag(options::OPT_fmerge_all_constants,
+                    options::OPT_fno_merge_all_constants))
+    CmdArgs.push_back("--no-merge-all-constants");
 
   // This is a coarse approximation of what llvm-gcc actually does, both
   // -fasynchronous-unwind-tables and -fnon-call-exceptions interact in more