diff options
author | Jeffrey Yasskin <jyasskin@google.com> | 2010-02-05 16:19:36 +0000 |
---|---|---|
committer | Jeffrey Yasskin <jyasskin@google.com> | 2010-02-05 16:19:36 +0000 |
commit | 4688261c20735f5ead2f08695acdeb727db31894 (patch) | |
tree | 529fc7c22add469aea913e96dca1913bc8406ded /lib/ExecutionEngine/JIT/TargetSelect.cpp | |
parent | 63d58ebd09b8fe0b136fa87fac09d72cd4968926 (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 'lib/ExecutionEngine/JIT/TargetSelect.cpp')
-rw-r--r-- | lib/ExecutionEngine/JIT/TargetSelect.cpp | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/lib/ExecutionEngine/JIT/TargetSelect.cpp b/lib/ExecutionEngine/JIT/TargetSelect.cpp index b462ee7369..3349c33805 100644 --- a/lib/ExecutionEngine/JIT/TargetSelect.cpp +++ b/lib/ExecutionEngine/JIT/TargetSelect.cpp @@ -24,25 +24,13 @@ #include "llvm/Target/TargetRegistry.h" using namespace llvm; -static cl::opt<std::string> -MArch("march", - cl::desc("Architecture to generate assembly for (see --version)")); - -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("")); - -static cl::list<std::string> -MAttrs("mattr", - cl::CommaSeparated, - cl::desc("Target specific attributes (-mattr=help for details)"), - cl::value_desc("a1,+a2,-a3,...")); - /// selectTarget - Pick a target either via -march or by guessing the native /// arch. Add any CPU features specified via -mcpu or -mattr. -TargetMachine *JIT::selectTarget(Module *Mod, std::string *ErrorStr) { +TargetMachine *JIT::selectTarget(Module *Mod, + StringRef MArch, + StringRef MCPU, + const SmallVectorImpl<std::string>& MAttrs, + std::string *ErrorStr) { Triple TheTriple(Mod->getTargetTriple()); if (TheTriple.getTriple().empty()) TheTriple.setTriple(sys::getHostTriple()); |