Platforms can now auto-select themselves if you specify a full target triple when doing a "target create" command.

Each platform now knows if it can handle an architecture and a platform can be found using an architecture. Each platform can look at the arch, vendor and OS and know if it should be used or not.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@153104 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBDebugger.cpp b/source/API/SBDebugger.cpp
index ac6fc20..b61acd7 100644
--- a/source/API/SBDebugger.cpp
+++ b/source/API/SBDebugger.cpp
@@ -612,11 +612,12 @@
         Error error;
         const bool add_dependent_modules = true;
 
+        PlatformSP platform_sp(m_opaque_sp->GetPlatformList().GetSelectedPlatform());
         error = m_opaque_sp->GetTargetList().CreateTarget (*m_opaque_sp, 
                                                            file, 
                                                            arch, 
                                                            add_dependent_modules, 
-                                                           m_opaque_sp->GetPlatformList().GetSelectedPlatform(),
+                                                           platform_sp,
                                                            target_sp);
 
         if (error.Success())