diff options
author | Joe Groff <arcata@gmail.com> | 2012-04-17 23:05:48 +0000 |
---|---|---|
committer | Joe Groff <arcata@gmail.com> | 2012-04-17 23:05:48 +0000 |
commit | 1b73869a9beb8998a0b32ce0861efd85b5548fd6 (patch) | |
tree | a4fdb274aec240ec15f5bcf98cb11294fede7040 | |
parent | d9804fbd01476c465fcec8d3b2c1b70dd1caa434 (diff) | |
download | bcm5719-llvm-1b73869a9beb8998a0b32ce0861efd85b5548fd6.tar.gz bcm5719-llvm-1b73869a9beb8998a0b32ce0861efd85b5548fd6.zip |
allow opt to take a -mtriple option
llvm-svn: 154959
-rw-r--r-- | llvm/tools/opt/opt.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp index 30da863b411..a5b0511fd98 100644 --- a/llvm/tools/opt/opt.cpp +++ b/llvm/tools/opt/opt.cpp @@ -114,6 +114,9 @@ static cl::opt<bool> OptLevelO3("O3", cl::desc("Optimization level 3. Similar to llvm-gcc -O3")); +static cl::opt<std::string> +TargetTriple("mtriple", cl::desc("Override target triple for module")); + static cl::opt<bool> UnitAtATime("funit-at-a-time", cl::desc("Enable IPO. This is same as llvm-gcc's -funit-at-a-time"), @@ -512,6 +515,10 @@ int main(int argc, char **argv) { return 1; } + // If we are supposed to override the target triple, do so now. + if (!TargetTriple.empty()) + M->setTargetTriple(Triple::normalize(TargetTriple)); + // Figure out what stream we are supposed to write to... OwningPtr<tool_output_file> Out; if (NoOutput) { |