/// base is used to describe the offset for all forms in the list of atoms.
uint32_t DieOffsetBase;
- SmallVector<Atom, 3> Atoms;
+ const SmallVector<Atom, 4> Atoms;
+#ifndef _MSC_VER
+ // See the `static constexpr` below why we need an alternative
+ // implementation for MSVC.
HeaderData(ArrayRef<Atom> AtomList, uint32_t Offset = 0)
: DieOffsetBase(Offset), Atoms(AtomList.begin(), AtomList.end()) {}
+#else
+ // FIXME: Erase this path once the minimum MSCV version has been bumped.
+ HeaderData(const SmallVectorImpl<Atom> &Atoms, uint32_t Offset = 0)
+ : DieOffsetBase(Offset), Atoms(Atoms.begin(), Atoms.end()) {}
+#endif
#ifndef NDEBUG
void print(raw_ostream &OS) const {
public:
/// The length of the header data is always going to be 4 + 4 + 4*NumAtoms.
+#ifndef _MSC_VER
+ // See the `static constexpr` below why we need an alternative implementation
+ // for MSVC.
AppleAccelTableHeader(ArrayRef<AppleAccelTableHeader::Atom> Atoms)
: Header(8 + (Atoms.size() * 4)), HeaderData(Atoms) {}
+#else
+ // FIXME: Erase this path once the minimum MSCV version has been bumped.
+ AppleAccelTableHeader(const SmallVectorImpl<Atom> &Atoms)
+ : Header(8 + (Atoms.size() * 4)), HeaderData(Atoms) {}
+#endif
/// Update header with hash and bucket count.
void setBucketAndHashCount(uint32_t HashCount);
using BucketList = std::vector<HashList>;
BucketList Buckets;
+#ifndef _MSC_VER
+ // See the `static constexpr` below why we need an alternative implementation
+ // for MSVC.
AppleAccelTableBase(ArrayRef<AppleAccelTableHeader::Atom> Atoms)
: Header(Atoms), Entries(Allocator) {}
+#else
+ // FIXME: Erase this path once the minimum MSCV version has been bumped.
+ AppleAccelTableBase(const SmallVectorImpl<AppleAccelTableHeader::Atom> &Atoms)
+ : Header(Atoms), Entries(Allocator) {}
+#endif
private:
/// Emits the header for the table via the AsmPrinter.
void emit(AsmPrinter *Asm) const override;
- static constexpr const AppleAccelTableHeader::Atom Atoms[] = {
+#ifndef _MSC_VER
+ // The line below is rejected by older versions (TBD) of MSVC.
+ static constexpr AppleAccelTableHeader::Atom Atoms[] = {
AppleAccelTableHeader::Atom(dwarf::DW_ATOM_die_offset,
dwarf::DW_FORM_data4)};
+#else
+ // FIXME: Erase this path once the minimum MSCV version has been bumped.
+ static const SmallVector<AppleAccelTableHeader::Atom, 4> Atoms;
+#endif
#ifndef NDEBUG
void print(raw_ostream &OS) const override {
void emit(AsmPrinter *Asm) const override;
- static constexpr const AppleAccelTableHeader::Atom Atoms[] = {
+#ifndef _MSC_VER
+ // The line below is rejected by older versions (TBD) of MSVC.
+ static constexpr AppleAccelTableHeader::Atom Atoms[] = {
AppleAccelTableHeader::Atom(dwarf::DW_ATOM_die_offset,
dwarf::DW_FORM_data4),
AppleAccelTableHeader::Atom(dwarf::DW_ATOM_die_tag, dwarf::DW_FORM_data2),
AppleAccelTableHeader::Atom(dwarf::DW_ATOM_type_flags,
dwarf::DW_FORM_data1)};
+#else
+ // FIXME: Erase this path once the minimum MSCV version has been bumped.
+ static const SmallVector<AppleAccelTableHeader::Atom, 4> Atoms;
+#endif
#ifndef NDEBUG
void print(raw_ostream &OS) const override {
void emit(AsmPrinter *Asm) const override;
- static constexpr const AppleAccelTableHeader::Atom Atoms[] = {
+#ifndef _MSC_VER
+ // The line below is rejected by older versions (TBD) of MSVC.
+ static constexpr AppleAccelTableHeader::Atom Atoms[] = {
AppleAccelTableHeader::Atom(dwarf::DW_ATOM_die_offset,
dwarf::DW_FORM_data4)};
+#else
+ // FIXME: Erase this path once the minimum MSCV version has been bumped.
+ static const SmallVector<AppleAccelTableHeader::Atom, 4> Atoms;
+#endif
#ifndef NDEBUG
void print(raw_ostream &OS) const override {
void emit(AsmPrinter *Asm) const override;
- static constexpr const AppleAccelTableHeader::Atom Atoms[] = {
+#ifndef _MSC_VER
+ // The line below is rejected by older versions (TBD) of MSVC.
+ static constexpr AppleAccelTableHeader::Atom Atoms[] = {
AppleAccelTableHeader::Atom(dwarf::DW_ATOM_die_offset,
dwarf::DW_FORM_data4),
AppleAccelTableHeader::Atom(dwarf::DW_ATOM_die_tag, dwarf::DW_FORM_data2),
AppleAccelTableHeader::Atom(5, dwarf::DW_FORM_data1),
AppleAccelTableHeader::Atom(6, dwarf::DW_FORM_data4)};
+#else
+ // FIXME: Erase this path once the minimum MSCV version has been bumped.
+ static const SmallVector<AppleAccelTableHeader::Atom, 4> Atoms;
+#endif
#ifndef NDEBUG
void print(raw_ostream &OS) const override {
Header.HashCount = HashCount;
}
-constexpr const AppleAccelTableHeader::Atom AppleAccelTableTypeData::Atoms[];
-constexpr const AppleAccelTableHeader::Atom AppleAccelTableOffsetData::Atoms[];
-constexpr const AppleAccelTableHeader::Atom AppleAccelTableStaticOffsetData::Atoms[];
-constexpr const AppleAccelTableHeader::Atom AppleAccelTableStaticTypeData::Atoms[];
-
void AppleAccelTableBase::emitHeader(AsmPrinter *Asm) { Header.emit(Asm); }
void AppleAccelTableBase::emitBuckets(AsmPrinter *Asm) {
: 0);
Asm->EmitInt32(QualifiedNameHash);
}
+
+#ifndef _MSC_VER
+// The lines below are rejected by older versions (TBD) of MSVC.
+constexpr AppleAccelTableHeader::Atom AppleAccelTableTypeData::Atoms[];
+constexpr AppleAccelTableHeader::Atom AppleAccelTableOffsetData::Atoms[];
+constexpr AppleAccelTableHeader::Atom AppleAccelTableStaticOffsetData::Atoms[];
+constexpr AppleAccelTableHeader::Atom AppleAccelTableStaticTypeData::Atoms[];
+#else
+// FIXME: Erase this path once the minimum MSCV version has been bumped.
+const SmallVector<AppleAccelTableHeader::Atom, 4>
+ AppleAccelTableOffsetData::Atoms = {AppleAccelTableHeader::Atom(
+ dwarf::DW_ATOM_die_offset, dwarf::DW_FORM_data4)};
+const SmallVector<AppleAccelTableHeader::Atom, 4>
+ AppleAccelTableTypeData::Atoms = {
+ AppleAccelTableHeader::Atom(dwarf::DW_ATOM_die_offset,
+ dwarf::DW_FORM_data4),
+ AppleAccelTableHeader::Atom(dwarf::DW_ATOM_die_tag,
+ dwarf::DW_FORM_data2),
+ AppleAccelTableHeader::Atom(dwarf::DW_ATOM_type_flags,
+ dwarf::DW_FORM_data1)};
+const SmallVector<AppleAccelTableHeader::Atom, 4>
+ AppleAccelTableStaticOffsetData::Atoms = {AppleAccelTableHeader::Atom(
+ dwarf::DW_ATOM_die_offset, dwarf::DW_FORM_data4)};
+const SmallVector<AppleAccelTableHeader::Atom, 4>
+ AppleAccelTableStaticTypeData::Atoms = {
+ AppleAccelTableHeader::Atom(dwarf::DW_ATOM_die_offset,
+ dwarf::DW_FORM_data4),
+ AppleAccelTableHeader::Atom(dwarf::DW_ATOM_die_tag,
+ dwarf::DW_FORM_data2),
+ AppleAccelTableHeader::Atom(5, dwarf::DW_FORM_data1),
+ AppleAccelTableHeader::Atom(6, dwarf::DW_FORM_data4)};
+#endif