components/llvm/patches/017-lli-21870067.patch
changeset 6512 92717ce71105
parent 6511 d283aa33e131
child 6513 ea2097ba7d67
equal deleted inserted replaced
6511:d283aa33e131 6512:92717ce71105
     1 # 21870067 lli makes incorrect assumptions about anonymous namespace instantiation order
       
     2 # 21870087 naming convention for the InputFile key is inconsistent across LLVM utilities
       
     3 # For upstream - maybe.
       
     4 --- tools/lli/lli.cpp	2014-12-02 16:51:19.000000000 -0800
       
     5 +++ tools/lli/lli.cpp	2015-09-20 10:37:39.445573121 -0700
       
     6 @@ -63,21 +63,22 @@
       
     7  
       
     8  #define DEBUG_TYPE "lli"
       
     9  
       
    10 -namespace {
       
    11 -  cl::opt<std::string>
       
    12 +static cl::opt<std::string>
       
    13    InputFile(cl::desc("<input bitcode>"), cl::Positional, cl::init("-"));
       
    14  
       
    15 -  cl::list<std::string>
       
    16 +static cl::list<std::string>
       
    17    InputArgv(cl::ConsumeAfter, cl::desc("<program arguments>..."));
       
    18  
       
    19 -  cl::opt<bool> ForceInterpreter("force-interpreter",
       
    20 +static cl::opt<bool>
       
    21 +ForceInterpreter("force-interpreter",
       
    22                                   cl::desc("Force interpretation: disable JIT"),
       
    23                                   cl::init(false));
       
    24  
       
    25    // The MCJIT supports building for a target address space separate from
       
    26    // the JIT compilation process. Use a forked process and a copying
       
    27    // memory manager with IPC to execute using this functionality.
       
    28 -  cl::opt<bool> RemoteMCJIT("remote-mcjit",
       
    29 +static cl::opt<bool>
       
    30 +RemoteMCJIT("remote-mcjit",
       
    31      cl::desc("Execute MCJIT'ed code in a separate process."),
       
    32      cl::init(false));
       
    33  
       
    34 @@ -85,7 +86,7 @@
       
    35    // the simulated remote execution that allocates address space for child
       
    36    // execution. The child process will be executed and will communicate with
       
    37    // lli via stdin/stdout pipes.
       
    38 -  cl::opt<std::string>
       
    39 +static cl::opt<std::string>
       
    40    ChildExecPath("mcjit-remote-process",
       
    41                  cl::desc("Specify the filename of the process to launch "
       
    42                           "for remote MCJIT execution.  If none is specified,"
       
    43 @@ -93,7 +94,7 @@
       
    44                  cl::value_desc("filename"), cl::init(""));
       
    45  
       
    46    // Determine optimization level.
       
    47 -  cl::opt<char>
       
    48 +static cl::opt<char>
       
    49    OptLevel("O",
       
    50             cl::desc("Optimization level. [-O0, -O1, -O2, or -O3] "
       
    51                      "(default = '-O2')"),
       
    52 @@ -101,73 +102,73 @@
       
    53             cl::ZeroOrMore,
       
    54             cl::init(' '));
       
    55  
       
    56 -  cl::opt<std::string>
       
    57 +static cl::opt<std::string>
       
    58    TargetTriple("mtriple", cl::desc("Override target triple for module"));
       
    59  
       
    60 -  cl::opt<std::string>
       
    61 +static cl::opt<std::string>
       
    62    MArch("march",
       
    63          cl::desc("Architecture to generate assembly for (see --version)"));
       
    64  
       
    65 -  cl::opt<std::string>
       
    66 +static cl::opt<std::string>
       
    67    MCPU("mcpu",
       
    68         cl::desc("Target a specific cpu type (-mcpu=help for details)"),
       
    69         cl::value_desc("cpu-name"),
       
    70         cl::init(""));
       
    71  
       
    72 -  cl::list<std::string>
       
    73 +static cl::list<std::string>
       
    74    MAttrs("mattr",
       
    75           cl::CommaSeparated,
       
    76           cl::desc("Target specific attributes (-mattr=help for details)"),
       
    77           cl::value_desc("a1,+a2,-a3,..."));
       
    78  
       
    79 -  cl::opt<std::string>
       
    80 +static cl::opt<std::string>
       
    81    EntryFunc("entry-function",
       
    82              cl::desc("Specify the entry function (default = 'main') "
       
    83                       "of the executable"),
       
    84              cl::value_desc("function"),
       
    85              cl::init("main"));
       
    86  
       
    87 -  cl::list<std::string>
       
    88 +static cl::list<std::string>
       
    89    ExtraModules("extra-module",
       
    90           cl::desc("Extra modules to be loaded"),
       
    91           cl::value_desc("input bitcode"));
       
    92  
       
    93 -  cl::list<std::string>
       
    94 +static cl::list<std::string>
       
    95    ExtraObjects("extra-object",
       
    96           cl::desc("Extra object files to be loaded"),
       
    97           cl::value_desc("input object"));
       
    98  
       
    99 -  cl::list<std::string>
       
   100 +static cl::list<std::string>
       
   101    ExtraArchives("extra-archive",
       
   102           cl::desc("Extra archive files to be loaded"),
       
   103           cl::value_desc("input archive"));
       
   104  
       
   105 -  cl::opt<bool>
       
   106 +static cl::opt<bool>
       
   107    EnableCacheManager("enable-cache-manager",
       
   108          cl::desc("Use cache manager to save/load mdoules"),
       
   109          cl::init(false));
       
   110  
       
   111 -  cl::opt<std::string>
       
   112 +static cl::opt<std::string>
       
   113    ObjectCacheDir("object-cache-dir",
       
   114                    cl::desc("Directory to store cached object files "
       
   115                             "(must be user writable)"),
       
   116                    cl::init(""));
       
   117  
       
   118 -  cl::opt<std::string>
       
   119 +static cl::opt<std::string>
       
   120    FakeArgv0("fake-argv0",
       
   121              cl::desc("Override the 'argv[0]' value passed into the executing"
       
   122                       " program"), cl::value_desc("executable"));
       
   123  
       
   124 -  cl::opt<bool>
       
   125 +static cl::opt<bool>
       
   126    DisableCoreFiles("disable-core-files", cl::Hidden,
       
   127                     cl::desc("Disable emission of core files if possible"));
       
   128  
       
   129 -  cl::opt<bool>
       
   130 +static cl::opt<bool>
       
   131    NoLazyCompilation("disable-lazy-compilation",
       
   132                    cl::desc("Disable JIT lazy compilation"),
       
   133                    cl::init(false));
       
   134  
       
   135 -  cl::opt<Reloc::Model>
       
   136 +static cl::opt<Reloc::Model>
       
   137    RelocModel("relocation-model",
       
   138               cl::desc("Choose relocation model"),
       
   139               cl::init(Reloc::Default),
       
   140 @@ -182,7 +183,7 @@
       
   141                         "Relocatable external references, non-relocatable code"),
       
   142              clEnumValEnd));
       
   143  
       
   144 -  cl::opt<llvm::CodeModel::Model>
       
   145 +static cl::opt<llvm::CodeModel::Model>
       
   146    CMModel("code-model",
       
   147            cl::desc("Choose code model"),
       
   148            cl::init(CodeModel::JITDefault),
       
   149 @@ -198,12 +199,12 @@
       
   150                                  "Large code model"),
       
   151                       clEnumValEnd));
       
   152  
       
   153 -  cl::opt<bool>
       
   154 +static cl::opt<bool>
       
   155    GenerateSoftFloatCalls("soft-float",
       
   156      cl::desc("Generate software floating point library calls"),
       
   157      cl::init(false));
       
   158  
       
   159 -  cl::opt<llvm::FloatABI::ABIType>
       
   160 +static cl::opt<llvm::FloatABI::ABIType>
       
   161    FloatABIForCalls("float-abi",
       
   162                     cl::desc("Choose float ABI type"),
       
   163                     cl::init(FloatABI::Default),
       
   164 @@ -215,7 +216,7 @@
       
   165                       clEnumValN(FloatABI::Hard, "hard",
       
   166                                  "Hard float ABI (uses FP registers)"),
       
   167                       clEnumValEnd));
       
   168 -  cl::opt<bool>
       
   169 +static cl::opt<bool>
       
   170  // In debug builds, make this default to true.
       
   171  #ifdef NDEBUG
       
   172  #define EMIT_DEBUG false
       
   173 @@ -232,7 +233,6 @@
       
   174      cl::Hidden,
       
   175      cl::desc("Emit debug info objfiles to disk"),
       
   176      cl::init(false));
       
   177 -}
       
   178  
       
   179  //===----------------------------------------------------------------------===//
       
   180  // Object cache
       
   181 --- tools/lli/lli.cpp	2015-10-05 11:01:32.000000000 -0700
       
   182 +++ tools/lli/lli.cpp	2016-01-26 14:44:39.000000000 -0800
       
   183 @@ -64,7 +64,8 @@
       
   184  #define DEBUG_TYPE "lli"
       
   185  
       
   186  static cl::opt<std::string>
       
   187 -  InputFile(cl::desc("<input bitcode>"), cl::Positional, cl::init("-"));
       
   188 +  InputFile(cl::desc("<input bitcode>"), cl::Positional,
       
   189 +            cl::init(std::string("-")));
       
   190  
       
   191  static cl::list<std::string>
       
   192    InputArgv(cl::ConsumeAfter, cl::desc("<program arguments>..."));
       
   193 @@ -91,7 +92,8 @@
       
   194                  cl::desc("Specify the filename of the process to launch "
       
   195                           "for remote MCJIT execution.  If none is specified,"
       
   196                           "\n\tremote execution will be simulated in-process."),
       
   197 -                cl::value_desc("filename"), cl::init(""));
       
   198 +                cl::value_desc("filename"),
       
   199 +                cl::init(std::string("")));
       
   200  
       
   201    // Determine optimization level.
       
   202  static cl::opt<char>
       
   203 @@ -113,7 +115,7 @@
       
   204    MCPU("mcpu",
       
   205         cl::desc("Target a specific cpu type (-mcpu=help for details)"),
       
   206         cl::value_desc("cpu-name"),
       
   207 -       cl::init(""));
       
   208 +       cl::init(std::string("")));
       
   209  
       
   210  static cl::list<std::string>
       
   211    MAttrs("mattr",
       
   212 @@ -126,7 +128,7 @@
       
   213              cl::desc("Specify the entry function (default = 'main') "
       
   214                       "of the executable"),
       
   215              cl::value_desc("function"),
       
   216 -            cl::init("main"));
       
   217 +            cl::init(std::string("main")));
       
   218  
       
   219  static cl::list<std::string>
       
   220    ExtraModules("extra-module",
       
   221 @@ -152,7 +154,7 @@
       
   222    ObjectCacheDir("object-cache-dir",
       
   223                    cl::desc("Directory to store cached object files "
       
   224                             "(must be user writable)"),
       
   225 -                  cl::init(""));
       
   226 +                  cl::init(std::string("")));
       
   227  
       
   228  static cl::opt<std::string>
       
   229    FakeArgv0("fake-argv0",