From 75ebbceeeda1e7a78efe1848bb90e034f0c6ba61 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Sat, 28 Aug 2010 01:30:02 +0000 Subject: [PATCH] Straighten out any triple strings passed on the command line before they hit the rest of the system. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112344 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/bugpoint/bugpoint.cpp | 4 ++-- tools/llc/llc.cpp | 2 +- tools/lli/lli.cpp | 3 ++- tools/llvm-mc/llvm-mc.cpp | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/bugpoint/bugpoint.cpp b/tools/bugpoint/bugpoint.cpp index 025beec0bd8..79cf563ec6f 100644 --- a/tools/bugpoint/bugpoint.cpp +++ b/tools/bugpoint/bugpoint.cpp @@ -104,8 +104,8 @@ int main(int argc, char **argv) { // If we have an override, set it and then track the triple we want Modules // to use. if (!OverrideTriple.empty()) { - TargetTriple.setTriple(OverrideTriple); - outs() << "Override triple set to '" << OverrideTriple << "'\n"; + TargetTriple.setTriple(Triple::normalize(OverrideTriple)); + outs() << "Override triple set to '" << TargetTriple.getTriple() << "'\n"; } if (MemoryLimit < 0) { diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp index 208d9f75ef6..2ca502ec417 100644 --- a/tools/llc/llc.cpp +++ b/tools/llc/llc.cpp @@ -223,7 +223,7 @@ int main(int argc, char **argv) { // If we are supposed to override the target triple, do so now. if (!TargetTriple.empty()) - mod.setTargetTriple(TargetTriple); + mod.setTargetTriple(Triple::normalize(TargetTriple)); Triple TheTriple(mod.getTargetTriple()); if (TheTriple.getTriple().empty()) diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp index 4e3e07ffd22..4c377805e6a 100644 --- a/tools/lli/lli.cpp +++ b/tools/lli/lli.cpp @@ -16,6 +16,7 @@ #include "llvm/LLVMContext.h" #include "llvm/Module.h" #include "llvm/Type.h" +#include "llvm/ADT/Triple.h" #include "llvm/Bitcode/ReaderWriter.h" #include "llvm/CodeGen/LinkAllCodegenComponents.h" #include "llvm/ExecutionEngine/GenericValue.h" @@ -157,7 +158,7 @@ int main(int argc, char **argv, char * const *envp) { // If we are supposed to override the target triple, do so now. if (!TargetTriple.empty()) - Mod->setTargetTriple(TargetTriple); + Mod->setTargetTriple(Triple::normalize(TargetTriple)); CodeGenOpt::Level OLvl = CodeGenOpt::Default; switch (OptLevel) { diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp index 77d5a315182..0cc9689e7c9 100644 --- a/tools/llvm-mc/llvm-mc.cpp +++ b/tools/llvm-mc/llvm-mc.cpp @@ -390,6 +390,7 @@ int main(int argc, char **argv) { llvm::InitializeAllDisassemblers(); cl::ParseCommandLineOptions(argc, argv, "llvm machine code playground\n"); + TripleName = Triple::normalize(TripleName); switch (Action) { default: