git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237470
91177308-0d34-0410-b5e6-
96231b3b80d8
/// even during the relaxation process.
class MCAsmLayout {
public:
/// even during the relaxation process.
class MCAsmLayout {
public:
- typedef llvm::SmallVectorImpl<MCSectionData*>::const_iterator const_iterator;
- typedef llvm::SmallVectorImpl<MCSectionData*>::iterator iterator;
+ typedef llvm::SmallVectorImpl<MCSectionData *>::const_iterator const_iterator;
+ typedef llvm::SmallVectorImpl<MCSectionData *>::iterator iterator;
private:
MCAssembler &Assembler;
/// List of sections in layout order.
private:
MCAssembler &Assembler;
/// List of sections in layout order.
- llvm::SmallVector<MCSectionData*, 16> SectionOrder;
+ llvm::SmallVector<MCSectionData *, 16> SectionOrder;
/// The last fragment which was laid out, or 0 if nothing has been laid
/// out. Fragments are always laid out in order, so all fragments with a
/// lower ordinal will be valid.
/// The last fragment which was laid out, or 0 if nothing has been laid
/// out. Fragments are always laid out in order, so all fragments with a
/// lower ordinal will be valid.
- mutable DenseMap<const MCSectionData*, MCFragment*> LastValidFragment;
+ mutable DenseMap<const MCSectionData *, MCFragment *> LastValidFragment;
/// \brief Make sure that the layout for the given fragment is valid, lazily
/// computing it if necessary.
/// \brief Make sure that the layout for the given fragment is valid, lazily
/// computing it if necessary.
/// \name Section Access (in layout order)
/// @{
/// \name Section Access (in layout order)
/// @{
- llvm::SmallVectorImpl<MCSectionData*> &getSectionOrder() {
+ llvm::SmallVectorImpl<MCSectionData *> &getSectionOrder() {
- const llvm::SmallVectorImpl<MCSectionData*> &getSectionOrder() const {
+ const llvm::SmallVectorImpl<MCSectionData *> &getSectionOrder() const {
class MCFragment : public ilist_node<MCFragment> {
friend class MCAsmLayout;
class MCFragment : public ilist_node<MCFragment> {
friend class MCAsmLayout;
- MCFragment(const MCFragment&) = delete;
- void operator=(const MCFragment&) = delete;
+ MCFragment(const MCFragment &) = delete;
+ void operator=(const MCFragment &) = delete;
public:
enum FragmentType {
public:
enum FragmentType {
/// \brief Should this fragment be placed at the end of an aligned bundle?
virtual bool alignToBundleEnd() const { return false; }
/// \brief Should this fragment be placed at the end of an aligned bundle?
virtual bool alignToBundleEnd() const { return false; }
- virtual void setAlignToBundleEnd(bool V) { }
+ virtual void setAlignToBundleEnd(bool V) {}
/// \brief Get the padding size that must be inserted before this fragment.
/// Used for bundling. By default, no padding is inserted.
/// Note that padding size is restricted to 8 bits. This is an optimization
/// to reduce the amount of space used for each fragment. In practice, larger
/// padding should never be required.
/// \brief Get the padding size that must be inserted before this fragment.
/// Used for bundling. By default, no padding is inserted.
/// Note that padding size is restricted to 8 bits. This is an optimization
/// to reduce the amount of space used for each fragment. In practice, larger
/// padding should never be required.
- virtual uint8_t getBundlePadding() const {
- return 0;
- }
+ virtual uint8_t getBundlePadding() const { return 0; }
/// \brief Set the padding size for this fragment. By default it's a no-op,
/// and only some fragments have a meaningful implementation.
/// \brief Set the padding size for this fragment. By default it's a no-op,
/// and only some fragments have a meaningful implementation.
- virtual void setBundlePadding(uint8_t N) {
- }
+ virtual void setBundlePadding(uint8_t N) {}
virtual void anchor();
uint8_t BundlePadding;
virtual void anchor();
uint8_t BundlePadding;
public:
MCEncodedFragment(MCFragment::FragmentType FType, MCSectionData *SD = nullptr)
public:
MCEncodedFragment(MCFragment::FragmentType FType, MCSectionData *SD = nullptr)
- : MCFragment(FType, SD), BundlePadding(0)
- {
- }
+ : MCFragment(FType, SD), BundlePadding(0) {}
~MCEncodedFragment() override;
virtual SmallVectorImpl<char> &getContents() = 0;
virtual const SmallVectorImpl<char> &getContents() const = 0;
~MCEncodedFragment() override;
virtual SmallVectorImpl<char> &getContents() = 0;
virtual const SmallVectorImpl<char> &getContents() const = 0;
- uint8_t getBundlePadding() const override {
- return BundlePadding;
- }
+ uint8_t getBundlePadding() const override { return BundlePadding; }
- void setBundlePadding(uint8_t N) override {
- BundlePadding = N;
- }
+ void setBundlePadding(uint8_t N) override { BundlePadding = N; }
static bool classof(const MCFragment *F) {
MCFragment::FragmentType Kind = F->getKind();
switch (Kind) {
static bool classof(const MCFragment *F) {
MCFragment::FragmentType Kind = F->getKind();
switch (Kind) {
- default:
- return false;
- case MCFragment::FT_Relaxable:
- case MCFragment::FT_CompactEncodedInst:
- case MCFragment::FT_Data:
- return true;
+ default:
+ return false;
+ case MCFragment::FT_Relaxable:
+ case MCFragment::FT_CompactEncodedInst:
+ case MCFragment::FT_Data:
+ return true;
public:
MCEncodedFragmentWithFixups(MCFragment::FragmentType FType,
MCSectionData *SD = nullptr)
public:
MCEncodedFragmentWithFixups(MCFragment::FragmentType FType,
MCSectionData *SD = nullptr)
- : MCEncodedFragment(FType, SD)
- {
- }
+ : MCEncodedFragment(FType, SD) {}
~MCEncodedFragmentWithFixups() override;
~MCEncodedFragmentWithFixups() override;
virtual const SmallVectorImpl<MCFixup> &getFixups() const = 0;
virtual fixup_iterator fixup_begin() = 0;
virtual const SmallVectorImpl<MCFixup> &getFixups() const = 0;
virtual fixup_iterator fixup_begin() = 0;
- virtual const_fixup_iterator fixup_begin() const = 0;
+ virtual const_fixup_iterator fixup_begin() const = 0;
virtual fixup_iterator fixup_end() = 0;
virtual const_fixup_iterator fixup_end() const = 0;
virtual fixup_iterator fixup_end() = 0;
virtual const_fixup_iterator fixup_end() const = 0;
/// Fixups - The list of fixups in this fragment.
SmallVector<MCFixup, 4> Fixups;
/// Fixups - The list of fixups in this fragment.
SmallVector<MCFixup, 4> Fixups;
public:
MCDataFragment(MCSectionData *SD = nullptr)
public:
MCDataFragment(MCSectionData *SD = nullptr)
- : MCEncodedFragmentWithFixups(FT_Data, SD),
- HasInstructions(false), AlignToBundleEnd(false)
- {
- }
+ : MCEncodedFragmentWithFixups(FT_Data, SD), HasInstructions(false),
+ AlignToBundleEnd(false) {}
SmallVectorImpl<char> &getContents() override { return Contents; }
SmallVectorImpl<char> &getContents() override { return Contents; }
- const SmallVectorImpl<char> &getContents() const override {
- return Contents;
- }
+ const SmallVectorImpl<char> &getContents() const override { return Contents; }
- SmallVectorImpl<MCFixup> &getFixups() override {
- return Fixups;
- }
+ SmallVectorImpl<MCFixup> &getFixups() override { return Fixups; }
- const SmallVectorImpl<MCFixup> &getFixups() const override {
- return Fixups;
- }
+ const SmallVectorImpl<MCFixup> &getFixups() const override { return Fixups; }
bool hasInstructions() const override { return HasInstructions; }
virtual void setHasInstructions(bool V) { HasInstructions = V; }
bool hasInstructions() const override { return HasInstructions; }
virtual void setHasInstructions(bool V) { HasInstructions = V; }
fixup_iterator fixup_begin() override { return Fixups.begin(); }
const_fixup_iterator fixup_begin() const override { return Fixups.begin(); }
fixup_iterator fixup_begin() override { return Fixups.begin(); }
const_fixup_iterator fixup_begin() const override { return Fixups.begin(); }
- fixup_iterator fixup_end() override {return Fixups.end();}
- const_fixup_iterator fixup_end() const override {return Fixups.end();}
+ fixup_iterator fixup_end() override { return Fixups.end(); }
+ const_fixup_iterator fixup_end() const override { return Fixups.end(); }
static bool classof(const MCFragment *F) {
return F->getKind() == MCFragment::FT_Data;
static bool classof(const MCFragment *F) {
return F->getKind() == MCFragment::FT_Data;
bool AlignToBundleEnd;
SmallVector<char, 4> Contents;
bool AlignToBundleEnd;
SmallVector<char, 4> Contents;
public:
MCCompactEncodedInstFragment(MCSectionData *SD = nullptr)
public:
MCCompactEncodedInstFragment(MCSectionData *SD = nullptr)
- : MCEncodedFragment(FT_CompactEncodedInst, SD), AlignToBundleEnd(false)
- {
- }
+ : MCEncodedFragment(FT_CompactEncodedInst, SD), AlignToBundleEnd(false) {}
- bool hasInstructions() const override {
- return true;
- }
+ bool hasInstructions() const override { return true; }
SmallVectorImpl<char> &getContents() override { return Contents; }
const SmallVectorImpl<char> &getContents() const override { return Contents; }
SmallVectorImpl<char> &getContents() override { return Contents; }
const SmallVectorImpl<char> &getContents() const override { return Contents; }
const SmallVectorImpl<char> &getContents() const override { return Contents; }
const MCInst &getInst() const { return Inst; }
const SmallVectorImpl<char> &getContents() const override { return Contents; }
const MCInst &getInst() const { return Inst; }
- void setInst(const MCInst& Value) { Inst = Value; }
+ void setInst(const MCInst &Value) { Inst = Value; }
const MCSubtargetInfo &getSubtargetInfo() { return STI; }
const MCSubtargetInfo &getSubtargetInfo() { return STI; }
- SmallVectorImpl<MCFixup> &getFixups() override {
- return Fixups;
- }
+ SmallVectorImpl<MCFixup> &getFixups() override { return Fixups; }
- const SmallVectorImpl<MCFixup> &getFixups() const override {
- return Fixups;
- }
+ const SmallVectorImpl<MCFixup> &getFixups() const override { return Fixups; }
bool hasInstructions() const override { return true; }
fixup_iterator fixup_begin() override { return Fixups.begin(); }
const_fixup_iterator fixup_begin() const override { return Fixups.begin(); }
bool hasInstructions() const override { return true; }
fixup_iterator fixup_begin() override { return Fixups.begin(); }
const_fixup_iterator fixup_begin() const override { return Fixups.begin(); }
- fixup_iterator fixup_end() override {return Fixups.end();}
- const_fixup_iterator fixup_end() const override {return Fixups.end();}
+ fixup_iterator fixup_end() override { return Fixups.end(); }
+ const_fixup_iterator fixup_end() const override { return Fixups.end(); }
static bool classof(const MCFragment *F) {
return F->getKind() == MCFragment::FT_Relaxable;
static bool classof(const MCFragment *F) {
return F->getKind() == MCFragment::FT_Relaxable;
bool IsSigned;
SmallString<8> Contents;
bool IsSigned;
SmallString<8> Contents;
public:
MCLEBFragment(const MCExpr &Value_, bool IsSigned_,
MCSectionData *SD = nullptr)
public:
MCLEBFragment(const MCExpr &Value_, bool IsSigned_,
MCSectionData *SD = nullptr)
- : MCFragment(FT_LEB, SD),
- Value(&Value_), IsSigned(IsSigned_) { Contents.push_back(0); }
+ : MCFragment(FT_LEB, SD), Value(&Value_), IsSigned(IsSigned_) {
+ Contents.push_back(0);
+ }
/// \name Accessors
/// @{
/// \name Accessors
/// @{
class MCSectionData : public ilist_node<MCSectionData> {
friend class MCAsmLayout;
class MCSectionData : public ilist_node<MCSectionData> {
friend class MCAsmLayout;
- MCSectionData(const MCSectionData&) = delete;
- void operator=(const MCSectionData&) = delete;
+ MCSectionData(const MCSectionData &) = delete;
+ void operator=(const MCSectionData &) = delete;
public:
typedef iplist<MCFragment> FragmentListType;
public:
typedef iplist<MCFragment> FragmentListType;
BundleLocked,
BundleLockedAlignToEnd
};
BundleLocked,
BundleLockedAlignToEnd
};
private:
FragmentListType Fragments;
const MCSection *Section;
private:
FragmentListType Fragments;
const MCSection *Section;
iterator getSubsectionInsertionPoint(unsigned Subsection);
iterator getSubsectionInsertionPoint(unsigned Subsection);
- bool isBundleLocked() const {
- return BundleLockState != NotBundleLocked;
- }
+ bool isBundleLocked() const { return BundleLockState != NotBundleLocked; }
- BundleLockStateType getBundleLockState() const {
- return BundleLockState;
- }
+ BundleLockStateType getBundleLockState() const { return BundleLockState; }
void setBundleLockState(BundleLockStateType NewState);
void setBundleLockState(BundleLockStateType NewState);
- void setSize(const MCExpr *SS) {
- SymbolSize = SS;
- }
-
- const MCExpr *getSize() const {
- return SymbolSize;
- }
+ void setSize(const MCExpr *SS) { SymbolSize = SS; }
+ const MCExpr *getSize() const { return SymbolSize; }
/// getCommonAlignment - Return the alignment of a 'common' symbol.
unsigned getCommonAlignment() const {
/// getCommonAlignment - Return the alignment of a 'common' symbol.
unsigned getCommonAlignment() const {
typedef FileNameVectorType::const_iterator const_file_name_iterator;
typedef std::vector<IndirectSymbolData>::const_iterator
typedef FileNameVectorType::const_iterator const_file_name_iterator;
typedef std::vector<IndirectSymbolData>::const_iterator
- const_indirect_symbol_iterator;
+ const_indirect_symbol_iterator;
typedef std::vector<IndirectSymbolData>::iterator indirect_symbol_iterator;
typedef std::vector<DataRegionData>::const_iterator
typedef std::vector<IndirectSymbolData>::iterator indirect_symbol_iterator;
typedef std::vector<DataRegionData>::const_iterator
- const_data_region_iterator;
+ const_data_region_iterator;
typedef std::vector<DataRegionData>::iterator data_region_iterator;
/// MachO specific deployment target version info.
typedef std::vector<DataRegionData>::iterator data_region_iterator;
/// MachO specific deployment target version info.
unsigned Minor;
unsigned Update;
} VersionMinInfoType;
unsigned Minor;
unsigned Update;
} VersionMinInfoType;
- MCAssembler(const MCAssembler&) = delete;
- void operator=(const MCAssembler&) = delete;
+ MCAssembler(const MCAssembler &) = delete;
+ void operator=(const MCAssembler &) = delete;
/// The map of sections to their associated assembler backend data.
//
// FIXME: Avoid this indirection?
/// The map of sections to their associated assembler backend data.
//
// FIXME: Avoid this indirection?
- DenseMap<const MCSection*, MCSectionData*> SectionMap;
+ DenseMap<const MCSection *, MCSectionData *> SectionMap;
/// The map of symbols to their associated assembler backend data.
//
// FIXME: Avoid this indirection?
/// The map of symbols to their associated assembler backend data.
//
// FIXME: Avoid this indirection?
- DenseMap<const MCSymbol*, MCSymbolData*> SymbolMap;
+ DenseMap<const MCSymbol *, MCSymbolData *> SymbolMap;
std::vector<IndirectSymbolData> IndirectSymbols;
std::vector<DataRegionData> DataRegions;
/// The list of linker options to propagate into the object file.
std::vector<IndirectSymbolData> IndirectSymbols;
std::vector<DataRegionData> DataRegions;
/// The list of linker options to propagate into the object file.
- std::vector<std::vector<std::string> > LinkerOptions;
+ std::vector<std::vector<std::string>> LinkerOptions;
/// List of declared file names
FileNameVectorType FileNames;
/// List of declared file names
FileNameVectorType FileNames;
// here. Maybe when the relocation stuff moves to target specific,
// this can go with it? The streamer would need some target specific
// refactoring too.
// here. Maybe when the relocation stuff moves to target specific,
// this can go with it? The streamer would need some target specific
// refactoring too.
- mutable SmallPtrSet<const MCSymbol*, 64> ThumbFuncs;
+ mutable SmallPtrSet<const MCSymbol *, 64> ThumbFuncs;
/// \brief The bundle alignment size currently set in the assembler.
///
/// \brief The bundle alignment size currently set in the assembler.
///
MCLOHContainer LOHContainer;
VersionMinInfoType VersionMinInfo;
MCLOHContainer LOHContainer;
VersionMinInfoType VersionMinInfo;
private:
/// Evaluate a fixup to a relocatable expression and the value which should be
/// placed into the fixup.
private:
/// Evaluate a fixup to a relocatable expression and the value which should be
/// placed into the fixup.
/// \return Whether the fixup value was fully resolved. This is true if the
/// \p Value result is fixed, otherwise the value may change due to
/// relocation.
/// \return Whether the fixup value was fully resolved. This is true if the
/// \p Value result is fixed, otherwise the value may change due to
/// relocation.
- bool evaluateFixup(const MCAsmLayout &Layout,
- const MCFixup &Fixup, const MCFragment *DF,
- MCValue &Target, uint64_t &Value) const;
+ bool evaluateFixup(const MCAsmLayout &Layout, const MCFixup &Fixup,
+ const MCFragment *DF, MCValue &Target,
+ uint64_t &Value) const;
/// Check whether a fixup can be satisfied, or whether it needs to be relaxed
/// (increased in size, in order to hold its value correctly).
/// Check whether a fixup can be satisfied, or whether it needs to be relaxed
/// (increased in size, in order to hold its value correctly).
void setIsThumbFunc(const MCSymbol *Func) { ThumbFuncs.insert(Func); }
/// ELF e_header flags
void setIsThumbFunc(const MCSymbol *Func) { ThumbFuncs.insert(Func); }
/// ELF e_header flags
- unsigned getELFHeaderEFlags() const {return ELFHeaderEFlags;}
- void setELFHeaderEFlags(unsigned Flags) { ELFHeaderEFlags = Flags;}
+ unsigned getELFHeaderEFlags() const { return ELFHeaderEFlags; }
+ void setELFHeaderEFlags(unsigned Flags) { ELFHeaderEFlags = Flags; }
/// MachO deployment target version information.
const VersionMinInfoType &getVersionMinInfo() const { return VersionMinInfo; }
/// MachO deployment target version information.
const VersionMinInfoType &getVersionMinInfo() const { return VersionMinInfo; }
void Finish();
// FIXME: This does not belong here.
void Finish();
// FIXME: This does not belong here.
- bool getSubsectionsViaSymbols() const {
- return SubsectionsViaSymbols;
- }
- void setSubsectionsViaSymbols(bool Value) {
- SubsectionsViaSymbols = Value;
- }
+ bool getSubsectionsViaSymbols() const { return SubsectionsViaSymbols; }
+ void setSubsectionsViaSymbols(bool Value) { SubsectionsViaSymbols = Value; }
bool getRelaxAll() const { return RelaxAll; }
void setRelaxAll(bool Value) { RelaxAll = Value; }
bool getRelaxAll() const { return RelaxAll; }
void setRelaxAll(bool Value) { RelaxAll = Value; }
- bool isBundlingEnabled() const {
- return BundleAlignSize != 0;
- }
+ bool isBundlingEnabled() const { return BundleAlignSize != 0; }
- unsigned getBundleAlignSize() const {
- return BundleAlignSize;
- }
+ unsigned getBundleAlignSize() const { return BundleAlignSize; }
void setBundleAlignSize(unsigned Size) {
void setBundleAlignSize(unsigned Size) {
- assert((Size == 0 || !(Size & (Size - 1))) &&
+ assert((Size == 0 || !(Size & (Size - 1))) &&
"Expect a power-of-two bundle align size");
BundleAlignSize = Size;
}
"Expect a power-of-two bundle align size");
BundleAlignSize = Size;
}
const_symbol_iterator symbol_end() const { return Symbols.end(); }
symbol_range symbols() { return make_range(symbol_begin(), symbol_end()); }
const_symbol_iterator symbol_end() const { return Symbols.end(); }
symbol_range symbols() { return make_range(symbol_begin(), symbol_end()); }
- const_symbol_range symbols() const { return make_range(symbol_begin(), symbol_end()); }
+ const_symbol_range symbols() const {
+ return make_range(symbol_begin(), symbol_end());
+ }
size_t symbol_size() const { return Symbols.size(); }
size_t symbol_size() const { return Symbols.size(); }
/// \name Linker Option List Access
/// @{
/// \name Linker Option List Access
/// @{
- std::vector<std::vector<std::string> > &getLinkerOptions() {
+ std::vector<std::vector<std::string>> &getLinkerOptions() {
// FIXME: This is a total hack, this should not be here. Once things are
// factored so that the streamer has direct access to the .o writer, it can
// disappear.
// FIXME: This is a total hack, this should not be here. Once things are
// factored so that the streamer has direct access to the .o writer, it can
// disappear.
- std::vector<DataRegionData> &getDataRegions() {
- return DataRegions;
- }
+ std::vector<DataRegionData> &getDataRegions() { return DataRegions; }
- data_region_iterator data_region_begin() {
- return DataRegions.begin();
- }
+ data_region_iterator data_region_begin() { return DataRegions.begin(); }
const_data_region_iterator data_region_begin() const {
return DataRegions.begin();
}
const_data_region_iterator data_region_begin() const {
return DataRegions.begin();
}
- data_region_iterator data_region_end() {
- return DataRegions.end();
- }
+ data_region_iterator data_region_end() { return DataRegions.end(); }
const_data_region_iterator data_region_end() const {
return DataRegions.end();
}
const_data_region_iterator data_region_end() const {
return DataRegions.end();
}
// FIXME: This is a total hack, this should not be here. Once things are
// factored so that the streamer has direct access to the .o writer, it can
// disappear.
// FIXME: This is a total hack, this should not be here. Once things are
// factored so that the streamer has direct access to the .o writer, it can
// disappear.
- MCLOHContainer & getLOHContainer() {
- return LOHContainer;
- }
- const MCLOHContainer & getLOHContainer() const {
+ MCLOHContainer &getLOHContainer() { return LOHContainer; }
+ const MCLOHContainer &getLOHContainer() const {
return const_cast<MCAssembler *>(this)->getLOHContainer();
}
/// @}
return const_cast<MCAssembler *>(this)->getLOHContainer();
}
/// @}
bool *Created = nullptr) {
MCSectionData *&Entry = SectionMap[&Section];
bool *Created = nullptr) {
MCSectionData *&Entry = SectionMap[&Section];
- if (Created) *Created = !Entry;
+ if (Created)
+ *Created = !Entry;
if (!Entry)
Entry = new MCSectionData(Section, this);
if (!Entry)
Entry = new MCSectionData(Section, this);
bool *Created = nullptr) {
MCSymbolData *&Entry = SymbolMap[&Symbol];
bool *Created = nullptr) {
MCSymbolData *&Entry = SymbolMap[&Symbol];
- if (Created) *Created = !Entry;
+ if (Created)
+ *Created = !Entry;
if (!Entry)
Entry = new MCSymbolData(Symbol, nullptr, 0, this);
if (!Entry)
Entry = new MCSymbolData(Symbol, nullptr, 0, this);
return FileNames.begin();
}
return FileNames.begin();
}
- const_file_name_iterator file_names_end() const {
- return FileNames.end();
- }
+ const_file_name_iterator file_names_end() const { return FileNames.end(); }
void addFileName(StringRef FileName) {
if (std::find(file_names_begin(), file_names_end(), FileName) ==
void addFileName(StringRef FileName) {
if (std::find(file_names_begin(), file_names_end(), FileName) ==
/// \brief Compute the amount of padding required before the fragment \p F to
/// obey bundling restrictions, where \p FOffset is the fragment's offset in
/// its section and \p FSize is the fragment's size.
/// \brief Compute the amount of padding required before the fragment \p F to
/// obey bundling restrictions, where \p FOffset is the fragment's offset in
/// its section and \p FSize is the fragment's size.
-uint64_t computeBundlePadding(const MCAssembler &Assembler,
- const MCFragment *F,
+uint64_t computeBundlePadding(const MCAssembler &Assembler, const MCFragment *F,
uint64_t FOffset, uint64_t FSize);
} // end namespace llvm
uint64_t FOffset, uint64_t FSize);
} // end namespace llvm
private:
MCCodeEmitter(const MCCodeEmitter &) = delete;
void operator=(const MCCodeEmitter &) = delete;
private:
MCCodeEmitter(const MCCodeEmitter &) = delete;
void operator=(const MCCodeEmitter &) = delete;
protected: // Can only create subclasses.
MCCodeEmitter();
protected: // Can only create subclasses.
MCCodeEmitter();
virtual ~MCCodeEmitter();
/// Lifetime management
virtual ~MCCodeEmitter();
/// Lifetime management
- virtual void reset() { }
+ virtual void reset() {}
/// EncodeInstruction - Encode the given \p Inst to bytes on the output
/// stream \p OS.
/// EncodeInstruction - Encode the given \p Inst to bytes on the output
/// stream \p OS.
- class MCCodeGenInfo {
- /// RelocationModel - Relocation model: static, pic, etc.
- ///
- Reloc::Model RelocationModel;
+class MCCodeGenInfo {
+ /// RelocationModel - Relocation model: static, pic, etc.
+ ///
+ Reloc::Model RelocationModel;
- /// CMModel - Code model.
- ///
- CodeModel::Model CMModel;
+ /// CMModel - Code model.
+ ///
+ CodeModel::Model CMModel;
- /// OptLevel - Optimization level.
- ///
- CodeGenOpt::Level OptLevel;
+ /// OptLevel - Optimization level.
+ ///
+ CodeGenOpt::Level OptLevel;
- public:
- void InitMCCodeGenInfo(Reloc::Model RM = Reloc::Default,
- CodeModel::Model CM = CodeModel::Default,
- CodeGenOpt::Level OL = CodeGenOpt::Default);
+public:
+ void InitMCCodeGenInfo(Reloc::Model RM = Reloc::Default,
+ CodeModel::Model CM = CodeModel::Default,
+ CodeGenOpt::Level OL = CodeGenOpt::Default);
- Reloc::Model getRelocationModel() const { return RelocationModel; }
+ Reloc::Model getRelocationModel() const { return RelocationModel; }
- CodeModel::Model getCodeModel() const { return CMModel; }
+ CodeModel::Model getCodeModel() const { return CMModel; }
- CodeGenOpt::Level getOptLevel() const { return OptLevel; }
+ CodeGenOpt::Level getOptLevel() const { return OptLevel; }
- // Allow overriding OptLevel on a per-function basis.
- void setOptLevel(CodeGenOpt::Level Level) { OptLevel = Level; }
- };
+ // Allow overriding OptLevel on a per-function basis.
+ void setOptLevel(CodeGenOpt::Level Level) { OptLevel = Level; }
+};
} // namespace llvm
#endif
} // namespace llvm
#endif