Driver: Hide HostInfo implementations.
 - Also, normalize arch names a tad and stub out getToolChain
   implementations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67091 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
index 726823b..0da441f 100644
--- a/lib/Driver/Driver.cpp
+++ b/lib/Driver/Driver.cpp
@@ -816,7 +816,7 @@
   return llvm::sys::Path(Name);
 }
 
-HostInfo *Driver::GetHostInfo(const char *Triple) {
+const HostInfo *Driver::GetHostInfo(const char *Triple) {
   // Dice into arch, platform, and OS. This matches 
   //  arch,platform,os = '(.*?)-(.*?)-(.*?)'
   // and missing fields are left empty.
@@ -833,8 +833,16 @@
   } else
     Arch = Triple;
 
+  // Normalize Arch a bit. 
+  //
+  // FIXME: This is very incomplete.
+  if (Arch == "i686") 
+    Arch = "i386";
+  else if (Arch == "amd64")
+    Arch = "x86_64";
+  
   if (memcmp(&OS[0], "darwin", 6) == 0)
-    return new DarwinHostInfo(Arch.c_str(), Platform.c_str(), OS.c_str());
+    return createDarwinHostInfo(Arch.c_str(), Platform.c_str(), OS.c_str());
     
-  return new UnknownHostInfo(Arch.c_str(), Platform.c_str(), OS.c_str());
+  return createUnknownHostInfo(Arch.c_str(), Platform.c_str(), OS.c_str());
 }