From ad407557f733dc313768776b073fecffa5c782be Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 16 Dec 2005 05:00:21 +0000 Subject: [PATCH] provide an option to override the target triple in a module from the commandline. llvm-svn: 24730 --- tools/lli/lli.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp index c1b7478a376..b0f3ff5211e 100644 --- a/tools/lli/lli.cpp +++ b/tools/lli/lli.cpp @@ -36,7 +36,9 @@ namespace { cl::opt ForceInterpreter("force-interpreter", cl::desc("Force interpretation: disable JIT"), cl::init(false)); - + cl::opt + TargetTriple("triple", cl::desc("Override target triple for module")); + cl::opt 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?");