Do relaxations with FT_Org fragments. Fixes the FIXME:

// FIXME: We should compute this sooner, we don't want to recurse here, and
    // we would like to be more functional.

In MCAssembler::ComputeFragmentSize.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118080 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2010-11-02 21:38:23 +00:00
parent 36958599a8
commit 187ce544b2
2 changed files with 34 additions and 19 deletions

View File

@@ -319,10 +319,13 @@ class MCOrgFragment : public MCFragment {
/// Value - Value to use for filling bytes.
int8_t Value;
/// Size - The current estimate of the size.
unsigned Size;
public:
MCOrgFragment(const MCExpr &_Offset, int8_t _Value, MCSectionData *SD = 0)
: MCFragment(FT_Org, SD),
Offset(&_Offset), Value(_Value) {}
Offset(&_Offset), Value(_Value), Size(0) {}
/// @name Accessors
/// @{
@@ -331,6 +334,9 @@ public:
uint8_t getValue() const { return Value; }
unsigned getSize() const { return Size; }
void setSize(unsigned Size_) { Size = Size_; }
/// @}
static bool classof(const MCFragment *F) {
@@ -715,6 +721,9 @@ private:
bool RelaxInstruction(const MCObjectWriter &Writer, MCAsmLayout &Layout,
MCInstFragment &IF);
bool RelaxOrg(const MCObjectWriter &Writer, MCAsmLayout &Layout,
MCOrgFragment &OF);
bool RelaxLEB(const MCObjectWriter &Writer, MCAsmLayout &Layout,
MCLEBFragment &IF);