From f33b8663bdd9056660c9e520f20d9a562cbcff0b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 16 Dec 2005 04:59:57 +0000 Subject: [PATCH] provide an option to override the target triple in a module from the command line. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24729 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llc/llc.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp index e71a7b985db..1b6c71080af 100644 --- a/tools/llc/llc.cpp +++ b/tools/llc/llc.cpp @@ -48,6 +48,8 @@ static cl::opt Force("f", cl::desc("Overwrite output files")); static cl::opt Fast("fast", cl::desc("Generate code quickly, potentially sacrificing code quality")); +static cl::opt +TargetTriple("triple", cl::desc("Override target triple for module")); static cl::opt MArch("march", cl::desc("Architecture to generate code for:")); @@ -116,6 +118,10 @@ int main(int argc, char **argv) { } Module &mod = *M.get(); + // If we are supposed to override the target triple, do so now. + if (!TargetTriple.empty()) + mod.setTargetTriple(TargetTriple); + // Allocate target machine. First, check whether the user has // explicitly specified an architecture to compile for. TargetMachine* (*TargetMachineAllocator)(const Module&,