diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2017-08-03 02:16:21 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2017-08-03 02:16:21 +0000 |
| commit | 79e238afee61b305d6391741cbda7d749ae9f626 (patch) | |
| tree | f42b972222324ef4f57687eef3cf1a143f8c2e5e /llvm/tools/lli/lli.cpp | |
| parent | 054d1aef4349f58d8d74bea658f95a839168bcce (diff) | |
| download | bcm5719-llvm-79e238afee61b305d6391741cbda7d749ae9f626.tar.gz bcm5719-llvm-79e238afee61b305d6391741cbda7d749ae9f626.zip | |
Delete Default and JITDefault code models
IMHO it is an antipattern to have a enum value that is Default.
At any given piece of code it is not clear if we have to handle
Default or if has already been mapped to a concrete value. In this
case in particular, only the target can do the mapping and it is nice
to make sure it is always done.
This deletes the two default enum values of CodeModel and uses an
explicit Optional<CodeModel> when it is possible that it is
unspecified.
llvm-svn: 309911
Diffstat (limited to 'llvm/tools/lli/lli.cpp')
| -rw-r--r-- | llvm/tools/lli/lli.cpp | 60 |
1 files changed, 5 insertions, 55 deletions
diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp index 091ca22b4e8..cce549d0a25 100644 --- a/llvm/tools/lli/lli.cpp +++ b/llvm/tools/lli/lli.cpp @@ -15,20 +15,21 @@ #include "OrcLazyJIT.h" #include "RemoteJITUtils.h" -#include "llvm/IR/LLVMContext.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/Triple.h" #include "llvm/Bitcode/BitcodeReader.h" +#include "llvm/CodeGen/CommandFlags.h" #include "llvm/CodeGen/LinkAllCodegenComponents.h" #include "llvm/ExecutionEngine/GenericValue.h" #include "llvm/ExecutionEngine/Interpreter.h" #include "llvm/ExecutionEngine/JITEventListener.h" #include "llvm/ExecutionEngine/MCJIT.h" #include "llvm/ExecutionEngine/ObjectCache.h" +#include "llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h" #include "llvm/ExecutionEngine/OrcMCJITReplacement.h" #include "llvm/ExecutionEngine/SectionMemoryManager.h" -#include "llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h" #include "llvm/IR/IRBuilder.h" +#include "llvm/IR/LLVMContext.h" #include "llvm/IR/Module.h" #include "llvm/IR/Type.h" #include "llvm/IR/TypeBuilder.h" @@ -124,22 +125,6 @@ namespace { TargetTriple("mtriple", cl::desc("Override target triple for module")); cl::opt<std::string> - MArch("march", - cl::desc("Architecture to generate assembly for (see --version)")); - - 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> - MAttrs("mattr", - cl::CommaSeparated, - cl::desc("Target specific attributes (-mattr=help for details)"), - cl::value_desc("a1,+a2,-a3,...")); - - cl::opt<std::string> EntryFunc("entry-function", cl::desc("Specify the entry function (default = 'main') " "of the executable"), @@ -186,47 +171,11 @@ namespace { cl::desc("Disable JIT lazy compilation"), cl::init(false)); - cl::opt<Reloc::Model> RelocModel( - "relocation-model", cl::desc("Choose relocation model"), - cl::values( - clEnumValN(Reloc::Static, "static", "Non-relocatable code"), - clEnumValN(Reloc::PIC_, "pic", - "Fully relocatable, position independent code"), - clEnumValN(Reloc::DynamicNoPIC, "dynamic-no-pic", - "Relocatable external references, non-relocatable code"))); - - cl::opt<llvm::CodeModel::Model> - CMModel("code-model", - cl::desc("Choose code model"), - cl::init(CodeModel::JITDefault), - cl::values(clEnumValN(CodeModel::JITDefault, "default", - "Target default JIT code model"), - clEnumValN(CodeModel::Small, "small", - "Small code model"), - clEnumValN(CodeModel::Kernel, "kernel", - "Kernel code model"), - clEnumValN(CodeModel::Medium, "medium", - "Medium code model"), - clEnumValN(CodeModel::Large, "large", - "Large code model"))); - cl::opt<bool> GenerateSoftFloatCalls("soft-float", cl::desc("Generate software floating point library calls"), cl::init(false)); - cl::opt<llvm::FloatABI::ABIType> - FloatABIForCalls("float-abi", - cl::desc("Choose float ABI type"), - cl::init(FloatABI::Default), - cl::values( - clEnumValN(FloatABI::Default, "default", - "Target default float ABI type"), - clEnumValN(FloatABI::Soft, "soft", - "Soft float ABI (implied by -soft-float)"), - clEnumValN(FloatABI::Hard, "hard", - "Hard float ABI (uses FP registers)"))); - ExitOnError ExitOnErr; } @@ -433,7 +382,8 @@ int main(int argc, char **argv, char * const *envp) { builder.setMAttrs(MAttrs); if (RelocModel.getNumOccurrences()) builder.setRelocationModel(RelocModel); - builder.setCodeModel(CMModel); + if (CMModel.getNumOccurrences()) + builder.setCodeModel(CMModel); builder.setErrorStr(&ErrorMsg); builder.setEngineKind(ForceInterpreter ? EngineKind::Interpreter |

