components/llvm/patches/017-lli-21870067.patch
changeset 5434 9f55c805ce9d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/llvm/patches/017-lli-21870067.patch	Wed Feb 10 11:54:12 2016 -0800
@@ -0,0 +1,229 @@
+# 21870067 lli makes incorrect assumptions about anonymous namespace instantiation order
+# 21870087 naming convention for the InputFile key is inconsistent across LLVM utilities
+# For upstream - maybe.
+--- tools/lli/lli.cpp	2014-12-02 16:51:19.000000000 -0800
++++ tools/lli/lli.cpp	2015-09-20 10:37:39.445573121 -0700
+@@ -63,21 +63,22 @@
+ 
+ #define DEBUG_TYPE "lli"
+ 
+-namespace {
+-  cl::opt<std::string>
++static cl::opt<std::string>
+   InputFile(cl::desc("<input bitcode>"), cl::Positional, cl::init("-"));
+ 
+-  cl::list<std::string>
++static cl::list<std::string>
+   InputArgv(cl::ConsumeAfter, cl::desc("<program arguments>..."));
+ 
+-  cl::opt<bool> ForceInterpreter("force-interpreter",
++static cl::opt<bool>
++ForceInterpreter("force-interpreter",
+                                  cl::desc("Force interpretation: disable JIT"),
+                                  cl::init(false));
+ 
+   // The MCJIT supports building for a target address space separate from
+   // the JIT compilation process. Use a forked process and a copying
+   // memory manager with IPC to execute using this functionality.
+-  cl::opt<bool> RemoteMCJIT("remote-mcjit",
++static cl::opt<bool>
++RemoteMCJIT("remote-mcjit",
+     cl::desc("Execute MCJIT'ed code in a separate process."),
+     cl::init(false));
+ 
+@@ -85,7 +86,7 @@
+   // the simulated remote execution that allocates address space for child
+   // execution. The child process will be executed and will communicate with
+   // lli via stdin/stdout pipes.
+-  cl::opt<std::string>
++static cl::opt<std::string>
+   ChildExecPath("mcjit-remote-process",
+                 cl::desc("Specify the filename of the process to launch "
+                          "for remote MCJIT execution.  If none is specified,"
+@@ -93,7 +94,7 @@
+                 cl::value_desc("filename"), cl::init(""));
+ 
+   // Determine optimization level.
+-  cl::opt<char>
++static cl::opt<char>
+   OptLevel("O",
+            cl::desc("Optimization level. [-O0, -O1, -O2, or -O3] "
+                     "(default = '-O2')"),
+@@ -101,73 +102,73 @@
+            cl::ZeroOrMore,
+            cl::init(' '));
+ 
+-  cl::opt<std::string>
++static cl::opt<std::string>
+   TargetTriple("mtriple", cl::desc("Override target triple for module"));
+ 
+-  cl::opt<std::string>
++static cl::opt<std::string>
+   MArch("march",
+         cl::desc("Architecture to generate assembly for (see --version)"));
+ 
+-  cl::opt<std::string>
++static cl::opt<std::string>
+   MCPU("mcpu",
+        cl::desc("Target a specific cpu type (-mcpu=help for details)"),
+        cl::value_desc("cpu-name"),
+        cl::init(""));
+ 
+-  cl::list<std::string>
++static cl::list<std::string>
+   MAttrs("mattr",
+          cl::CommaSeparated,
+          cl::desc("Target specific attributes (-mattr=help for details)"),
+          cl::value_desc("a1,+a2,-a3,..."));
+ 
+-  cl::opt<std::string>
++static cl::opt<std::string>
+   EntryFunc("entry-function",
+             cl::desc("Specify the entry function (default = 'main') "
+                      "of the executable"),
+             cl::value_desc("function"),
+             cl::init("main"));
+ 
+-  cl::list<std::string>
++static cl::list<std::string>
+   ExtraModules("extra-module",
+          cl::desc("Extra modules to be loaded"),
+          cl::value_desc("input bitcode"));
+ 
+-  cl::list<std::string>
++static cl::list<std::string>
+   ExtraObjects("extra-object",
+          cl::desc("Extra object files to be loaded"),
+          cl::value_desc("input object"));
+ 
+-  cl::list<std::string>
++static cl::list<std::string>
+   ExtraArchives("extra-archive",
+          cl::desc("Extra archive files to be loaded"),
+          cl::value_desc("input archive"));
+ 
+-  cl::opt<bool>
++static cl::opt<bool>
+   EnableCacheManager("enable-cache-manager",
+         cl::desc("Use cache manager to save/load mdoules"),
+         cl::init(false));
+ 
+-  cl::opt<std::string>
++static cl::opt<std::string>
+   ObjectCacheDir("object-cache-dir",
+                   cl::desc("Directory to store cached object files "
+                            "(must be user writable)"),
+                   cl::init(""));
+ 
+-  cl::opt<std::string>
++static cl::opt<std::string>
+   FakeArgv0("fake-argv0",
+             cl::desc("Override the 'argv[0]' value passed into the executing"
+                      " program"), cl::value_desc("executable"));
+ 
+-  cl::opt<bool>
++static cl::opt<bool>
+   DisableCoreFiles("disable-core-files", cl::Hidden,
+                    cl::desc("Disable emission of core files if possible"));
+ 
+-  cl::opt<bool>
++static cl::opt<bool>
+   NoLazyCompilation("disable-lazy-compilation",
+                   cl::desc("Disable JIT lazy compilation"),
+                   cl::init(false));
+ 
+-  cl::opt<Reloc::Model>
++static cl::opt<Reloc::Model>
+   RelocModel("relocation-model",
+              cl::desc("Choose relocation model"),
+              cl::init(Reloc::Default),
+@@ -182,7 +183,7 @@
+                        "Relocatable external references, non-relocatable code"),
+             clEnumValEnd));
+ 
+-  cl::opt<llvm::CodeModel::Model>
++static cl::opt<llvm::CodeModel::Model>
+   CMModel("code-model",
+           cl::desc("Choose code model"),
+           cl::init(CodeModel::JITDefault),
+@@ -198,12 +199,12 @@
+                                 "Large code model"),
+                      clEnumValEnd));
+ 
+-  cl::opt<bool>
++static cl::opt<bool>
+   GenerateSoftFloatCalls("soft-float",
+     cl::desc("Generate software floating point library calls"),
+     cl::init(false));
+ 
+-  cl::opt<llvm::FloatABI::ABIType>
++static cl::opt<llvm::FloatABI::ABIType>
+   FloatABIForCalls("float-abi",
+                    cl::desc("Choose float ABI type"),
+                    cl::init(FloatABI::Default),
+@@ -215,7 +216,7 @@
+                      clEnumValN(FloatABI::Hard, "hard",
+                                 "Hard float ABI (uses FP registers)"),
+                      clEnumValEnd));
+-  cl::opt<bool>
++static cl::opt<bool>
+ // In debug builds, make this default to true.
+ #ifdef NDEBUG
+ #define EMIT_DEBUG false
+@@ -232,7 +233,6 @@
+     cl::Hidden,
+     cl::desc("Emit debug info objfiles to disk"),
+     cl::init(false));
+-}
+ 
+ //===----------------------------------------------------------------------===//
+ // Object cache
+--- tools/lli/lli.cpp	2015-10-05 11:01:32.000000000 -0700
++++ tools/lli/lli.cpp	2016-01-26 14:44:39.000000000 -0800
+@@ -64,7 +64,8 @@
+ #define DEBUG_TYPE "lli"
+ 
+ static cl::opt<std::string>
+-  InputFile(cl::desc("<input bitcode>"), cl::Positional, cl::init("-"));
++  InputFile(cl::desc("<input bitcode>"), cl::Positional,
++            cl::init(std::string("-")));
+ 
+ static cl::list<std::string>
+   InputArgv(cl::ConsumeAfter, cl::desc("<program arguments>..."));
+@@ -91,7 +92,8 @@
+                 cl::desc("Specify the filename of the process to launch "
+                          "for remote MCJIT execution.  If none is specified,"
+                          "\n\tremote execution will be simulated in-process."),
+-                cl::value_desc("filename"), cl::init(""));
++                cl::value_desc("filename"),
++                cl::init(std::string("")));
+ 
+   // Determine optimization level.
+ static cl::opt<char>
+@@ -113,7 +115,7 @@
+   MCPU("mcpu",
+        cl::desc("Target a specific cpu type (-mcpu=help for details)"),
+        cl::value_desc("cpu-name"),
+-       cl::init(""));
++       cl::init(std::string("")));
+ 
+ static cl::list<std::string>
+   MAttrs("mattr",
+@@ -126,7 +128,7 @@
+             cl::desc("Specify the entry function (default = 'main') "
+                      "of the executable"),
+             cl::value_desc("function"),
+-            cl::init("main"));
++            cl::init(std::string("main")));
+ 
+ static cl::list<std::string>
+   ExtraModules("extra-module",
+@@ -152,7 +154,7 @@
+   ObjectCacheDir("object-cache-dir",
+                   cl::desc("Directory to store cached object files "
+                            "(must be user writable)"),
+-                  cl::init(""));
++                  cl::init(std::string("")));
+ 
+ static cl::opt<std::string>
+   FakeArgv0("fake-argv0",