Author: baldrick
Date: Mon Aug 30 04:42:39 2010
New Revision: 112468

URL: http://llvm.org/viewvc/llvm-project?rev=112468&view=rev
Log:
Straighten out target triples provided on the command line
before using them.

Modified:
    cfe/trunk/lib/Frontend/CompilerInvocation.cpp
    cfe/trunk/tools/driver/cc1as_main.cpp

Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=112468&r1=112467&r2=112468&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Mon Aug 30 04:42:39 2010
@@ -23,6 +23,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/ADT/StringSwitch.h"
+#include "llvm/ADT/Triple.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/System/Host.h"
 #include "llvm/System/Path.h"
@@ -1472,7 +1473,7 @@
   Opts.CPU = Args.getLastArgValue(OPT_target_cpu);
   Opts.Features = Args.getAllArgValues(OPT_target_feature);
   Opts.LinkerVersion = Args.getLastArgValue(OPT_target_linker_version);
-  Opts.Triple = Args.getLastArgValue(OPT_triple);
+  Opts.Triple = llvm::Triple::normalize(Args.getLastArgValue(OPT_triple));
 
   // Use the host triple if unspecified.
   if (Opts.Triple.empty())

Modified: cfe/trunk/tools/driver/cc1as_main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/cc1as_main.cpp?rev=112468&r1=112467&r2=112468&view=diff
==============================================================================
--- cfe/trunk/tools/driver/cc1as_main.cpp (original)
+++ cfe/trunk/tools/driver/cc1as_main.cpp Mon Aug 30 04:42:39 2010
@@ -24,6 +24,7 @@
 #include "clang/Frontend/TextDiagnosticPrinter.h"
 #include "llvm/ADT/OwningPtr.h"
 #include "llvm/ADT/StringSwitch.h"
+#include "llvm/ADT/Triple.h"
 #include "llvm/MC/MCParser/MCAsmParser.h"
 #include "llvm/MC/MCAsmInfo.h"
 #include "llvm/MC/MCCodeEmitter.h"
@@ -142,7 +143,7 @@
   // Construct the invocation.
 
   // Target Options
-  Opts.Triple = Args->getLastArgValue(OPT_triple);
+  Opts.Triple = Triple::normalize(Args->getLastArgValue(OPT_triple));
   if (Opts.Triple.empty()) // Use the host triple if unspecified.
     Opts.Triple = sys::getHostTriple();
 


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to