For target processing, on non-Darwin systems instead of using the host triple,
we default to "i386-apple-darwin".  This is an interim solution.

Removed processing of "linux" triples from Targets.cpp, since we don't have
any sensical Linux target support (yet).

Cleaned up error processing of targets; added better diagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44560 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/clang.cpp b/Driver/clang.cpp
index 139febe..0b04038 100644
--- a/Driver/clang.cpp
+++ b/Driver/clang.cpp
@@ -424,8 +424,14 @@
   
   // Initialize base triple.  If a -triple option has been specified, use
   // that triple.  Otherwise, default to the host triple.
-  if (TargetTriple.getValue().empty())
-    base_triple = LLVM_HOSTTRIPLE;
+  if (TargetTriple.getValue().empty()) {
+    // HACK: For non-darwin systems, we don't have any real target support
+    //  yet.  For these systems, set the target to darwin.
+    if (!strstr("darwin",LLVM_HOSTTRIPLE))
+      base_triple = "i386-apple-darwin";
+    else
+      base_triple = LLVM_HOSTTRIPLE;
+  }
   else
     base_triple = TargetTriple.getValue();
   
@@ -991,12 +997,13 @@
     std::vector<std::string> triples;
     CreateTargetTriples(triples);
     Target = CreateTargetInfo(triples,Diags);
-  }
   
-  if (Target == 0) {
-    fprintf(stderr,
-            "Sorry, don't know what target this is, please use -arch.\n");
-    exit(1);
+    if (Target == 0) {
+      fprintf(stderr, "Sorry, I don't know what target this is: %s\n",
+              triples[0].c_str());
+      fprintf(stderr, "Please use -triple or -arch.\n");
+      exit(1);
+    }
   }
   
   // Process the -I options and set them in the HeaderInfo.