diff options
author | Chris Lattner <sabre@nondot.org> | 2005-12-16 05:00:21 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-12-16 05:00:21 +0000 |
commit | 3015e6061c67ef30e85df83f320f3dcf9c9f023b (patch) | |
tree | 2e30783666a21abfe88b466ae8314d43274eb1e2 /tools/lli/lli.cpp | |
parent | f33b8663bdd9056660c9e520f20d9a562cbcff0b (diff) | |
download | external_llvm-3015e6061c67ef30e85df83f320f3dcf9c9f023b.zip external_llvm-3015e6061c67ef30e85df83f320f3dcf9c9f023b.tar.gz external_llvm-3015e6061c67ef30e85df83f320f3dcf9c9f023b.tar.bz2 |
provide an option to override the target triple in a module from the commandline.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24730 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/lli/lli.cpp')
-rw-r--r-- | tools/lli/lli.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp index c1b7478..b0f3ff5 100644 --- a/tools/lli/lli.cpp +++ b/tools/lli/lli.cpp @@ -36,7 +36,9 @@ namespace { cl::opt<bool> ForceInterpreter("force-interpreter", cl::desc("Force interpretation: disable JIT"), cl::init(false)); - + cl::opt<std::string> + TargetTriple("triple", cl::desc("Override target triple for module")); + cl::opt<std::string> FakeArgv0("fake-argv0", cl::desc("Override the 'argv[0]' value passed into the executing" @@ -62,6 +64,10 @@ int main(int argc, char **argv, char * const *envp) { exit(1); } + // If we are supposed to override the target triple, do so now. + if (!TargetTriple.empty()) + MP->getModule()->setTargetTriple(TargetTriple); + ExecutionEngine *EE = ExecutionEngine::create(MP, ForceInterpreter); assert(EE && "Couldn't create an ExecutionEngine, not even an interpreter?"); |