aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJeffrey Yasskin <jyasskin@google.com>2010-02-05 16:19:36 +0000
committerJeffrey Yasskin <jyasskin@google.com>2010-02-05 16:19:36 +0000
commit4688261c20735f5ead2f08695acdeb727db31894 (patch)
tree529fc7c22add469aea913e96dca1913bc8406ded /tools
parent63d58ebd09b8fe0b136fa87fac09d72cd4968926 (diff)
Move --march, --mcpu, and --mattr from JIT/TargetSelect.cpp to lli.cpp.
llc.cpp also defined these flags, meaning that when I linked all of LLVM's libraries into a single shared library, llc crashed on startup with duplicate flag definitions. This patch passes them through the EngineBuilder into JIT::selectTarget(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95390 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/lli/lli.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp
index a515394228..81c17cd8fc 100644
--- a/tools/lli/lli.cpp
+++ b/tools/lli/lli.cpp
@@ -58,6 +58,22 @@ 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"),
@@ -131,6 +147,9 @@ int main(int argc, char **argv, char * const *envp) {
}
EngineBuilder builder(Mod);
+ builder.setMArch(MArch);
+ builder.setMCPU(MCPU);
+ builder.setMAttrs(MAttrs);
builder.setErrorStr(&ErrorMsg);
builder.setEngineKind(ForceInterpreter
? EngineKind::Interpreter