[llvm-commits] CVS: llvm/tools/llc/llc.cpp
Chris Lattner
lattner at cs.uiuc.edu
Thu Dec 15 21:00:09 PST 2005
Changes in directory llvm/tools/llc:
llc.cpp updated: 1.117 -> 1.118
---
Log message:
provide an option to override the target triple in a module from the command
line.
---
Diffs of the changes: (+6 -0)
llc.cpp | 6 ++++++
1 files changed, 6 insertions(+)
Index: llvm/tools/llc/llc.cpp
diff -u llvm/tools/llc/llc.cpp:1.117 llvm/tools/llc/llc.cpp:1.118
--- llvm/tools/llc/llc.cpp:1.117 Mon Nov 7 20:12:17 2005
+++ llvm/tools/llc/llc.cpp Thu Dec 15 22:59:57 2005
@@ -48,6 +48,8 @@
static cl::opt<bool> Fast("fast",
cl::desc("Generate code quickly, potentially sacrificing code quality"));
+static cl::opt<std::string>
+TargetTriple("triple", cl::desc("Override target triple for module"));
static cl::opt<const TargetMachineRegistry::Entry*, false, TargetNameParser>
MArch("march", cl::desc("Architecture to generate code for:"));
@@ -116,6 +118,10 @@
}
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&,
More information about the llvm-commits
mailing list