<commit_before>//===-- OptionGroupPlatform.cpp ---------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include "lldb/Interpreter/OptionGroupPlatform.h"

// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Target/Platform.h"
#include "lldb/Utility/Utils.h"

using namespace lldb;
using namespace lldb_private;

PlatformSP 
OptionGroupPlatform::CreatePlatformWithOptions (CommandInterpreter &interpreter,
                                                const ArchSpec &arch,
                                                bool make_selected,
                                                Error& error,
                                                ArchSpec &platform_arch) const
{
    PlatformSP platform_sp;
    
    if (!m_platform_name.empty())
    {
        platform_sp = Platform::Create (m_platform_name.c_str(), error);
        if (platform_sp)
        {
            if (!platform_sp->IsCompatibleArchitecture(arch, &platform_arch))
            {
                error.SetErrorStringWithFormat("platform '%s' doesn't support '%s'", platform_sp->GetName(), arch.GetTriple().getTriple().c_str());<commit_msg>Fixed an issue in the platform options where if no architecture was specified where the platform would fail to select itself with something like:<commit_after>//===-- OptionGroupPlatform.cpp ---------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include "lldb/Interpreter/OptionGroupPlatform.h"

// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Target/Platform.h"
#include "lldb/Utility/Utils.h"

using namespace lldb;
using namespace lldb_private;

PlatformSP 
OptionGroupPlatform::CreatePlatformWithOptions (CommandInterpreter &interpreter,
                                                const ArchSpec &arch,
                                                bool make_selected,
                                                Error& error,
                                                ArchSpec &platform_arch) const
{
    PlatformSP platform_sp;
    
    if (!m_platform_name.empty())
    {
        platform_sp = Platform::Create (m_platform_name.c_str(), error);
        if (platform_sp)
        {
            if (platform_arch.IsValid() && !platform_sp->IsCompatibleArchitecture(arch, &platform_arch))
            {
                error.SetErrorStringWithFormat("platform '%s' doesn't support '%s'", platform_sp->GetName(), arch.GetTriple().getTriple().c_str());
{'fraction_non_alphanumeric': 0.16854293985204247, 'fraction_numerical': 0.0, 'mean_word_length': 1.7256792287467133, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1875629', 'n_tokens_mistral': 734, 'n_tokens_neox': 737, 'n_words': 187}