diff options
Diffstat (limited to 'lib/CodeGen/AsmPrinter/AccelTable.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter/AccelTable.cpp | 46 |
1 files changed, 12 insertions, 34 deletions
diff --git a/lib/CodeGen/AsmPrinter/AccelTable.cpp b/lib/CodeGen/AsmPrinter/AccelTable.cpp index 95875ccb8a0b..b1b7921ea976 100644 --- a/lib/CodeGen/AsmPrinter/AccelTable.cpp +++ b/lib/CodeGen/AsmPrinter/AccelTable.cpp @@ -1,9 +1,8 @@ //===- llvm/CodeGen/AsmPrinter/AccelTable.cpp - Accelerator Tables --------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// 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 // //===----------------------------------------------------------------------===// // @@ -56,10 +55,10 @@ void AccelTableBase::finalize(AsmPrinter *Asm, StringRef Prefix) { // Create the individual hash data outputs. for (auto &E : Entries) { // Unique the entries. - std::stable_sort(E.second.Values.begin(), E.second.Values.end(), - [](const AccelTableData *A, const AccelTableData *B) { - return *A < *B; - }); + llvm::stable_sort(E.second.Values, + [](const AccelTableData *A, const AccelTableData *B) { + return *A < *B; + }); E.second.Values.erase( std::unique(E.second.Values.begin(), E.second.Values.end()), E.second.Values.end()); @@ -82,10 +81,9 @@ void AccelTableBase::finalize(AsmPrinter *Asm, StringRef Prefix) { // Sort the contents of the buckets by hash value so that hash collisions end // up together. Stable sort makes testing easier and doesn't cost much more. for (auto &Bucket : Buckets) - std::stable_sort(Bucket.begin(), Bucket.end(), - [](HashData *LHS, HashData *RHS) { - return LHS->HashValue < RHS->HashValue; - }); + llvm::stable_sort(Bucket, [](HashData *LHS, HashData *RHS) { + return LHS->HashValue < RHS->HashValue; + }); } namespace { @@ -557,8 +555,8 @@ void llvm::emitDWARF5AccelTable( SmallVector<unsigned, 1> CUIndex(CUs.size()); int Count = 0; for (const auto &CU : enumerate(CUs)) { - if (CU.value()->getCUNode()->getNameTableKind() == - DICompileUnit::DebugNameTableKind::None) + if (CU.value()->getCUNode()->getNameTableKind() != + DICompileUnit::DebugNameTableKind::Default) continue; CUIndex[CU.index()] = Count++; assert(CU.index() == CU.value()->getUniqueID()); @@ -616,30 +614,10 @@ void AppleAccelTableStaticTypeData::emit(AsmPrinter *Asm) const { Asm->emitInt32(QualifiedNameHash); } -#ifndef _MSC_VER -// The lines below are rejected by older versions (TBD) of MSVC. constexpr AppleAccelTableData::Atom AppleAccelTableTypeData::Atoms[]; constexpr AppleAccelTableData::Atom AppleAccelTableOffsetData::Atoms[]; constexpr AppleAccelTableData::Atom AppleAccelTableStaticOffsetData::Atoms[]; constexpr AppleAccelTableData::Atom AppleAccelTableStaticTypeData::Atoms[]; -#else -// FIXME: Erase this path once the minimum MSCV version has been bumped. -const SmallVector<AppleAccelTableData::Atom, 4> - AppleAccelTableOffsetData::Atoms = { - Atom(dwarf::DW_ATOM_die_offset, dwarf::DW_FORM_data4)}; -const SmallVector<AppleAccelTableData::Atom, 4> AppleAccelTableTypeData::Atoms = - {Atom(dwarf::DW_ATOM_die_offset, dwarf::DW_FORM_data4), - Atom(dwarf::DW_ATOM_die_tag, dwarf::DW_FORM_data2), - Atom(dwarf::DW_ATOM_type_flags, dwarf::DW_FORM_data1)}; -const SmallVector<AppleAccelTableData::Atom, 4> - AppleAccelTableStaticOffsetData::Atoms = { - Atom(dwarf::DW_ATOM_die_offset, dwarf::DW_FORM_data4)}; -const SmallVector<AppleAccelTableData::Atom, 4> - AppleAccelTableStaticTypeData::Atoms = { - Atom(dwarf::DW_ATOM_die_offset, dwarf::DW_FORM_data4), - Atom(dwarf::DW_ATOM_die_tag, dwarf::DW_FORM_data2), - Atom(5, dwarf::DW_FORM_data1), Atom(6, dwarf::DW_FORM_data4)}; -#endif #ifndef NDEBUG void AppleAccelTableWriter::Header::print(raw_ostream &OS) const { |