#ifndef LLVM_MC_MCASSEMBLER_H
#define LLVM_MC_MCASSEMBLER_H
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/ilist.h"
#include "llvm/ADT/ilist_node.h"
#include "llvm/ADT/iterator.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCLinkerOptimizationHint.h"
#include "llvm/MC/MCSubtargetInfo.h"
-#include "llvm/Support/Casting.h"
-#include "llvm/Support/DataTypes.h"
-#include <algorithm>
-#include <vector> // FIXME: Shouldn't be needed.
namespace llvm {
class raw_ostream;
class MCValue;
class MCAsmBackend;
-class MCFragment : public ilist_node<MCFragment> {
+class MCFragment : public ilist_node_with_parent<MCFragment, MCSection> {
friend class MCAsmLayout;
MCFragment(const MCFragment &) = delete;
FT_Dwarf,
FT_DwarfFrame,
FT_LEB,
- FT_SafeSEH
+ FT_SafeSEH,
+ FT_Dummy
};
private:
/// and only some fragments have a meaningful implementation.
void setBundlePadding(uint8_t N) { BundlePadding = N; }
+ /// \brief Return true if given frgment has FT_Dummy type.
+ bool isDummy() const { return Kind == FT_Dummy; }
+
void dump();
};
+class MCDummyFragment : public MCFragment {
+public:
+ explicit MCDummyFragment(MCSection *Sec)
+ : MCFragment(FT_Dummy, false, 0, Sec){};
+ static bool classof(const MCFragment *F) { return F->getKind() == FT_Dummy; }
+};
+
/// Interface implemented by fragments that contain encoded instructions and/or
/// data.
///
MCInst Inst;
/// STI - The MCSubtargetInfo in effect when the instruction was encoded.
- /// Keep a copy instead of a reference to make sure that updates to STI
- /// in the assembler are not seen here.
- const MCSubtargetInfo STI;
+ const MCSubtargetInfo &STI;
public:
MCRelaxableFragment(const MCInst &Inst, const MCSubtargetInfo &STI,