diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2020-01-17 20:45:01 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2020-01-17 20:45:01 +0000 |
commit | 706b4fc47bbc608932d3b491ae19a3b9cde9497b (patch) | |
tree | 4adf86a776049cbf7f69a1929c4babcbbef925eb /lldb/source/Utility/ArchSpec.cpp | |
parent | 7cc9cf2bf09f069cb2dd947ead05d0b54301fb71 (diff) |
Notes
Diffstat (limited to 'lldb/source/Utility/ArchSpec.cpp')
-rw-r--r-- | lldb/source/Utility/ArchSpec.cpp | 41 |
1 files changed, 16 insertions, 25 deletions
diff --git a/lldb/source/Utility/ArchSpec.cpp b/lldb/source/Utility/ArchSpec.cpp index 40cc4a092b0d..3dae25ceacd6 100644 --- a/lldb/source/Utility/ArchSpec.cpp +++ b/lldb/source/Utility/ArchSpec.cpp @@ -9,17 +9,13 @@ #include "lldb/Utility/ArchSpec.h" #include "lldb/Utility/Log.h" -#include "lldb/Utility/NameMatches.h" -#include "lldb/Utility/Stream.h" #include "lldb/Utility/StringList.h" #include "lldb/lldb-defines.h" #include "llvm/ADT/STLExtras.h" -#include "llvm/ADT/Twine.h" #include "llvm/BinaryFormat/COFF.h" #include "llvm/BinaryFormat/ELF.h" #include "llvm/BinaryFormat/MachO.h" #include "llvm/Support/Compiler.h" -#include "llvm/Support/Host.h" using namespace lldb; using namespace lldb_private; @@ -61,6 +57,8 @@ static const CoreDefinition g_core_definitions[] = { "armv6m"}, {eByteOrderLittle, 4, 2, 4, llvm::Triple::arm, ArchSpec::eCore_arm_armv7, "armv7"}, + {eByteOrderLittle, 4, 2, 4, llvm::Triple::arm, ArchSpec::eCore_arm_armv7l, + "armv7l"}, {eByteOrderLittle, 4, 2, 4, llvm::Triple::arm, ArchSpec::eCore_arm_armv7f, "armv7f"}, {eByteOrderLittle, 4, 2, 4, llvm::Triple::arm, ArchSpec::eCore_arm_armv7s, @@ -101,6 +99,8 @@ static const CoreDefinition g_core_definitions[] = { ArchSpec::eCore_arm_arm64, "arm64"}, {eByteOrderLittle, 8, 4, 4, llvm::Triple::aarch64, ArchSpec::eCore_arm_armv8, "armv8"}, + {eByteOrderLittle, 4, 2, 4, llvm::Triple::arm, + ArchSpec::eCore_arm_armv8l, "armv8l"}, {eByteOrderLittle, 4, 4, 4, llvm::Triple::aarch64_32, ArchSpec::eCore_arm_arm64_32, "arm64_32"}, {eByteOrderLittle, 8, 4, 4, llvm::Triple::aarch64, @@ -444,7 +444,7 @@ static const ArchDefinitionEntry g_elf_arch_entries[] = { {ArchSpec::eCore_hexagon_generic, llvm::ELF::EM_HEXAGON, LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu}, // HEXAGON {ArchSpec::eCore_arc, llvm::ELF::EM_ARC_COMPACT2, LLDB_INVALID_CPUTYPE, - 0xFFFFFFFFu, 0xFFFFFFFFu }, // ARC + 0xFFFFFFFFu, 0xFFFFFFFFu}, // ARC }; static const ArchDefinition g_elf_arch_def = { @@ -564,20 +564,6 @@ ArchSpec::ArchSpec(ArchitectureType arch_type, uint32_t cpu, uint32_t subtype) { ArchSpec::~ArchSpec() = default; -//===----------------------------------------------------------------------===// -// Assignment and initialization. - -const ArchSpec &ArchSpec::operator=(const ArchSpec &rhs) { - if (this != &rhs) { - m_triple = rhs.m_triple; - m_core = rhs.m_core; - m_byte_order = rhs.m_byte_order; - m_distribution_id = rhs.m_distribution_id; - m_flags = rhs.m_flags; - } - return *this; -} - void ArchSpec::Clear() { m_triple = llvm::Triple(); m_core = kCore_invalid; @@ -878,7 +864,7 @@ void ArchSpec::MergeFrom(const ArchSpec &other) { IsCompatibleMatch(other) && GetCore() == ArchSpec::eCore_arm_generic && other.GetCore() != ArchSpec::eCore_arm_generic) { m_core = other.GetCore(); - CoreUpdated(true); + CoreUpdated(false); } if (GetFlags() == 0) { SetFlags(other.GetFlags()); @@ -1202,6 +1188,8 @@ static bool cores_match(const ArchSpec::Core core1, const ArchSpec::Core core2, case ArchSpec::eCore_arm_armv7f: case ArchSpec::eCore_arm_armv7k: case ArchSpec::eCore_arm_armv7s: + case ArchSpec::eCore_arm_armv7l: + case ArchSpec::eCore_arm_armv8l: if (!enforce_exact_match) { if (core2 == ArchSpec::eCore_arm_generic) return true; @@ -1451,21 +1439,24 @@ bool ArchSpec::IsAlwaysThumbInstructions() const { GetCore() == ArchSpec::Core::eCore_thumbv6m) { return true; } + // Windows on ARM is always thumb. + if (GetTriple().isOSWindows()) + return true; } return false; } -void ArchSpec::DumpTriple(Stream &s) const { +void ArchSpec::DumpTriple(llvm::raw_ostream &s) const { const llvm::Triple &triple = GetTriple(); llvm::StringRef arch_str = triple.getArchName(); llvm::StringRef vendor_str = triple.getVendorName(); llvm::StringRef os_str = triple.getOSName(); llvm::StringRef environ_str = triple.getEnvironmentName(); - s.Printf("%s-%s-%s", arch_str.empty() ? "*" : arch_str.str().c_str(), - vendor_str.empty() ? "*" : vendor_str.str().c_str(), - os_str.empty() ? "*" : os_str.str().c_str()); + s << llvm::formatv("{0}-{1}-{2}", arch_str.empty() ? "*" : arch_str, + vendor_str.empty() ? "*" : vendor_str, + os_str.empty() ? "*" : os_str); if (!environ_str.empty()) - s.Printf("-%s", environ_str.str().c_str()); + s << "-" << environ_str; } |