Update prebuilt Clang to r416183b from Android.
https://android.googlesource.com/platform/prebuilts/clang/host/
linux-x86/+/06a71ddac05c22edb2d10b590e1769b3f8619bef
clang 12.0.5 (based on r416183b) from build 7284624.
Change-Id: I277a316abcf47307562d8b748b84870f31a72866
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
diff --git a/linux-x64/clang/include/llvm/MC/MCSection.h b/linux-x64/clang/include/llvm/MC/MCSection.h
index 6fad1ec..a68e06e 100644
--- a/linux-x64/clang/include/llvm/MC/MCSection.h
+++ b/linux-x64/clang/include/llvm/MC/MCSection.h
@@ -17,6 +17,7 @@
#include "llvm/ADT/ilist.h"
#include "llvm/MC/MCFragment.h"
#include "llvm/MC/SectionKind.h"
+#include "llvm/Support/Alignment.h"
#include <cassert>
#include <utility>
@@ -37,6 +38,8 @@
/// current translation unit. The MCContext class uniques and creates these.
class MCSection {
public:
+ static constexpr unsigned NonUniqueID = ~0U;
+
enum SectionVariant { SV_COFF = 0, SV_ELF, SV_MachO, SV_Wasm, SV_XCOFF };
/// Express the state of bundle locked groups while emitting code.
@@ -58,7 +61,7 @@
MCSymbol *Begin;
MCSymbol *End = nullptr;
/// The alignment requirement of this section.
- unsigned Alignment = 1;
+ Align Alignment;
/// The section index in the assemblers section list.
unsigned Ordinal = 0;
/// The index of this section in the layout order.
@@ -77,10 +80,6 @@
/// Whether this section has had instructions emitted into it.
bool HasInstructions : 1;
- /// Whether this section has had data emitted into it.
- /// Right now this is only used by the ARM backend.
- bool HasData : 1;
-
bool IsRegistered : 1;
MCDummyFragment DummyFragment;
@@ -91,17 +90,29 @@
/// below that number.
SmallVector<std::pair<unsigned, MCFragment *>, 1> SubsectionFragmentMap;
+ /// State for tracking labels that don't yet have Fragments
+ struct PendingLabel {
+ MCSymbol* Sym;
+ unsigned Subsection;
+ PendingLabel(MCSymbol* Sym, unsigned Subsection = 0)
+ : Sym(Sym), Subsection(Subsection) {}
+ };
+ SmallVector<PendingLabel, 2> PendingLabels;
+
protected:
+ // TODO Make Name private when possible.
+ StringRef Name;
SectionVariant Variant;
SectionKind Kind;
- MCSection(SectionVariant V, SectionKind K, MCSymbol *Begin);
+ MCSection(SectionVariant V, StringRef Name, SectionKind K, MCSymbol *Begin);
~MCSection();
public:
MCSection(const MCSection &) = delete;
MCSection &operator=(const MCSection &) = delete;
+ StringRef getName() const { return Name; }
SectionKind getKind() const { return Kind; }
SectionVariant getVariant() const { return Variant; }
@@ -117,8 +128,8 @@
MCSymbol *getEndSymbol(MCContext &Ctx);
bool hasEnded() const;
- unsigned getAlignment() const { return Alignment; }
- void setAlignment(unsigned Value) { Alignment = Value; }
+ unsigned getAlignment() const { return Alignment.value(); }
+ void setAlignment(Align Value) { Alignment = Value; }
unsigned getOrdinal() const { return Ordinal; }
void setOrdinal(unsigned Value) { Ordinal = Value; }
@@ -140,9 +151,6 @@
bool hasInstructions() const { return HasInstructions; }
void setHasInstructions(bool Value) { HasInstructions = Value; }
- bool hasData() const { return HasData; }
- void setHasData(bool Value) { HasData = Value; }
-
bool isRegistered() const { return IsRegistered; }
void setIsRegistered(bool Value) { IsRegistered = Value; }
@@ -165,12 +173,6 @@
iterator end() { return Fragments.end(); }
const_iterator end() const { return Fragments.end(); }
- reverse_iterator rbegin() { return Fragments.rbegin(); }
- const_reverse_iterator rbegin() const { return Fragments.rbegin(); }
-
- reverse_iterator rend() { return Fragments.rend(); }
- const_reverse_iterator rend() const { return Fragments.rend(); }
-
MCSection::iterator getSubsectionInsertionPoint(unsigned Subsection);
void dump() const;
@@ -186,6 +188,20 @@
/// Check whether this section is "virtual", that is has no actual object
/// file contents.
virtual bool isVirtualSection() const = 0;
+
+ virtual StringRef getVirtualSectionKind() const;
+
+ /// Add a pending label for the requested subsection. This label will be
+ /// associated with a fragment in flushPendingLabels()
+ void addPendingLabel(MCSymbol* label, unsigned Subsection = 0);
+
+ /// Associate all pending labels in a subsection with a fragment.
+ void flushPendingLabels(MCFragment *F, uint64_t FOffset = 0,
+ unsigned Subsection = 0);
+
+ /// Associate all pending labels with empty data fragments. One fragment
+ /// will be created for each subsection as necessary.
+ void flushPendingLabels();
};
} // end namespace llvm