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 | 76766cb880b4f1c35f8530437b83a6d66b21baf6 (patch) | |
| tree | 72d1575f97d78dea534486ce0a8e6e3c24ffbe40 /llvm | |
| parent | e568b88c98e22a40bfe4eb378ffbf1132a73b14c (diff) | |
| download | bcm5719-llvm-76766cb880b4f1c35f8530437b83a6d66b21baf6.tar.gz bcm5719-llvm-76766cb880b4f1c35f8530437b83a6d66b21baf6.zip | |
provide an option to override the target triple in a module from the commandline.
llvm-svn: 24730
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/tools/lli/lli.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp index c1b7478a376..b0f3ff5211e 100644 --- a/llvm/tools/lli/lli.cpp +++ b/llvm/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?"); |

