aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/MC/MCAssembler.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/MC/MCAssembler.h')
-rw-r--r--include/llvm/MC/MCAssembler.h43
1 files changed, 42 insertions, 1 deletions
diff --git a/include/llvm/MC/MCAssembler.h b/include/llvm/MC/MCAssembler.h
index d48a0b40a7..174a755272 100644
--- a/include/llvm/MC/MCAssembler.h
+++ b/include/llvm/MC/MCAssembler.h
@@ -50,7 +50,8 @@ public:
FT_Fill,
FT_Inst,
FT_Org,
- FT_Dwarf
+ FT_Dwarf,
+ FT_LEB
};
private:
@@ -338,6 +339,40 @@ public:
static bool classof(const MCOrgFragment *) { return true; }
};
+class MCLEBFragment : public MCFragment {
+ /// Value - The value this fragment should contain.
+ const MCExpr *Value;
+
+ /// IsSigned - True if this is a sleb128, false if uleb128.
+ bool IsSigned;
+
+ /// Size - The current size estimate.
+ uint64_t Size;
+
+public:
+ MCLEBFragment(const MCExpr &Value_, bool IsSigned_, MCSectionData *SD)
+ : MCFragment(FT_LEB, SD),
+ Value(&Value_), IsSigned(IsSigned_), Size(1) {}
+
+ /// @name Accessors
+ /// @{
+
+ const MCExpr &getValue() const { return *Value; }
+
+ bool isSigned() const { return IsSigned; }
+
+ uint64_t getSize() const { return Size; }
+
+ void setSize(uint64_t Size_) { Size = Size_; }
+
+ /// @}
+
+ static bool classof(const MCFragment *F) {
+ return F->getKind() == MCFragment::FT_LEB;
+ }
+ static bool classof(const MCLEBFragment *) { return true; }
+};
+
class MCDwarfLineAddrFragment : public MCFragment {
/// LineDelta - the value of the difference between the two line numbers
/// between two .loc dwarf directives.
@@ -677,6 +712,12 @@ private:
/// were adjusted.
bool LayoutOnce(const MCObjectWriter &Writer, MCAsmLayout &Layout);
+ bool RelaxInstruction(const MCObjectWriter &Writer, MCAsmLayout &Layout,
+ MCInstFragment &IF);
+
+ bool RelaxLEB(const MCObjectWriter &Writer, MCAsmLayout &Layout,
+ MCLEBFragment &IF);
+
/// FinishLayout - Finalize a layout, including fragment lowering.
void FinishLayout(MCAsmLayout &Layout);