2018-01-29 22:52:41 +08:00
|
|
|
//===- llvm/CodeGen/AsmPrinter/AccelTable.cpp - Accelerator Tables --------===//
|
2011-11-07 17:18:42 +08:00
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// 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
|
2011-11-07 17:18:42 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2018-01-29 22:52:41 +08:00
|
|
|
// This file contains support for writing accelerator tables.
|
2011-11-07 17:18:42 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2018-01-29 22:52:41 +08:00
|
|
|
#include "llvm/CodeGen/AccelTable.h"
|
2018-04-04 22:42:14 +08:00
|
|
|
#include "DwarfCompileUnit.h"
|
2012-03-26 22:17:26 +08:00
|
|
|
#include "llvm/ADT/STLExtras.h"
|
2017-08-18 05:26:39 +08:00
|
|
|
#include "llvm/ADT/StringMap.h"
|
2012-12-04 00:50:05 +08:00
|
|
|
#include "llvm/ADT/Twine.h"
|
2017-08-18 05:26:39 +08:00
|
|
|
#include "llvm/BinaryFormat/Dwarf.h"
|
2011-11-07 17:18:42 +08:00
|
|
|
#include "llvm/CodeGen/AsmPrinter.h"
|
2015-01-06 05:29:41 +08:00
|
|
|
#include "llvm/CodeGen/DIE.h"
|
2011-11-07 17:18:42 +08:00
|
|
|
#include "llvm/MC/MCExpr.h"
|
|
|
|
#include "llvm/MC/MCStreamer.h"
|
2018-07-16 18:52:27 +08:00
|
|
|
#include "llvm/MC/MCSymbol.h"
|
2017-08-18 05:26:39 +08:00
|
|
|
#include "llvm/Support/raw_ostream.h"
|
2018-08-17 05:29:55 +08:00
|
|
|
#include "llvm/Target/TargetLoweringObjectFile.h"
|
2017-08-18 05:26:39 +08:00
|
|
|
#include <algorithm>
|
|
|
|
#include <cstddef>
|
|
|
|
#include <cstdint>
|
|
|
|
#include <limits>
|
|
|
|
#include <vector>
|
2011-11-07 17:18:42 +08:00
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
[CodeGen] Refactor AppleAccelTable
Summary:
This commit separates the abstract accelerator table data structure
from the code for writing out an on-disk representation of a specific
accelerator table format. The idea is that former (now called
AccelTable<T>) can be reused for the DWARF v5 accelerator tables
as-is, without any further customizations.
Some bits of the emission code (now living in the EmissionContext class)
can be reused for DWARF v5 as well, but the subtle differences in the
layout of various subtables mean the sharing is not always possible.
(Also, the individual emit*** functions are fairly simple so there's a
tradeoff between making a bigger general-purpose function, and two
smaller targeted functions.)
Another advantage of this setup is that more of the serialization logic
can be hidden in the .cpp file -- I have moved declarations of the
header and all the emission functions there.
Reviewers: JDevlieghere, aprantl, probinson, dblaikie
Subscribers: echristo, clayborg, vleschuk, llvm-commits
Differential Revision: https://reviews.llvm.org/D43285
llvm-svn: 325516
2018-02-20 00:12:20 +08:00
|
|
|
void AccelTableBase::computeBucketCount() {
|
|
|
|
// First get the number of unique hashes.
|
|
|
|
std::vector<uint32_t> Uniques;
|
|
|
|
Uniques.reserve(Entries.size());
|
|
|
|
for (const auto &E : Entries)
|
|
|
|
Uniques.push_back(E.second.HashValue);
|
|
|
|
array_pod_sort(Uniques.begin(), Uniques.end());
|
|
|
|
std::vector<uint32_t>::iterator P =
|
|
|
|
std::unique(Uniques.begin(), Uniques.end());
|
|
|
|
|
|
|
|
UniqueHashCount = std::distance(Uniques.begin(), P);
|
|
|
|
|
|
|
|
if (UniqueHashCount > 1024)
|
|
|
|
BucketCount = UniqueHashCount / 4;
|
|
|
|
else if (UniqueHashCount > 16)
|
|
|
|
BucketCount = UniqueHashCount / 2;
|
|
|
|
else
|
|
|
|
BucketCount = std::max<uint32_t>(UniqueHashCount, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
});
|
|
|
|
E.second.Values.erase(
|
|
|
|
std::unique(E.second.Values.begin(), E.second.Values.end()),
|
|
|
|
E.second.Values.end());
|
|
|
|
}
|
|
|
|
|
|
|
|
// Figure out how many buckets we need, then compute the bucket contents and
|
|
|
|
// the final ordering. The hashes and offsets can be emitted by walking these
|
|
|
|
// data structures. We add temporary symbols to the data so they can be
|
|
|
|
// referenced when emitting the offsets.
|
|
|
|
computeBucketCount();
|
|
|
|
|
|
|
|
// Compute bucket contents and final ordering.
|
|
|
|
Buckets.resize(BucketCount);
|
|
|
|
for (auto &E : Entries) {
|
|
|
|
uint32_t Bucket = E.second.HashValue % BucketCount;
|
|
|
|
Buckets[Bucket].push_back(&E.second);
|
|
|
|
E.second.Sym = Asm->createTempSymbol(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;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace {
|
2018-04-04 22:42:14 +08:00
|
|
|
/// Base class for writing out Accelerator tables. It holds the common
|
|
|
|
/// functionality for the two Accelerator table types.
|
2018-07-09 16:47:38 +08:00
|
|
|
class AccelTableWriter {
|
[CodeGen] Refactor AppleAccelTable
Summary:
This commit separates the abstract accelerator table data structure
from the code for writing out an on-disk representation of a specific
accelerator table format. The idea is that former (now called
AccelTable<T>) can be reused for the DWARF v5 accelerator tables
as-is, without any further customizations.
Some bits of the emission code (now living in the EmissionContext class)
can be reused for DWARF v5 as well, but the subtle differences in the
layout of various subtables mean the sharing is not always possible.
(Also, the individual emit*** functions are fairly simple so there's a
tradeoff between making a bigger general-purpose function, and two
smaller targeted functions.)
Another advantage of this setup is that more of the serialization logic
can be hidden in the .cpp file -- I have moved declarations of the
header and all the emission functions there.
Reviewers: JDevlieghere, aprantl, probinson, dblaikie
Subscribers: echristo, clayborg, vleschuk, llvm-commits
Differential Revision: https://reviews.llvm.org/D43285
llvm-svn: 325516
2018-02-20 00:12:20 +08:00
|
|
|
protected:
|
|
|
|
AsmPrinter *const Asm; ///< Destination.
|
|
|
|
const AccelTableBase &Contents; ///< Data to emit.
|
|
|
|
|
|
|
|
/// Controls whether to emit duplicate hash and offset table entries for names
|
|
|
|
/// with identical hashes. Apple tables don't emit duplicate entries, DWARF v5
|
|
|
|
/// tables do.
|
|
|
|
const bool SkipIdenticalHashes;
|
|
|
|
|
|
|
|
void emitHashes() const;
|
|
|
|
|
|
|
|
/// Emit offsets to lists of entries with identical names. The offsets are
|
|
|
|
/// relative to the Base argument.
|
|
|
|
void emitOffsets(const MCSymbol *Base) const;
|
|
|
|
|
|
|
|
public:
|
2018-07-09 16:47:38 +08:00
|
|
|
AccelTableWriter(AsmPrinter *Asm, const AccelTableBase &Contents,
|
|
|
|
bool SkipIdenticalHashes)
|
[CodeGen] Refactor AppleAccelTable
Summary:
This commit separates the abstract accelerator table data structure
from the code for writing out an on-disk representation of a specific
accelerator table format. The idea is that former (now called
AccelTable<T>) can be reused for the DWARF v5 accelerator tables
as-is, without any further customizations.
Some bits of the emission code (now living in the EmissionContext class)
can be reused for DWARF v5 as well, but the subtle differences in the
layout of various subtables mean the sharing is not always possible.
(Also, the individual emit*** functions are fairly simple so there's a
tradeoff between making a bigger general-purpose function, and two
smaller targeted functions.)
Another advantage of this setup is that more of the serialization logic
can be hidden in the .cpp file -- I have moved declarations of the
header and all the emission functions there.
Reviewers: JDevlieghere, aprantl, probinson, dblaikie
Subscribers: echristo, clayborg, vleschuk, llvm-commits
Differential Revision: https://reviews.llvm.org/D43285
llvm-svn: 325516
2018-02-20 00:12:20 +08:00
|
|
|
: Asm(Asm), Contents(Contents), SkipIdenticalHashes(SkipIdenticalHashes) {
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-07-09 16:47:38 +08:00
|
|
|
class AppleAccelTableWriter : public AccelTableWriter {
|
[CodeGen] Refactor AppleAccelTable
Summary:
This commit separates the abstract accelerator table data structure
from the code for writing out an on-disk representation of a specific
accelerator table format. The idea is that former (now called
AccelTable<T>) can be reused for the DWARF v5 accelerator tables
as-is, without any further customizations.
Some bits of the emission code (now living in the EmissionContext class)
can be reused for DWARF v5 as well, but the subtle differences in the
layout of various subtables mean the sharing is not always possible.
(Also, the individual emit*** functions are fairly simple so there's a
tradeoff between making a bigger general-purpose function, and two
smaller targeted functions.)
Another advantage of this setup is that more of the serialization logic
can be hidden in the .cpp file -- I have moved declarations of the
header and all the emission functions there.
Reviewers: JDevlieghere, aprantl, probinson, dblaikie
Subscribers: echristo, clayborg, vleschuk, llvm-commits
Differential Revision: https://reviews.llvm.org/D43285
llvm-svn: 325516
2018-02-20 00:12:20 +08:00
|
|
|
using Atom = AppleAccelTableData::Atom;
|
|
|
|
|
|
|
|
/// The fixed header of an Apple Accelerator Table.
|
|
|
|
struct Header {
|
|
|
|
uint32_t Magic = MagicHash;
|
|
|
|
uint16_t Version = 1;
|
|
|
|
uint16_t HashFunction = dwarf::DW_hash_function_djb;
|
|
|
|
uint32_t BucketCount;
|
|
|
|
uint32_t HashCount;
|
|
|
|
uint32_t HeaderDataLength;
|
|
|
|
|
|
|
|
/// 'HASH' magic value to detect endianness.
|
|
|
|
static const uint32_t MagicHash = 0x48415348;
|
|
|
|
|
|
|
|
Header(uint32_t BucketCount, uint32_t UniqueHashCount, uint32_t DataLength)
|
|
|
|
: BucketCount(BucketCount), HashCount(UniqueHashCount),
|
|
|
|
HeaderDataLength(DataLength) {}
|
|
|
|
|
|
|
|
void emit(AsmPrinter *Asm) const;
|
|
|
|
#ifndef NDEBUG
|
|
|
|
void print(raw_ostream &OS) const;
|
|
|
|
void dump() const { print(dbgs()); }
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
/// The HeaderData describes the structure of an Apple accelerator table
|
|
|
|
/// through a list of Atoms.
|
|
|
|
struct HeaderData {
|
|
|
|
/// In the case of data that is referenced via DW_FORM_ref_* the offset
|
|
|
|
/// base is used to describe the offset for all forms in the list of atoms.
|
|
|
|
uint32_t DieOffsetBase;
|
|
|
|
|
|
|
|
const SmallVector<Atom, 4> Atoms;
|
|
|
|
|
|
|
|
HeaderData(ArrayRef<Atom> AtomList, uint32_t Offset = 0)
|
|
|
|
: DieOffsetBase(Offset), Atoms(AtomList.begin(), AtomList.end()) {}
|
|
|
|
|
|
|
|
void emit(AsmPrinter *Asm) const;
|
|
|
|
#ifndef NDEBUG
|
|
|
|
void print(raw_ostream &OS) const;
|
|
|
|
void dump() const { print(dbgs()); }
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
Header Header;
|
|
|
|
HeaderData HeaderData;
|
|
|
|
const MCSymbol *SecBegin;
|
|
|
|
|
|
|
|
void emitBuckets() const;
|
|
|
|
void emitData() const;
|
|
|
|
|
|
|
|
public:
|
2018-07-09 16:47:38 +08:00
|
|
|
AppleAccelTableWriter(AsmPrinter *Asm, const AccelTableBase &Contents,
|
|
|
|
ArrayRef<Atom> Atoms, const MCSymbol *SecBegin)
|
|
|
|
: AccelTableWriter(Asm, Contents, true),
|
[CodeGen] Refactor AppleAccelTable
Summary:
This commit separates the abstract accelerator table data structure
from the code for writing out an on-disk representation of a specific
accelerator table format. The idea is that former (now called
AccelTable<T>) can be reused for the DWARF v5 accelerator tables
as-is, without any further customizations.
Some bits of the emission code (now living in the EmissionContext class)
can be reused for DWARF v5 as well, but the subtle differences in the
layout of various subtables mean the sharing is not always possible.
(Also, the individual emit*** functions are fairly simple so there's a
tradeoff between making a bigger general-purpose function, and two
smaller targeted functions.)
Another advantage of this setup is that more of the serialization logic
can be hidden in the .cpp file -- I have moved declarations of the
header and all the emission functions there.
Reviewers: JDevlieghere, aprantl, probinson, dblaikie
Subscribers: echristo, clayborg, vleschuk, llvm-commits
Differential Revision: https://reviews.llvm.org/D43285
llvm-svn: 325516
2018-02-20 00:12:20 +08:00
|
|
|
Header(Contents.getBucketCount(), Contents.getUniqueHashCount(),
|
|
|
|
8 + (Atoms.size() * 4)),
|
|
|
|
HeaderData(Atoms), SecBegin(SecBegin) {}
|
|
|
|
|
|
|
|
void emit() const;
|
|
|
|
|
|
|
|
#ifndef NDEBUG
|
|
|
|
void print(raw_ostream &OS) const;
|
|
|
|
void dump() const { print(dbgs()); }
|
|
|
|
#endif
|
|
|
|
};
|
2018-04-04 22:42:14 +08:00
|
|
|
|
2018-07-16 18:52:27 +08:00
|
|
|
/// Class responsible for emitting a DWARF v5 Accelerator Table. The only
|
|
|
|
/// public function is emit(), which performs the actual emission.
|
|
|
|
///
|
|
|
|
/// The class is templated in its data type. This allows us to emit both dyamic
|
|
|
|
/// and static data entries. A callback abstract the logic to provide a CU
|
|
|
|
/// index for a given entry, which is different per data type, but identical
|
|
|
|
/// for every entry in the same table.
|
|
|
|
template <typename DataT>
|
2018-07-09 16:47:38 +08:00
|
|
|
class Dwarf5AccelTableWriter : public AccelTableWriter {
|
2018-04-04 22:42:14 +08:00
|
|
|
struct Header {
|
|
|
|
uint32_t UnitLength = 0;
|
|
|
|
uint16_t Version = 5;
|
|
|
|
uint16_t Padding = 0;
|
|
|
|
uint32_t CompUnitCount;
|
|
|
|
uint32_t LocalTypeUnitCount = 0;
|
|
|
|
uint32_t ForeignTypeUnitCount = 0;
|
|
|
|
uint32_t BucketCount;
|
|
|
|
uint32_t NameCount;
|
|
|
|
uint32_t AbbrevTableSize = 0;
|
|
|
|
uint32_t AugmentationStringSize = sizeof(AugmentationString);
|
|
|
|
char AugmentationString[8] = {'L', 'L', 'V', 'M', '0', '7', '0', '0'};
|
|
|
|
|
|
|
|
Header(uint32_t CompUnitCount, uint32_t BucketCount, uint32_t NameCount)
|
|
|
|
: CompUnitCount(CompUnitCount), BucketCount(BucketCount),
|
|
|
|
NameCount(NameCount) {}
|
|
|
|
|
2018-07-09 16:47:38 +08:00
|
|
|
void emit(const Dwarf5AccelTableWriter &Ctx) const;
|
2018-04-04 22:42:14 +08:00
|
|
|
};
|
|
|
|
struct AttributeEncoding {
|
|
|
|
dwarf::Index Index;
|
|
|
|
dwarf::Form Form;
|
|
|
|
};
|
|
|
|
|
|
|
|
Header Header;
|
|
|
|
DenseMap<uint32_t, SmallVector<AttributeEncoding, 2>> Abbreviations;
|
2018-07-16 18:52:27 +08:00
|
|
|
ArrayRef<MCSymbol *> CompUnits;
|
|
|
|
llvm::function_ref<unsigned(const DataT &)> getCUIndexForEntry;
|
2018-04-04 22:42:14 +08:00
|
|
|
MCSymbol *ContributionStart = Asm->createTempSymbol("names_start");
|
|
|
|
MCSymbol *ContributionEnd = Asm->createTempSymbol("names_end");
|
|
|
|
MCSymbol *AbbrevStart = Asm->createTempSymbol("names_abbrev_start");
|
|
|
|
MCSymbol *AbbrevEnd = Asm->createTempSymbol("names_abbrev_end");
|
|
|
|
MCSymbol *EntryPool = Asm->createTempSymbol("names_entries");
|
|
|
|
|
|
|
|
DenseSet<uint32_t> getUniqueTags() const;
|
|
|
|
|
|
|
|
// Right now, we emit uniform attributes for all tags.
|
|
|
|
SmallVector<AttributeEncoding, 2> getUniformAttributes() const;
|
|
|
|
|
|
|
|
void emitCUList() const;
|
|
|
|
void emitBuckets() const;
|
|
|
|
void emitStringOffsets() const;
|
|
|
|
void emitAbbrevs() const;
|
2018-07-17 02:51:40 +08:00
|
|
|
void emitEntry(const DataT &Entry) const;
|
2018-04-04 22:42:14 +08:00
|
|
|
void emitData() const;
|
|
|
|
|
|
|
|
public:
|
2018-07-16 18:52:27 +08:00
|
|
|
Dwarf5AccelTableWriter(
|
|
|
|
AsmPrinter *Asm, const AccelTableBase &Contents,
|
|
|
|
ArrayRef<MCSymbol *> CompUnits,
|
|
|
|
llvm::function_ref<unsigned(const DataT &)> GetCUIndexForEntry);
|
2018-04-04 22:42:14 +08:00
|
|
|
|
|
|
|
void emit() const;
|
|
|
|
};
|
[CodeGen] Refactor AppleAccelTable
Summary:
This commit separates the abstract accelerator table data structure
from the code for writing out an on-disk representation of a specific
accelerator table format. The idea is that former (now called
AccelTable<T>) can be reused for the DWARF v5 accelerator tables
as-is, without any further customizations.
Some bits of the emission code (now living in the EmissionContext class)
can be reused for DWARF v5 as well, but the subtle differences in the
layout of various subtables mean the sharing is not always possible.
(Also, the individual emit*** functions are fairly simple so there's a
tradeoff between making a bigger general-purpose function, and two
smaller targeted functions.)
Another advantage of this setup is that more of the serialization logic
can be hidden in the .cpp file -- I have moved declarations of the
header and all the emission functions there.
Reviewers: JDevlieghere, aprantl, probinson, dblaikie
Subscribers: echristo, clayborg, vleschuk, llvm-commits
Differential Revision: https://reviews.llvm.org/D43285
llvm-svn: 325516
2018-02-20 00:12:20 +08:00
|
|
|
} // namespace
|
|
|
|
|
2018-07-09 16:47:38 +08:00
|
|
|
void AccelTableWriter::emitHashes() const {
|
[CodeGen] Refactor AppleAccelTable
Summary:
This commit separates the abstract accelerator table data structure
from the code for writing out an on-disk representation of a specific
accelerator table format. The idea is that former (now called
AccelTable<T>) can be reused for the DWARF v5 accelerator tables
as-is, without any further customizations.
Some bits of the emission code (now living in the EmissionContext class)
can be reused for DWARF v5 as well, but the subtle differences in the
layout of various subtables mean the sharing is not always possible.
(Also, the individual emit*** functions are fairly simple so there's a
tradeoff between making a bigger general-purpose function, and two
smaller targeted functions.)
Another advantage of this setup is that more of the serialization logic
can be hidden in the .cpp file -- I have moved declarations of the
header and all the emission functions there.
Reviewers: JDevlieghere, aprantl, probinson, dblaikie
Subscribers: echristo, clayborg, vleschuk, llvm-commits
Differential Revision: https://reviews.llvm.org/D43285
llvm-svn: 325516
2018-02-20 00:12:20 +08:00
|
|
|
uint64_t PrevHash = std::numeric_limits<uint64_t>::max();
|
|
|
|
unsigned BucketIdx = 0;
|
|
|
|
for (auto &Bucket : Contents.getBuckets()) {
|
|
|
|
for (auto &Hash : Bucket) {
|
|
|
|
uint32_t HashValue = Hash->HashValue;
|
|
|
|
if (SkipIdenticalHashes && PrevHash == HashValue)
|
|
|
|
continue;
|
|
|
|
Asm->OutStreamer->AddComment("Hash in Bucket " + Twine(BucketIdx));
|
2018-03-30 07:32:54 +08:00
|
|
|
Asm->emitInt32(HashValue);
|
[CodeGen] Refactor AppleAccelTable
Summary:
This commit separates the abstract accelerator table data structure
from the code for writing out an on-disk representation of a specific
accelerator table format. The idea is that former (now called
AccelTable<T>) can be reused for the DWARF v5 accelerator tables
as-is, without any further customizations.
Some bits of the emission code (now living in the EmissionContext class)
can be reused for DWARF v5 as well, but the subtle differences in the
layout of various subtables mean the sharing is not always possible.
(Also, the individual emit*** functions are fairly simple so there's a
tradeoff between making a bigger general-purpose function, and two
smaller targeted functions.)
Another advantage of this setup is that more of the serialization logic
can be hidden in the .cpp file -- I have moved declarations of the
header and all the emission functions there.
Reviewers: JDevlieghere, aprantl, probinson, dblaikie
Subscribers: echristo, clayborg, vleschuk, llvm-commits
Differential Revision: https://reviews.llvm.org/D43285
llvm-svn: 325516
2018-02-20 00:12:20 +08:00
|
|
|
PrevHash = HashValue;
|
|
|
|
}
|
|
|
|
BucketIdx++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-09 16:47:38 +08:00
|
|
|
void AccelTableWriter::emitOffsets(const MCSymbol *Base) const {
|
[CodeGen] Refactor AppleAccelTable
Summary:
This commit separates the abstract accelerator table data structure
from the code for writing out an on-disk representation of a specific
accelerator table format. The idea is that former (now called
AccelTable<T>) can be reused for the DWARF v5 accelerator tables
as-is, without any further customizations.
Some bits of the emission code (now living in the EmissionContext class)
can be reused for DWARF v5 as well, but the subtle differences in the
layout of various subtables mean the sharing is not always possible.
(Also, the individual emit*** functions are fairly simple so there's a
tradeoff between making a bigger general-purpose function, and two
smaller targeted functions.)
Another advantage of this setup is that more of the serialization logic
can be hidden in the .cpp file -- I have moved declarations of the
header and all the emission functions there.
Reviewers: JDevlieghere, aprantl, probinson, dblaikie
Subscribers: echristo, clayborg, vleschuk, llvm-commits
Differential Revision: https://reviews.llvm.org/D43285
llvm-svn: 325516
2018-02-20 00:12:20 +08:00
|
|
|
const auto &Buckets = Contents.getBuckets();
|
|
|
|
uint64_t PrevHash = std::numeric_limits<uint64_t>::max();
|
|
|
|
for (size_t i = 0, e = Buckets.size(); i < e; ++i) {
|
|
|
|
for (auto *Hash : Buckets[i]) {
|
|
|
|
uint32_t HashValue = Hash->HashValue;
|
|
|
|
if (SkipIdenticalHashes && PrevHash == HashValue)
|
|
|
|
continue;
|
|
|
|
PrevHash = HashValue;
|
|
|
|
Asm->OutStreamer->AddComment("Offset in Bucket " + Twine(i));
|
|
|
|
Asm->EmitLabelDifference(Hash->Sym, Base, sizeof(uint32_t));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-09 16:47:38 +08:00
|
|
|
void AppleAccelTableWriter::Header::emit(AsmPrinter *Asm) const {
|
2015-04-25 03:11:51 +08:00
|
|
|
Asm->OutStreamer->AddComment("Header Magic");
|
2018-03-30 07:32:54 +08:00
|
|
|
Asm->emitInt32(Magic);
|
2015-04-25 03:11:51 +08:00
|
|
|
Asm->OutStreamer->AddComment("Header Version");
|
2018-03-30 07:32:54 +08:00
|
|
|
Asm->emitInt16(Version);
|
2015-04-25 03:11:51 +08:00
|
|
|
Asm->OutStreamer->AddComment("Header Hash Function");
|
2018-03-30 07:32:54 +08:00
|
|
|
Asm->emitInt16(HashFunction);
|
2015-04-25 03:11:51 +08:00
|
|
|
Asm->OutStreamer->AddComment("Header Bucket Count");
|
2018-03-30 07:32:54 +08:00
|
|
|
Asm->emitInt32(BucketCount);
|
2015-04-25 03:11:51 +08:00
|
|
|
Asm->OutStreamer->AddComment("Header Hash Count");
|
2018-03-30 07:32:54 +08:00
|
|
|
Asm->emitInt32(HashCount);
|
2015-04-25 03:11:51 +08:00
|
|
|
Asm->OutStreamer->AddComment("Header Data Length");
|
2018-03-30 07:32:54 +08:00
|
|
|
Asm->emitInt32(HeaderDataLength);
|
[CodeGen] Refactor AppleAccelTable
Summary:
This commit separates the abstract accelerator table data structure
from the code for writing out an on-disk representation of a specific
accelerator table format. The idea is that former (now called
AccelTable<T>) can be reused for the DWARF v5 accelerator tables
as-is, without any further customizations.
Some bits of the emission code (now living in the EmissionContext class)
can be reused for DWARF v5 as well, but the subtle differences in the
layout of various subtables mean the sharing is not always possible.
(Also, the individual emit*** functions are fairly simple so there's a
tradeoff between making a bigger general-purpose function, and two
smaller targeted functions.)
Another advantage of this setup is that more of the serialization logic
can be hidden in the .cpp file -- I have moved declarations of the
header and all the emission functions there.
Reviewers: JDevlieghere, aprantl, probinson, dblaikie
Subscribers: echristo, clayborg, vleschuk, llvm-commits
Differential Revision: https://reviews.llvm.org/D43285
llvm-svn: 325516
2018-02-20 00:12:20 +08:00
|
|
|
}
|
2018-01-29 22:52:34 +08:00
|
|
|
|
2018-07-09 16:47:38 +08:00
|
|
|
void AppleAccelTableWriter::HeaderData::emit(AsmPrinter *Asm) const {
|
2015-04-25 03:11:51 +08:00
|
|
|
Asm->OutStreamer->AddComment("HeaderData Die Offset Base");
|
2018-03-30 07:32:54 +08:00
|
|
|
Asm->emitInt32(DieOffsetBase);
|
2015-04-25 03:11:51 +08:00
|
|
|
Asm->OutStreamer->AddComment("HeaderData Atom Count");
|
2018-03-30 07:32:54 +08:00
|
|
|
Asm->emitInt32(Atoms.size());
|
2018-01-29 22:52:34 +08:00
|
|
|
|
[CodeGen] Refactor AppleAccelTable
Summary:
This commit separates the abstract accelerator table data structure
from the code for writing out an on-disk representation of a specific
accelerator table format. The idea is that former (now called
AccelTable<T>) can be reused for the DWARF v5 accelerator tables
as-is, without any further customizations.
Some bits of the emission code (now living in the EmissionContext class)
can be reused for DWARF v5 as well, but the subtle differences in the
layout of various subtables mean the sharing is not always possible.
(Also, the individual emit*** functions are fairly simple so there's a
tradeoff between making a bigger general-purpose function, and two
smaller targeted functions.)
Another advantage of this setup is that more of the serialization logic
can be hidden in the .cpp file -- I have moved declarations of the
header and all the emission functions there.
Reviewers: JDevlieghere, aprantl, probinson, dblaikie
Subscribers: echristo, clayborg, vleschuk, llvm-commits
Differential Revision: https://reviews.llvm.org/D43285
llvm-svn: 325516
2018-02-20 00:12:20 +08:00
|
|
|
for (const Atom &A : Atoms) {
|
2018-01-29 22:52:34 +08:00
|
|
|
Asm->OutStreamer->AddComment(dwarf::AtomTypeString(A.Type));
|
2018-03-30 07:32:54 +08:00
|
|
|
Asm->emitInt16(A.Type);
|
2018-01-29 22:52:34 +08:00
|
|
|
Asm->OutStreamer->AddComment(dwarf::FormEncodingString(A.Form));
|
2018-03-30 07:32:54 +08:00
|
|
|
Asm->emitInt16(A.Form);
|
2011-11-07 17:18:42 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-09 16:47:38 +08:00
|
|
|
void AppleAccelTableWriter::emitBuckets() const {
|
[CodeGen] Refactor AppleAccelTable
Summary:
This commit separates the abstract accelerator table data structure
from the code for writing out an on-disk representation of a specific
accelerator table format. The idea is that former (now called
AccelTable<T>) can be reused for the DWARF v5 accelerator tables
as-is, without any further customizations.
Some bits of the emission code (now living in the EmissionContext class)
can be reused for DWARF v5 as well, but the subtle differences in the
layout of various subtables mean the sharing is not always possible.
(Also, the individual emit*** functions are fairly simple so there's a
tradeoff between making a bigger general-purpose function, and two
smaller targeted functions.)
Another advantage of this setup is that more of the serialization logic
can be hidden in the .cpp file -- I have moved declarations of the
header and all the emission functions there.
Reviewers: JDevlieghere, aprantl, probinson, dblaikie
Subscribers: echristo, clayborg, vleschuk, llvm-commits
Differential Revision: https://reviews.llvm.org/D43285
llvm-svn: 325516
2018-02-20 00:12:20 +08:00
|
|
|
const auto &Buckets = Contents.getBuckets();
|
2011-11-07 17:18:42 +08:00
|
|
|
unsigned index = 0;
|
2011-11-09 02:38:40 +08:00
|
|
|
for (size_t i = 0, e = Buckets.size(); i < e; ++i) {
|
2015-04-25 03:11:51 +08:00
|
|
|
Asm->OutStreamer->AddComment("Bucket " + Twine(i));
|
2017-08-18 05:26:39 +08:00
|
|
|
if (!Buckets[i].empty())
|
2018-03-30 07:32:54 +08:00
|
|
|
Asm->emitInt32(index);
|
2011-11-07 17:18:42 +08:00
|
|
|
else
|
2018-03-30 07:32:54 +08:00
|
|
|
Asm->emitInt32(std::numeric_limits<uint32_t>::max());
|
2018-01-29 22:52:34 +08:00
|
|
|
// Buckets point in the list of hashes, not to the data. Do not increment
|
|
|
|
// the index multiple times in case of hash collisions.
|
2017-08-18 05:26:39 +08:00
|
|
|
uint64_t PrevHash = std::numeric_limits<uint64_t>::max();
|
2015-03-10 08:46:31 +08:00
|
|
|
for (auto *HD : Buckets[i]) {
|
|
|
|
uint32_t HashValue = HD->HashValue;
|
|
|
|
if (PrevHash != HashValue)
|
|
|
|
++index;
|
|
|
|
PrevHash = HashValue;
|
|
|
|
}
|
2011-11-07 17:18:42 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-09 16:47:38 +08:00
|
|
|
void AppleAccelTableWriter::emitData() const {
|
[CodeGen] Refactor AppleAccelTable
Summary:
This commit separates the abstract accelerator table data structure
from the code for writing out an on-disk representation of a specific
accelerator table format. The idea is that former (now called
AccelTable<T>) can be reused for the DWARF v5 accelerator tables
as-is, without any further customizations.
Some bits of the emission code (now living in the EmissionContext class)
can be reused for DWARF v5 as well, but the subtle differences in the
layout of various subtables mean the sharing is not always possible.
(Also, the individual emit*** functions are fairly simple so there's a
tradeoff between making a bigger general-purpose function, and two
smaller targeted functions.)
Another advantage of this setup is that more of the serialization logic
can be hidden in the .cpp file -- I have moved declarations of the
header and all the emission functions there.
Reviewers: JDevlieghere, aprantl, probinson, dblaikie
Subscribers: echristo, clayborg, vleschuk, llvm-commits
Differential Revision: https://reviews.llvm.org/D43285
llvm-svn: 325516
2018-02-20 00:12:20 +08:00
|
|
|
const auto &Buckets = Contents.getBuckets();
|
2011-11-09 02:38:40 +08:00
|
|
|
for (size_t i = 0, e = Buckets.size(); i < e; ++i) {
|
2017-08-18 05:26:39 +08:00
|
|
|
uint64_t PrevHash = std::numeric_limits<uint64_t>::max();
|
2018-01-29 22:52:34 +08:00
|
|
|
for (auto &Hash : Buckets[i]) {
|
|
|
|
// Terminate the previous entry if there is no hash collision with the
|
|
|
|
// current one.
|
2017-08-18 05:26:39 +08:00
|
|
|
if (PrevHash != std::numeric_limits<uint64_t>::max() &&
|
2018-01-29 22:52:34 +08:00
|
|
|
PrevHash != Hash->HashValue)
|
2018-03-30 07:32:54 +08:00
|
|
|
Asm->emitInt32(0);
|
2011-11-07 17:18:42 +08:00
|
|
|
// Remember to emit the label for our offset.
|
2018-01-29 22:52:34 +08:00
|
|
|
Asm->OutStreamer->EmitLabel(Hash->Sym);
|
2018-02-09 18:06:56 +08:00
|
|
|
Asm->OutStreamer->AddComment(Hash->Name.getString());
|
|
|
|
Asm->emitDwarfStringOffset(Hash->Name);
|
2015-04-25 03:11:51 +08:00
|
|
|
Asm->OutStreamer->AddComment("Num DIEs");
|
2018-03-30 07:32:54 +08:00
|
|
|
Asm->emitInt32(Hash->Values.size());
|
[CodeGen] Refactor AppleAccelTable
Summary:
This commit separates the abstract accelerator table data structure
from the code for writing out an on-disk representation of a specific
accelerator table format. The idea is that former (now called
AccelTable<T>) can be reused for the DWARF v5 accelerator tables
as-is, without any further customizations.
Some bits of the emission code (now living in the EmissionContext class)
can be reused for DWARF v5 as well, but the subtle differences in the
layout of various subtables mean the sharing is not always possible.
(Also, the individual emit*** functions are fairly simple so there's a
tradeoff between making a bigger general-purpose function, and two
smaller targeted functions.)
Another advantage of this setup is that more of the serialization logic
can be hidden in the .cpp file -- I have moved declarations of the
header and all the emission functions there.
Reviewers: JDevlieghere, aprantl, probinson, dblaikie
Subscribers: echristo, clayborg, vleschuk, llvm-commits
Differential Revision: https://reviews.llvm.org/D43285
llvm-svn: 325516
2018-02-20 00:12:20 +08:00
|
|
|
for (const auto *V : Hash->Values)
|
|
|
|
static_cast<const AppleAccelTableData *>(V)->emit(Asm);
|
2018-01-29 22:52:34 +08:00
|
|
|
PrevHash = Hash->HashValue;
|
2011-11-07 17:18:42 +08:00
|
|
|
}
|
2015-03-10 08:46:31 +08:00
|
|
|
// Emit the final end marker for the bucket.
|
2015-03-10 11:47:55 +08:00
|
|
|
if (!Buckets[i].empty())
|
2018-03-30 07:32:54 +08:00
|
|
|
Asm->emitInt32(0);
|
2011-11-07 17:18:42 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-09 16:47:38 +08:00
|
|
|
void AppleAccelTableWriter::emit() const {
|
[CodeGen] Refactor AppleAccelTable
Summary:
This commit separates the abstract accelerator table data structure
from the code for writing out an on-disk representation of a specific
accelerator table format. The idea is that former (now called
AccelTable<T>) can be reused for the DWARF v5 accelerator tables
as-is, without any further customizations.
Some bits of the emission code (now living in the EmissionContext class)
can be reused for DWARF v5 as well, but the subtle differences in the
layout of various subtables mean the sharing is not always possible.
(Also, the individual emit*** functions are fairly simple so there's a
tradeoff between making a bigger general-purpose function, and two
smaller targeted functions.)
Another advantage of this setup is that more of the serialization logic
can be hidden in the .cpp file -- I have moved declarations of the
header and all the emission functions there.
Reviewers: JDevlieghere, aprantl, probinson, dblaikie
Subscribers: echristo, clayborg, vleschuk, llvm-commits
Differential Revision: https://reviews.llvm.org/D43285
llvm-svn: 325516
2018-02-20 00:12:20 +08:00
|
|
|
Header.emit(Asm);
|
|
|
|
HeaderData.emit(Asm);
|
|
|
|
emitBuckets();
|
|
|
|
emitHashes();
|
|
|
|
emitOffsets(SecBegin);
|
|
|
|
emitData();
|
2011-11-07 17:18:42 +08:00
|
|
|
}
|
|
|
|
|
2018-07-16 18:52:27 +08:00
|
|
|
template <typename DataT>
|
|
|
|
void Dwarf5AccelTableWriter<DataT>::Header::emit(
|
2018-07-09 16:47:38 +08:00
|
|
|
const Dwarf5AccelTableWriter &Ctx) const {
|
2018-04-09 22:38:53 +08:00
|
|
|
assert(CompUnitCount > 0 && "Index must have at least one CU.");
|
|
|
|
|
2018-04-04 22:42:14 +08:00
|
|
|
AsmPrinter *Asm = Ctx.Asm;
|
|
|
|
Asm->OutStreamer->AddComment("Header: unit length");
|
|
|
|
Asm->EmitLabelDifference(Ctx.ContributionEnd, Ctx.ContributionStart,
|
|
|
|
sizeof(uint32_t));
|
|
|
|
Asm->OutStreamer->EmitLabel(Ctx.ContributionStart);
|
|
|
|
Asm->OutStreamer->AddComment("Header: version");
|
|
|
|
Asm->emitInt16(Version);
|
|
|
|
Asm->OutStreamer->AddComment("Header: padding");
|
|
|
|
Asm->emitInt16(Padding);
|
|
|
|
Asm->OutStreamer->AddComment("Header: compilation unit count");
|
|
|
|
Asm->emitInt32(CompUnitCount);
|
|
|
|
Asm->OutStreamer->AddComment("Header: local type unit count");
|
|
|
|
Asm->emitInt32(LocalTypeUnitCount);
|
|
|
|
Asm->OutStreamer->AddComment("Header: foreign type unit count");
|
|
|
|
Asm->emitInt32(ForeignTypeUnitCount);
|
|
|
|
Asm->OutStreamer->AddComment("Header: bucket count");
|
|
|
|
Asm->emitInt32(BucketCount);
|
|
|
|
Asm->OutStreamer->AddComment("Header: name count");
|
|
|
|
Asm->emitInt32(NameCount);
|
|
|
|
Asm->OutStreamer->AddComment("Header: abbreviation table size");
|
|
|
|
Asm->EmitLabelDifference(Ctx.AbbrevEnd, Ctx.AbbrevStart, sizeof(uint32_t));
|
|
|
|
Asm->OutStreamer->AddComment("Header: augmentation string size");
|
|
|
|
assert(AugmentationStringSize % 4 == 0);
|
|
|
|
Asm->emitInt32(AugmentationStringSize);
|
|
|
|
Asm->OutStreamer->AddComment("Header: augmentation string");
|
|
|
|
Asm->OutStreamer->EmitBytes({AugmentationString, AugmentationStringSize});
|
|
|
|
}
|
|
|
|
|
2018-07-16 18:52:27 +08:00
|
|
|
template <typename DataT>
|
|
|
|
DenseSet<uint32_t> Dwarf5AccelTableWriter<DataT>::getUniqueTags() const {
|
2018-04-04 22:42:14 +08:00
|
|
|
DenseSet<uint32_t> UniqueTags;
|
|
|
|
for (auto &Bucket : Contents.getBuckets()) {
|
|
|
|
for (auto *Hash : Bucket) {
|
|
|
|
for (auto *Value : Hash->Values) {
|
2018-07-16 18:52:27 +08:00
|
|
|
unsigned Tag = static_cast<const DataT *>(Value)->getDieTag();
|
|
|
|
UniqueTags.insert(Tag);
|
2018-04-04 22:42:14 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return UniqueTags;
|
|
|
|
}
|
|
|
|
|
2018-07-16 18:52:27 +08:00
|
|
|
template <typename DataT>
|
|
|
|
SmallVector<typename Dwarf5AccelTableWriter<DataT>::AttributeEncoding, 2>
|
|
|
|
Dwarf5AccelTableWriter<DataT>::getUniformAttributes() const {
|
2018-04-04 22:42:14 +08:00
|
|
|
SmallVector<AttributeEncoding, 2> UA;
|
2018-07-11 00:18:56 +08:00
|
|
|
if (CompUnits.size() > 1) {
|
|
|
|
size_t LargestCUIndex = CompUnits.size() - 1;
|
2018-04-04 22:42:14 +08:00
|
|
|
dwarf::Form Form = DIEInteger::BestForm(/*IsSigned*/ false, LargestCUIndex);
|
|
|
|
UA.push_back({dwarf::DW_IDX_compile_unit, Form});
|
|
|
|
}
|
|
|
|
UA.push_back({dwarf::DW_IDX_die_offset, dwarf::DW_FORM_ref4});
|
|
|
|
return UA;
|
|
|
|
}
|
|
|
|
|
2018-07-16 18:52:27 +08:00
|
|
|
template <typename DataT>
|
|
|
|
void Dwarf5AccelTableWriter<DataT>::emitCUList() const {
|
2018-07-11 00:18:56 +08:00
|
|
|
for (const auto &CU : enumerate(CompUnits)) {
|
|
|
|
Asm->OutStreamer->AddComment("Compilation unit " + Twine(CU.index()));
|
2018-07-16 18:52:27 +08:00
|
|
|
Asm->emitDwarfSymbolReference(CU.value());
|
2018-04-04 22:42:14 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-16 18:52:27 +08:00
|
|
|
template <typename DataT>
|
|
|
|
void Dwarf5AccelTableWriter<DataT>::emitBuckets() const {
|
2018-04-04 22:42:14 +08:00
|
|
|
uint32_t Index = 1;
|
|
|
|
for (const auto &Bucket : enumerate(Contents.getBuckets())) {
|
|
|
|
Asm->OutStreamer->AddComment("Bucket " + Twine(Bucket.index()));
|
|
|
|
Asm->emitInt32(Bucket.value().empty() ? 0 : Index);
|
|
|
|
Index += Bucket.value().size();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-16 18:52:27 +08:00
|
|
|
template <typename DataT>
|
|
|
|
void Dwarf5AccelTableWriter<DataT>::emitStringOffsets() const {
|
2018-04-04 22:42:14 +08:00
|
|
|
for (const auto &Bucket : enumerate(Contents.getBuckets())) {
|
|
|
|
for (auto *Hash : Bucket.value()) {
|
|
|
|
DwarfStringPoolEntryRef String = Hash->Name;
|
|
|
|
Asm->OutStreamer->AddComment("String in Bucket " + Twine(Bucket.index()) +
|
|
|
|
": " + String.getString());
|
|
|
|
Asm->emitDwarfStringOffset(String);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-16 18:52:27 +08:00
|
|
|
template <typename DataT>
|
|
|
|
void Dwarf5AccelTableWriter<DataT>::emitAbbrevs() const {
|
2018-04-04 22:42:14 +08:00
|
|
|
Asm->OutStreamer->EmitLabel(AbbrevStart);
|
|
|
|
for (const auto &Abbrev : Abbreviations) {
|
|
|
|
Asm->OutStreamer->AddComment("Abbrev code");
|
|
|
|
assert(Abbrev.first != 0);
|
|
|
|
Asm->EmitULEB128(Abbrev.first);
|
|
|
|
Asm->OutStreamer->AddComment(dwarf::TagString(Abbrev.first));
|
|
|
|
Asm->EmitULEB128(Abbrev.first);
|
|
|
|
for (const auto &AttrEnc : Abbrev.second) {
|
|
|
|
Asm->EmitULEB128(AttrEnc.Index, dwarf::IndexString(AttrEnc.Index).data());
|
|
|
|
Asm->EmitULEB128(AttrEnc.Form,
|
|
|
|
dwarf::FormEncodingString(AttrEnc.Form).data());
|
|
|
|
}
|
|
|
|
Asm->EmitULEB128(0, "End of abbrev");
|
|
|
|
Asm->EmitULEB128(0, "End of abbrev");
|
|
|
|
}
|
|
|
|
Asm->EmitULEB128(0, "End of abbrev list");
|
|
|
|
Asm->OutStreamer->EmitLabel(AbbrevEnd);
|
|
|
|
}
|
|
|
|
|
2018-07-16 18:52:27 +08:00
|
|
|
template <typename DataT>
|
|
|
|
void Dwarf5AccelTableWriter<DataT>::emitEntry(const DataT &Entry) const {
|
|
|
|
auto AbbrevIt = Abbreviations.find(Entry.getDieTag());
|
2018-04-04 22:42:14 +08:00
|
|
|
assert(AbbrevIt != Abbreviations.end() &&
|
|
|
|
"Why wasn't this abbrev generated?");
|
|
|
|
|
|
|
|
Asm->EmitULEB128(AbbrevIt->first, "Abbreviation code");
|
|
|
|
for (const auto &AttrEnc : AbbrevIt->second) {
|
|
|
|
Asm->OutStreamer->AddComment(dwarf::IndexString(AttrEnc.Index));
|
|
|
|
switch (AttrEnc.Index) {
|
|
|
|
case dwarf::DW_IDX_compile_unit: {
|
2018-07-16 18:52:27 +08:00
|
|
|
DIEInteger ID(getCUIndexForEntry(Entry));
|
2018-04-04 22:42:14 +08:00
|
|
|
ID.EmitValue(Asm, AttrEnc.Form);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case dwarf::DW_IDX_die_offset:
|
|
|
|
assert(AttrEnc.Form == dwarf::DW_FORM_ref4);
|
2018-07-16 18:52:27 +08:00
|
|
|
Asm->emitInt32(Entry.getDieOffset());
|
2018-04-04 22:42:14 +08:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
llvm_unreachable("Unexpected index attribute!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-16 18:52:27 +08:00
|
|
|
template <typename DataT> void Dwarf5AccelTableWriter<DataT>::emitData() const {
|
2018-04-04 22:42:14 +08:00
|
|
|
Asm->OutStreamer->EmitLabel(EntryPool);
|
|
|
|
for (auto &Bucket : Contents.getBuckets()) {
|
|
|
|
for (auto *Hash : Bucket) {
|
|
|
|
// Remember to emit the label for our offset.
|
|
|
|
Asm->OutStreamer->EmitLabel(Hash->Sym);
|
|
|
|
for (const auto *Value : Hash->Values)
|
2018-07-16 18:52:27 +08:00
|
|
|
emitEntry(*static_cast<const DataT *>(Value));
|
2018-04-04 22:42:14 +08:00
|
|
|
Asm->OutStreamer->AddComment("End of list: " + Hash->Name.getString());
|
|
|
|
Asm->emitInt32(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-16 18:52:27 +08:00
|
|
|
template <typename DataT>
|
|
|
|
Dwarf5AccelTableWriter<DataT>::Dwarf5AccelTableWriter(
|
|
|
|
AsmPrinter *Asm, const AccelTableBase &Contents,
|
|
|
|
ArrayRef<MCSymbol *> CompUnits,
|
|
|
|
llvm::function_ref<unsigned(const DataT &)> getCUIndexForEntry)
|
2018-07-09 16:47:38 +08:00
|
|
|
: AccelTableWriter(Asm, Contents, false),
|
2018-07-11 00:18:56 +08:00
|
|
|
Header(CompUnits.size(), Contents.getBucketCount(),
|
2018-04-04 22:42:14 +08:00
|
|
|
Contents.getUniqueNameCount()),
|
2018-07-16 18:52:27 +08:00
|
|
|
CompUnits(CompUnits), getCUIndexForEntry(std::move(getCUIndexForEntry)) {
|
2018-04-04 22:42:14 +08:00
|
|
|
DenseSet<uint32_t> UniqueTags = getUniqueTags();
|
|
|
|
SmallVector<AttributeEncoding, 2> UniformAttributes = getUniformAttributes();
|
|
|
|
|
|
|
|
Abbreviations.reserve(UniqueTags.size());
|
|
|
|
for (uint32_t Tag : UniqueTags)
|
|
|
|
Abbreviations.try_emplace(Tag, UniformAttributes);
|
|
|
|
}
|
|
|
|
|
2018-07-16 18:52:27 +08:00
|
|
|
template <typename DataT> void Dwarf5AccelTableWriter<DataT>::emit() const {
|
2018-04-04 22:42:14 +08:00
|
|
|
Header.emit(*this);
|
|
|
|
emitCUList();
|
|
|
|
emitBuckets();
|
|
|
|
emitHashes();
|
|
|
|
emitStringOffsets();
|
|
|
|
emitOffsets(EntryPool);
|
|
|
|
emitAbbrevs();
|
|
|
|
emitData();
|
|
|
|
Asm->OutStreamer->EmitValueToAlignment(4, 0);
|
|
|
|
Asm->OutStreamer->EmitLabel(ContributionEnd);
|
|
|
|
}
|
|
|
|
|
[CodeGen] Refactor AppleAccelTable
Summary:
This commit separates the abstract accelerator table data structure
from the code for writing out an on-disk representation of a specific
accelerator table format. The idea is that former (now called
AccelTable<T>) can be reused for the DWARF v5 accelerator tables
as-is, without any further customizations.
Some bits of the emission code (now living in the EmissionContext class)
can be reused for DWARF v5 as well, but the subtle differences in the
layout of various subtables mean the sharing is not always possible.
(Also, the individual emit*** functions are fairly simple so there's a
tradeoff between making a bigger general-purpose function, and two
smaller targeted functions.)
Another advantage of this setup is that more of the serialization logic
can be hidden in the .cpp file -- I have moved declarations of the
header and all the emission functions there.
Reviewers: JDevlieghere, aprantl, probinson, dblaikie
Subscribers: echristo, clayborg, vleschuk, llvm-commits
Differential Revision: https://reviews.llvm.org/D43285
llvm-svn: 325516
2018-02-20 00:12:20 +08:00
|
|
|
void llvm::emitAppleAccelTableImpl(AsmPrinter *Asm, AccelTableBase &Contents,
|
|
|
|
StringRef Prefix, const MCSymbol *SecBegin,
|
|
|
|
ArrayRef<AppleAccelTableData::Atom> Atoms) {
|
|
|
|
Contents.finalize(Asm, Prefix);
|
2018-07-09 16:47:38 +08:00
|
|
|
AppleAccelTableWriter(Asm, Contents, Atoms, SecBegin).emit();
|
2018-01-29 22:52:34 +08:00
|
|
|
}
|
|
|
|
|
2018-04-04 22:42:14 +08:00
|
|
|
void llvm::emitDWARF5AccelTable(
|
|
|
|
AsmPrinter *Asm, AccelTable<DWARF5AccelTableData> &Contents,
|
|
|
|
const DwarfDebug &DD, ArrayRef<std::unique_ptr<DwarfCompileUnit>> CUs) {
|
2018-07-16 18:52:27 +08:00
|
|
|
std::vector<MCSymbol *> CompUnits;
|
2018-08-25 04:31:05 +08:00
|
|
|
SmallVector<unsigned, 1> CUIndex(CUs.size());
|
|
|
|
int Count = 0;
|
2018-07-16 18:52:27 +08:00
|
|
|
for (const auto &CU : enumerate(CUs)) {
|
2019-04-23 06:45:11 +08:00
|
|
|
if (CU.value()->getCUNode()->getNameTableKind() !=
|
|
|
|
DICompileUnit::DebugNameTableKind::Default)
|
2018-08-17 05:29:55 +08:00
|
|
|
continue;
|
2018-08-25 04:31:05 +08:00
|
|
|
CUIndex[CU.index()] = Count++;
|
2018-07-16 18:52:27 +08:00
|
|
|
assert(CU.index() == CU.value()->getUniqueID());
|
|
|
|
const DwarfCompileUnit *MainCU =
|
|
|
|
DD.useSplitDwarf() ? CU.value()->getSkeleton() : CU.value().get();
|
|
|
|
CompUnits.push_back(MainCU->getLabelBegin());
|
|
|
|
}
|
|
|
|
|
2018-08-17 05:29:55 +08:00
|
|
|
if (CompUnits.empty())
|
|
|
|
return;
|
|
|
|
|
|
|
|
Asm->OutStreamer->SwitchSection(
|
|
|
|
Asm->getObjFileLowering().getDwarfDebugNamesSection());
|
|
|
|
|
2018-04-04 22:42:14 +08:00
|
|
|
Contents.finalize(Asm, "names");
|
2018-07-16 18:52:27 +08:00
|
|
|
Dwarf5AccelTableWriter<DWARF5AccelTableData>(
|
|
|
|
Asm, Contents, CompUnits,
|
2018-08-25 04:31:05 +08:00
|
|
|
[&](const DWARF5AccelTableData &Entry) {
|
2018-07-16 18:52:27 +08:00
|
|
|
const DIE *CUDie = Entry.getDie().getUnitDie();
|
2018-08-25 04:31:05 +08:00
|
|
|
return CUIndex[DD.lookupCU(CUDie)->getUniqueID()];
|
2018-07-16 18:52:27 +08:00
|
|
|
})
|
|
|
|
.emit();
|
|
|
|
}
|
|
|
|
|
|
|
|
void llvm::emitDWARF5AccelTable(
|
|
|
|
AsmPrinter *Asm, AccelTable<DWARF5AccelTableStaticData> &Contents,
|
|
|
|
ArrayRef<MCSymbol *> CUs,
|
|
|
|
llvm::function_ref<unsigned(const DWARF5AccelTableStaticData &)>
|
|
|
|
getCUIndexForEntry) {
|
|
|
|
Contents.finalize(Asm, "names");
|
|
|
|
Dwarf5AccelTableWriter<DWARF5AccelTableStaticData>(Asm, Contents, CUs,
|
|
|
|
getCUIndexForEntry)
|
|
|
|
.emit();
|
2018-04-04 22:42:14 +08:00
|
|
|
}
|
|
|
|
|
2018-01-29 22:52:34 +08:00
|
|
|
void AppleAccelTableOffsetData::emit(AsmPrinter *Asm) const {
|
2018-07-20 23:24:13 +08:00
|
|
|
Asm->emitInt32(Die.getDebugSectionOffset());
|
2018-01-29 22:52:34 +08:00
|
|
|
}
|
2011-11-07 17:18:42 +08:00
|
|
|
|
2018-01-29 22:52:34 +08:00
|
|
|
void AppleAccelTableTypeData::emit(AsmPrinter *Asm) const {
|
2018-07-20 23:24:13 +08:00
|
|
|
Asm->emitInt32(Die.getDebugSectionOffset());
|
|
|
|
Asm->emitInt16(Die.getTag());
|
2018-03-30 07:32:54 +08:00
|
|
|
Asm->emitInt8(0);
|
2011-11-07 17:18:42 +08:00
|
|
|
}
|
2018-01-29 22:52:50 +08:00
|
|
|
|
|
|
|
void AppleAccelTableStaticOffsetData::emit(AsmPrinter *Asm) const {
|
2018-03-30 07:32:54 +08:00
|
|
|
Asm->emitInt32(Offset);
|
2018-01-29 22:52:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void AppleAccelTableStaticTypeData::emit(AsmPrinter *Asm) const {
|
2018-03-30 07:32:54 +08:00
|
|
|
Asm->emitInt32(Offset);
|
|
|
|
Asm->emitInt16(Tag);
|
|
|
|
Asm->emitInt8(ObjCClassIsImplementation ? dwarf::DW_FLAG_type_implementation
|
2018-01-29 22:52:50 +08:00
|
|
|
: 0);
|
2018-03-30 07:32:54 +08:00
|
|
|
Asm->emitInt32(QualifiedNameHash);
|
2018-01-29 22:52:50 +08:00
|
|
|
}
|
2018-01-30 01:28:51 +08:00
|
|
|
|
|
|
|
#ifndef _MSC_VER
|
|
|
|
// The lines below are rejected by older versions (TBD) of MSVC.
|
[CodeGen] Refactor AppleAccelTable
Summary:
This commit separates the abstract accelerator table data structure
from the code for writing out an on-disk representation of a specific
accelerator table format. The idea is that former (now called
AccelTable<T>) can be reused for the DWARF v5 accelerator tables
as-is, without any further customizations.
Some bits of the emission code (now living in the EmissionContext class)
can be reused for DWARF v5 as well, but the subtle differences in the
layout of various subtables mean the sharing is not always possible.
(Also, the individual emit*** functions are fairly simple so there's a
tradeoff between making a bigger general-purpose function, and two
smaller targeted functions.)
Another advantage of this setup is that more of the serialization logic
can be hidden in the .cpp file -- I have moved declarations of the
header and all the emission functions there.
Reviewers: JDevlieghere, aprantl, probinson, dblaikie
Subscribers: echristo, clayborg, vleschuk, llvm-commits
Differential Revision: https://reviews.llvm.org/D43285
llvm-svn: 325516
2018-02-20 00:12:20 +08:00
|
|
|
constexpr AppleAccelTableData::Atom AppleAccelTableTypeData::Atoms[];
|
|
|
|
constexpr AppleAccelTableData::Atom AppleAccelTableOffsetData::Atoms[];
|
|
|
|
constexpr AppleAccelTableData::Atom AppleAccelTableStaticOffsetData::Atoms[];
|
|
|
|
constexpr AppleAccelTableData::Atom AppleAccelTableStaticTypeData::Atoms[];
|
2018-01-30 01:28:51 +08:00
|
|
|
#else
|
|
|
|
// FIXME: Erase this path once the minimum MSCV version has been bumped.
|
[CodeGen] Refactor AppleAccelTable
Summary:
This commit separates the abstract accelerator table data structure
from the code for writing out an on-disk representation of a specific
accelerator table format. The idea is that former (now called
AccelTable<T>) can be reused for the DWARF v5 accelerator tables
as-is, without any further customizations.
Some bits of the emission code (now living in the EmissionContext class)
can be reused for DWARF v5 as well, but the subtle differences in the
layout of various subtables mean the sharing is not always possible.
(Also, the individual emit*** functions are fairly simple so there's a
tradeoff between making a bigger general-purpose function, and two
smaller targeted functions.)
Another advantage of this setup is that more of the serialization logic
can be hidden in the .cpp file -- I have moved declarations of the
header and all the emission functions there.
Reviewers: JDevlieghere, aprantl, probinson, dblaikie
Subscribers: echristo, clayborg, vleschuk, llvm-commits
Differential Revision: https://reviews.llvm.org/D43285
llvm-svn: 325516
2018-02-20 00:12:20 +08:00
|
|
|
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>
|
2018-01-30 01:28:51 +08:00
|
|
|
AppleAccelTableStaticTypeData::Atoms = {
|
[CodeGen] Refactor AppleAccelTable
Summary:
This commit separates the abstract accelerator table data structure
from the code for writing out an on-disk representation of a specific
accelerator table format. The idea is that former (now called
AccelTable<T>) can be reused for the DWARF v5 accelerator tables
as-is, without any further customizations.
Some bits of the emission code (now living in the EmissionContext class)
can be reused for DWARF v5 as well, but the subtle differences in the
layout of various subtables mean the sharing is not always possible.
(Also, the individual emit*** functions are fairly simple so there's a
tradeoff between making a bigger general-purpose function, and two
smaller targeted functions.)
Another advantage of this setup is that more of the serialization logic
can be hidden in the .cpp file -- I have moved declarations of the
header and all the emission functions there.
Reviewers: JDevlieghere, aprantl, probinson, dblaikie
Subscribers: echristo, clayborg, vleschuk, llvm-commits
Differential Revision: https://reviews.llvm.org/D43285
llvm-svn: 325516
2018-02-20 00:12:20 +08:00
|
|
|
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)};
|
2018-01-30 01:28:51 +08:00
|
|
|
#endif
|
2018-01-30 21:36:30 +08:00
|
|
|
|
|
|
|
#ifndef NDEBUG
|
2018-07-09 16:47:38 +08:00
|
|
|
void AppleAccelTableWriter::Header::print(raw_ostream &OS) const {
|
2018-01-30 21:36:30 +08:00
|
|
|
OS << "Magic: " << format("0x%x", Magic) << "\n"
|
|
|
|
<< "Version: " << Version << "\n"
|
|
|
|
<< "Hash Function: " << HashFunction << "\n"
|
|
|
|
<< "Bucket Count: " << BucketCount << "\n"
|
|
|
|
<< "Header Data Length: " << HeaderDataLength << "\n";
|
|
|
|
}
|
|
|
|
|
[CodeGen] Refactor AppleAccelTable
Summary:
This commit separates the abstract accelerator table data structure
from the code for writing out an on-disk representation of a specific
accelerator table format. The idea is that former (now called
AccelTable<T>) can be reused for the DWARF v5 accelerator tables
as-is, without any further customizations.
Some bits of the emission code (now living in the EmissionContext class)
can be reused for DWARF v5 as well, but the subtle differences in the
layout of various subtables mean the sharing is not always possible.
(Also, the individual emit*** functions are fairly simple so there's a
tradeoff between making a bigger general-purpose function, and two
smaller targeted functions.)
Another advantage of this setup is that more of the serialization logic
can be hidden in the .cpp file -- I have moved declarations of the
header and all the emission functions there.
Reviewers: JDevlieghere, aprantl, probinson, dblaikie
Subscribers: echristo, clayborg, vleschuk, llvm-commits
Differential Revision: https://reviews.llvm.org/D43285
llvm-svn: 325516
2018-02-20 00:12:20 +08:00
|
|
|
void AppleAccelTableData::Atom::print(raw_ostream &OS) const {
|
2018-01-30 21:36:30 +08:00
|
|
|
OS << "Type: " << dwarf::AtomTypeString(Type) << "\n"
|
|
|
|
<< "Form: " << dwarf::FormEncodingString(Form) << "\n";
|
|
|
|
}
|
|
|
|
|
2018-07-09 16:47:38 +08:00
|
|
|
void AppleAccelTableWriter::HeaderData::print(raw_ostream &OS) const {
|
2018-01-30 21:36:30 +08:00
|
|
|
OS << "DIE Offset Base: " << DieOffsetBase << "\n";
|
|
|
|
for (auto Atom : Atoms)
|
|
|
|
Atom.print(OS);
|
|
|
|
}
|
|
|
|
|
2018-07-09 16:47:38 +08:00
|
|
|
void AppleAccelTableWriter::print(raw_ostream &OS) const {
|
2018-01-30 21:36:30 +08:00
|
|
|
Header.print(OS);
|
|
|
|
HeaderData.print(OS);
|
[CodeGen] Refactor AppleAccelTable
Summary:
This commit separates the abstract accelerator table data structure
from the code for writing out an on-disk representation of a specific
accelerator table format. The idea is that former (now called
AccelTable<T>) can be reused for the DWARF v5 accelerator tables
as-is, without any further customizations.
Some bits of the emission code (now living in the EmissionContext class)
can be reused for DWARF v5 as well, but the subtle differences in the
layout of various subtables mean the sharing is not always possible.
(Also, the individual emit*** functions are fairly simple so there's a
tradeoff between making a bigger general-purpose function, and two
smaller targeted functions.)
Another advantage of this setup is that more of the serialization logic
can be hidden in the .cpp file -- I have moved declarations of the
header and all the emission functions there.
Reviewers: JDevlieghere, aprantl, probinson, dblaikie
Subscribers: echristo, clayborg, vleschuk, llvm-commits
Differential Revision: https://reviews.llvm.org/D43285
llvm-svn: 325516
2018-02-20 00:12:20 +08:00
|
|
|
Contents.print(OS);
|
|
|
|
SecBegin->print(OS, nullptr);
|
2018-01-30 21:36:30 +08:00
|
|
|
}
|
|
|
|
|
[CodeGen] Refactor AppleAccelTable
Summary:
This commit separates the abstract accelerator table data structure
from the code for writing out an on-disk representation of a specific
accelerator table format. The idea is that former (now called
AccelTable<T>) can be reused for the DWARF v5 accelerator tables
as-is, without any further customizations.
Some bits of the emission code (now living in the EmissionContext class)
can be reused for DWARF v5 as well, but the subtle differences in the
layout of various subtables mean the sharing is not always possible.
(Also, the individual emit*** functions are fairly simple so there's a
tradeoff between making a bigger general-purpose function, and two
smaller targeted functions.)
Another advantage of this setup is that more of the serialization logic
can be hidden in the .cpp file -- I have moved declarations of the
header and all the emission functions there.
Reviewers: JDevlieghere, aprantl, probinson, dblaikie
Subscribers: echristo, clayborg, vleschuk, llvm-commits
Differential Revision: https://reviews.llvm.org/D43285
llvm-svn: 325516
2018-02-20 00:12:20 +08:00
|
|
|
void AccelTableBase::HashData::print(raw_ostream &OS) const {
|
2018-02-09 18:06:56 +08:00
|
|
|
OS << "Name: " << Name.getString() << "\n";
|
2018-01-30 21:36:30 +08:00
|
|
|
OS << " Hash Value: " << format("0x%x", HashValue) << "\n";
|
|
|
|
OS << " Symbol: ";
|
|
|
|
if (Sym)
|
|
|
|
OS << *Sym;
|
|
|
|
else
|
|
|
|
OS << "<none>";
|
|
|
|
OS << "\n";
|
2018-02-09 18:06:56 +08:00
|
|
|
for (auto *Value : Values)
|
2018-01-30 21:36:30 +08:00
|
|
|
Value->print(OS);
|
|
|
|
}
|
|
|
|
|
[CodeGen] Refactor AppleAccelTable
Summary:
This commit separates the abstract accelerator table data structure
from the code for writing out an on-disk representation of a specific
accelerator table format. The idea is that former (now called
AccelTable<T>) can be reused for the DWARF v5 accelerator tables
as-is, without any further customizations.
Some bits of the emission code (now living in the EmissionContext class)
can be reused for DWARF v5 as well, but the subtle differences in the
layout of various subtables mean the sharing is not always possible.
(Also, the individual emit*** functions are fairly simple so there's a
tradeoff between making a bigger general-purpose function, and two
smaller targeted functions.)
Another advantage of this setup is that more of the serialization logic
can be hidden in the .cpp file -- I have moved declarations of the
header and all the emission functions there.
Reviewers: JDevlieghere, aprantl, probinson, dblaikie
Subscribers: echristo, clayborg, vleschuk, llvm-commits
Differential Revision: https://reviews.llvm.org/D43285
llvm-svn: 325516
2018-02-20 00:12:20 +08:00
|
|
|
void AccelTableBase::print(raw_ostream &OS) const {
|
2018-01-30 21:36:30 +08:00
|
|
|
// Print Content.
|
|
|
|
OS << "Entries: \n";
|
|
|
|
for (const auto &Entry : Entries) {
|
|
|
|
OS << "Name: " << Entry.first() << "\n";
|
|
|
|
for (auto *V : Entry.second.Values)
|
|
|
|
V->print(OS);
|
|
|
|
}
|
|
|
|
|
|
|
|
OS << "Buckets and Hashes: \n";
|
|
|
|
for (auto &Bucket : Buckets)
|
|
|
|
for (auto &Hash : Bucket)
|
|
|
|
Hash->print(OS);
|
|
|
|
|
|
|
|
OS << "Data: \n";
|
2018-02-09 18:06:56 +08:00
|
|
|
for (auto &E : Entries)
|
|
|
|
E.second.print(OS);
|
2018-01-30 21:36:30 +08:00
|
|
|
}
|
|
|
|
|
2018-04-04 22:42:14 +08:00
|
|
|
void DWARF5AccelTableData::print(raw_ostream &OS) const {
|
2018-07-16 18:52:27 +08:00
|
|
|
OS << " Offset: " << getDieOffset() << "\n";
|
|
|
|
OS << " Tag: " << dwarf::TagString(getDieTag()) << "\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
void DWARF5AccelTableStaticData::print(raw_ostream &OS) const {
|
|
|
|
OS << " Offset: " << getDieOffset() << "\n";
|
|
|
|
OS << " Tag: " << dwarf::TagString(getDieTag()) << "\n";
|
2018-04-04 22:42:14 +08:00
|
|
|
}
|
|
|
|
|
2018-01-30 21:36:30 +08:00
|
|
|
void AppleAccelTableOffsetData::print(raw_ostream &OS) const {
|
2018-07-20 23:40:24 +08:00
|
|
|
OS << " Offset: " << Die.getOffset() << "\n";
|
2018-01-30 21:36:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void AppleAccelTableTypeData::print(raw_ostream &OS) const {
|
2018-07-20 23:40:24 +08:00
|
|
|
OS << " Offset: " << Die.getOffset() << "\n";
|
|
|
|
OS << " Tag: " << dwarf::TagString(Die.getTag()) << "\n";
|
2018-01-30 21:36:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void AppleAccelTableStaticOffsetData::print(raw_ostream &OS) const {
|
|
|
|
OS << " Static Offset: " << Offset << "\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
void AppleAccelTableStaticTypeData::print(raw_ostream &OS) const {
|
|
|
|
OS << " Static Offset: " << Offset << "\n";
|
|
|
|
OS << " QualifiedNameHash: " << format("%x\n", QualifiedNameHash) << "\n";
|
|
|
|
OS << " Tag: " << dwarf::TagString(Tag) << "\n";
|
|
|
|
OS << " ObjCClassIsImplementation: "
|
|
|
|
<< (ObjCClassIsImplementation ? "true" : "false");
|
|
|
|
OS << "\n";
|
|
|
|
}
|
|
|
|
#endif
|