summaryrefslogtreecommitdiff
path: root/tools/llc
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-12-16 04:59:57 +0000
committerChris Lattner <sabre@nondot.org>2005-12-16 04:59:57 +0000
commitf33b8663bdd9056660c9e520f20d9a562cbcff0b (patch)
treec55f984fd2bd243f31668719160ea2034b0686f2 /tools/llc
parenta637c32e381316da47285961111e1793c542cc15 (diff)
downloadllvm-f33b8663bdd9056660c9e520f20d9a562cbcff0b.tar.gz
llvm-f33b8663bdd9056660c9e520f20d9a562cbcff0b.tar.bz2
llvm-f33b8663bdd9056660c9e520f20d9a562cbcff0b.tar.xz
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
Diffstat (limited to 'tools/llc')
-rw-r--r--tools/llc/llc.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp
index e71a7b985d..1b6c71080a 100644
--- a/tools/llc/llc.cpp
+++ b/tools/llc/llc.cpp
@@ -48,6 +48,8 @@ static cl::opt<bool> Force("f", cl::desc("Overwrite output files"));
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 @@ 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&,