llvm/lldb/source/Utility/ArchSpec.cpp

//===-- ArchSpec.cpp ------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/LLDBLog.h"

#include "lldb/Utility/Log.h"
#include "lldb/Utility/StringList.h"
#include "lldb/lldb-defines.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/BinaryFormat/COFF.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/BinaryFormat/MachO.h"
#include "llvm/BinaryFormat/XCOFF.h"
#include "llvm/Support/Compiler.h"
#include "llvm/TargetParser/ARMTargetParser.h"

usingnamespacelldb;
usingnamespacelldb_private;

static bool cores_match(const ArchSpec::Core core1, const ArchSpec::Core core2,
                        bool try_inverse, bool enforce_exact_match);

namespace lldb_private {

struct CoreDefinition {};

} // namespace lldb_private

// This core information can be looked using the ArchSpec::Core as the index
static const CoreDefinition g_core_definitions[] =;

// Ensure that we have an entry in the g_core_definitions for each core. If you
// comment out an entry above, you will need to comment out the corresponding
// ArchSpec::Core enumeration.
static_assert;

struct ArchDefinitionEntry {};

struct ArchDefinition {};

void ArchSpec::ListSupportedArchNames(StringList &list) {}

void ArchSpec::AutoComplete(CompletionRequest &request) {}

#define CPU_ANY

//===----------------------------------------------------------------------===//
// A table that gets searched linearly for matches. This table is used to
// convert cpu type and subtypes to architecture names, and to convert
// architecture names to cpu types and subtypes. The ordering is important and
// allows the precedence to be set when the table is built.
#define SUBTYPE_MASK

// clang-format off
static const ArchDefinitionEntry g_macho_arch_entries[] =;
// clang-format on

static const ArchDefinition g_macho_arch_def =;

//===----------------------------------------------------------------------===//
// A table that gets searched linearly for matches. This table is used to
// convert cpu type and subtypes to architecture names, and to convert
// architecture names to cpu types and subtypes. The ordering is important and
// allows the precedence to be set when the table is built.
static const ArchDefinitionEntry g_elf_arch_entries[] =;

static const ArchDefinition g_elf_arch_def =;

static const ArchDefinitionEntry g_coff_arch_entries[] =;

static const ArchDefinition g_coff_arch_def =;

static const ArchDefinitionEntry g_xcoff_arch_entries[] =;

static const ArchDefinition g_xcoff_arch_def =;

//===----------------------------------------------------------------------===//
// Table of all ArchDefinitions
static const ArchDefinition *g_arch_definitions[] =;

//===----------------------------------------------------------------------===//
// Static helper functions.

// Get the architecture definition for a given object type.
static const ArchDefinition *FindArchDefinition(ArchitectureType arch_type) {}

// Get an architecture definition by name.
static const CoreDefinition *FindCoreDefinition(llvm::StringRef name) {}

static inline const CoreDefinition *FindCoreDefinition(ArchSpec::Core core) {}

// Get a definition entry by cpu type and subtype.
static const ArchDefinitionEntry *
FindArchDefinitionEntry(const ArchDefinition *def, uint32_t cpu, uint32_t sub) {}

static const ArchDefinitionEntry *
FindArchDefinitionEntry(const ArchDefinition *def, ArchSpec::Core core) {}

//===----------------------------------------------------------------------===//
// Constructors and destructors.

ArchSpec::ArchSpec() = default;

ArchSpec::ArchSpec(const char *triple_cstr) {}

ArchSpec::ArchSpec(llvm::StringRef triple_str) {}

ArchSpec::ArchSpec(const llvm::Triple &triple) {}

ArchSpec::ArchSpec(ArchitectureType arch_type, uint32_t cpu, uint32_t subtype) {}

ArchSpec::~ArchSpec() = default;

void ArchSpec::Clear() {}

//===----------------------------------------------------------------------===//
// Predicates.

const char *ArchSpec::GetArchitectureName() const {}

bool ArchSpec::IsMIPS() const {}

std::string ArchSpec::GetTargetABI() const {}

void ArchSpec::SetFlags(const std::string &elf_abi) {}

std::string ArchSpec::GetClangTargetCPU() const {}

uint32_t ArchSpec::GetMachOCPUType() const {}

uint32_t ArchSpec::GetMachOCPUSubType() const {}

uint32_t ArchSpec::GetDataByteSize() const {}

uint32_t ArchSpec::GetCodeByteSize() const {}

llvm::Triple::ArchType ArchSpec::GetMachine() const {}

uint32_t ArchSpec::GetAddressByteSize() const {}

ByteOrder ArchSpec::GetDefaultEndian() const {}

bool ArchSpec::CharIsSignedByDefault() const {}

lldb::ByteOrder ArchSpec::GetByteOrder() const {}

//===----------------------------------------------------------------------===//
// Mutators.

bool ArchSpec::SetTriple(const llvm::Triple &triple) {}

bool lldb_private::ParseMachCPUDashSubtypeTriple(llvm::StringRef triple_str,
                                                 ArchSpec &arch) {}

bool ArchSpec::SetTriple(llvm::StringRef triple) {}

bool ArchSpec::ContainsOnlyArch(const llvm::Triple &normalized_triple) {}

void ArchSpec::MergeFrom(const ArchSpec &other) {}

bool ArchSpec::SetArchitecture(ArchitectureType arch_type, uint32_t cpu,
                               uint32_t sub, uint32_t os) {}

uint32_t ArchSpec::GetMinimumOpcodeByteSize() const {}

uint32_t ArchSpec::GetMaximumOpcodeByteSize() const {}

static bool IsCompatibleEnvironment(llvm::Triple::EnvironmentType lhs,
                                    llvm::Triple::EnvironmentType rhs) {}

bool ArchSpec::IsMatch(const ArchSpec &rhs, MatchType match) const {}

void ArchSpec::UpdateCore() {}

//===----------------------------------------------------------------------===//
// Helper methods.

void ArchSpec::CoreUpdated(bool update_triple) {}

//===----------------------------------------------------------------------===//
// Operators.

static bool cores_match(const ArchSpec::Core core1, const ArchSpec::Core core2,
                        bool try_inverse, bool enforce_exact_match) {}

bool lldb_private::operator<(const ArchSpec &lhs, const ArchSpec &rhs) {}


bool lldb_private::operator==(const ArchSpec &lhs, const ArchSpec &rhs) {}

bool ArchSpec::IsFullySpecifiedTriple() const {}

bool ArchSpec::IsAlwaysThumbInstructions() const {}

void ArchSpec::DumpTriple(llvm::raw_ostream &s) const {}