@@ -94,79 +94,11 @@ class Platform : public PluginInterface {
9494 // / attaching to processes unless another platform is specified.
9595 static lldb::PlatformSP GetHostPlatform ();
9696
97- // / Get the platform for the given architecture. See Platform::Create for how
98- // / a platform is chosen for a given architecture.
99- // /
100- // / \param[in] arch
101- // / The architecture for which we are getting a platform.
102- // /
103- // / \param[in] process_host_arch
104- // / The process host architecture if it's known. An invalid ArchSpec
105- // / represents that the process host architecture is unknown.
106- // /
107- // / \param[out] platform_arch_ptr
108- // / The architecture which was used to pick the returned platform. This
109- // / can be different from the input architecture if we're looking for a
110- // / compatible match instead of an exact match.
111- // /
112- // / \return
113- // / Return the platform that matches the input architecture or the
114- // / default (invalid) platform if none could be found.
115- static lldb::PlatformSP
116- GetPlatformForArchitecture (const ArchSpec &arch,
117- const ArchSpec &process_host_arch = {},
118- ArchSpec *platform_arch_ptr = nullptr );
119-
120- // / Get the platform for the given list of architectures.
121- // /
122- // / The algorithm works a follows:
123- // /
124- // / 1. Returns the selected platform if it matches any of the architectures.
125- // / 2. Returns the host platform if it matches any of the architectures.
126- // / 3. Returns the platform that matches all the architectures.
127- // /
128- // / If none of the above apply, this function returns a default platform. The
129- // / candidates output argument differentiates between either no platforms
130- // / supporting the given architecture or multiple platforms supporting the
131- // / given architecture.
132- // /
133- // / \param[in] arch
134- // / The architecture for which we are getting a platform.
135- // /
136- // / \param[in] process_host_arch
137- // / The process host architecture if it's known. An invalid ArchSpec
138- // / represents that the process host architecture is unknown.
139- // /
140- // / \param[in] selected_platform_sp
141- // / The currently selected platform.
142- // /
143- // / \param[out] candidates
144- // / A list of candidate platforms in case multiple platforms could
145- // / support the given list of architectures. If no platforms match the
146- // / given architecture the list will be empty.
147- // /
148- // / \return
149- // / Return the platform that matches the input architectures or the
150- // / default (invalid) platform if no platforms support the given
151- // / architectures or multiple platforms support the given architecture.
152- static lldb::PlatformSP
153- GetPlatformForArchitectures (std::vector<ArchSpec> archs,
154- const ArchSpec &process_host_arch,
155- lldb::PlatformSP selected_platform_sp,
156- std::vector<lldb::PlatformSP> &candidates);
157-
15897 static const char *GetHostPlatformName ();
15998
16099 static void SetHostPlatform (const lldb::PlatformSP &platform_sp);
161100
162- // Find an existing platform plug-in by name
163- static lldb::PlatformSP Find (ConstString name);
164-
165- static lldb::PlatformSP Create (ConstString name, Status &error);
166-
167- static lldb::PlatformSP Create (const ArchSpec &arch,
168- const ArchSpec &process_host_arch,
169- ArchSpec *platform_arch_ptr, Status &error);
101+ static lldb::PlatformSP Create (llvm::StringRef name);
170102
171103 // / Augments the triple either with information from platform or the host
172104 // / system (if platform is null).
@@ -917,9 +849,6 @@ class Platform : public PluginInterface {
917849 virtual CompilerType GetSiginfoType (const llvm::Triple &triple);
918850
919851protected:
920- // / For unit testing purposes only.
921- static void Clear ();
922-
923852 // / Create a list of ArchSpecs with the given OS and a architectures. The
924853 // / vendor field is left as an "unspecified unknown".
925854 static std::vector<ArchSpec>
@@ -1069,6 +998,32 @@ class PlatformList {
1069998 }
1070999 }
10711000
1001+ lldb::PlatformSP GetOrCreate (llvm::StringRef name);
1002+ lldb::PlatformSP GetOrCreate (const ArchSpec &arch,
1003+ const ArchSpec &process_host_arch,
1004+ ArchSpec *platform_arch_ptr, Status &error);
1005+ lldb::PlatformSP GetOrCreate (const ArchSpec &arch,
1006+ const ArchSpec &process_host_arch,
1007+ ArchSpec *platform_arch_ptr);
1008+
1009+ // / Get the platform for the given list of architectures.
1010+ // /
1011+ // / The algorithm works a follows:
1012+ // /
1013+ // / 1. Returns the selected platform if it matches any of the architectures.
1014+ // / 2. Returns the host platform if it matches any of the architectures.
1015+ // / 3. Returns the platform that matches all the architectures.
1016+ // /
1017+ // / If none of the above apply, this function returns a default platform. The
1018+ // / candidates output argument differentiates between either no platforms
1019+ // / supporting the given architecture or multiple platforms supporting the
1020+ // / given architecture.
1021+ lldb::PlatformSP GetOrCreate (llvm::ArrayRef<ArchSpec> archs,
1022+ const ArchSpec &process_host_arch,
1023+ std::vector<lldb::PlatformSP> &candidates);
1024+
1025+ lldb::PlatformSP Create (llvm::StringRef name);
1026+
10721027protected:
10731028 typedef std::vector<lldb::PlatformSP> collection;
10741029 mutable std::recursive_mutex m_mutex;
0 commit comments