Update clang to r339409.
Change-Id: I800772d2d838223be1f6b40d490c4591b937fca2
diff --git a/linux-x64/clang/include/llvm/CodeGen/AccelTable.h b/linux-x64/clang/include/llvm/CodeGen/AccelTable.h
index ec850a8..1392858 100644
--- a/linux-x64/clang/include/llvm/CodeGen/AccelTable.h
+++ b/linux-x64/clang/include/llvm/CodeGen/AccelTable.h
@@ -108,6 +108,8 @@
namespace llvm {
class AsmPrinter;
+class DwarfCompileUnit;
+class DwarfDebug;
/// Interface which the different types of accelerator table data have to
/// conform. It serves as a base class for different values of the template
@@ -120,8 +122,8 @@
return order() < Other.order();
}
- // Subclasses should implement:
- // static uint32_t hash(StringRef Name);
+ // Subclasses should implement:
+ // static uint32_t hash(StringRef Name);
#ifndef NDEBUG
virtual void print(raw_ostream &OS) const = 0;
@@ -244,6 +246,54 @@
static uint32_t hash(StringRef Buffer) { return djbHash(Buffer); }
};
+/// The Data class implementation for DWARF v5 accelerator table. Unlike the
+/// Apple Data classes, this class is just a DIE wrapper, and does not know to
+/// serialize itself. The complete serialization logic is in the
+/// emitDWARF5AccelTable function.
+class DWARF5AccelTableData : public AccelTableData {
+public:
+ static uint32_t hash(StringRef Name) { return caseFoldingDjbHash(Name); }
+
+ DWARF5AccelTableData(const DIE &Die) : Die(Die) {}
+
+#ifndef NDEBUG
+ void print(raw_ostream &OS) const override;
+#endif
+
+ const DIE &getDie() const { return Die; }
+ uint64_t getDieOffset() const { return Die.getOffset(); }
+ unsigned getDieTag() const { return Die.getTag(); }
+
+protected:
+ const DIE &Die;
+
+ uint64_t order() const override { return Die.getOffset(); }
+};
+
+class DWARF5AccelTableStaticData : public AccelTableData {
+public:
+ static uint32_t hash(StringRef Name) { return caseFoldingDjbHash(Name); }
+
+ DWARF5AccelTableStaticData(uint64_t DieOffset, unsigned DieTag,
+ unsigned CUIndex)
+ : DieOffset(DieOffset), DieTag(DieTag), CUIndex(CUIndex) {}
+
+#ifndef NDEBUG
+ void print(raw_ostream &OS) const override;
+#endif
+
+ uint64_t getDieOffset() const { return DieOffset; }
+ unsigned getDieTag() const { return DieTag; }
+ unsigned getCUIndex() const { return CUIndex; }
+
+protected:
+ uint64_t DieOffset;
+ unsigned DieTag;
+ unsigned CUIndex;
+
+ uint64_t order() const override { return DieOffset; }
+};
+
void emitAppleAccelTableImpl(AsmPrinter *Asm, AccelTableBase &Contents,
StringRef Prefix, const MCSymbol *SecBegin,
ArrayRef<AppleAccelTableData::Atom> Atoms);
@@ -258,11 +308,22 @@
emitAppleAccelTableImpl(Asm, Contents, Prefix, SecBegin, DataT::Atoms);
}
+void emitDWARF5AccelTable(AsmPrinter *Asm,
+ AccelTable<DWARF5AccelTableData> &Contents,
+ const DwarfDebug &DD,
+ ArrayRef<std::unique_ptr<DwarfCompileUnit>> CUs);
+
+void emitDWARF5AccelTable(
+ AsmPrinter *Asm, AccelTable<DWARF5AccelTableStaticData> &Contents,
+ ArrayRef<MCSymbol *> CUs,
+ llvm::function_ref<unsigned(const DWARF5AccelTableStaticData &)>
+ getCUIndexForEntry);
+
/// Accelerator table data implementation for simple Apple accelerator tables
/// with just a DIE reference.
class AppleAccelTableOffsetData : public AppleAccelTableData {
public:
- AppleAccelTableOffsetData(const DIE *D) : Die(D) {}
+ AppleAccelTableOffsetData(const DIE &D) : Die(D) {}
void emit(AsmPrinter *Asm) const override;
@@ -279,15 +340,15 @@
void print(raw_ostream &OS) const override;
#endif
protected:
- uint64_t order() const override { return Die->getOffset(); }
+ uint64_t order() const override { return Die.getOffset(); }
- const DIE *Die;
+ const DIE &Die;
};
/// Accelerator table data implementation for Apple type accelerator tables.
class AppleAccelTableTypeData : public AppleAccelTableOffsetData {
public:
- AppleAccelTableTypeData(const DIE *D) : AppleAccelTableOffsetData(D) {}
+ AppleAccelTableTypeData(const DIE &D) : AppleAccelTableOffsetData(D) {}
void emit(AsmPrinter *Asm) const override;