TargetLoweringObjectFile.h [plain text]
#ifndef LLVM_TARGET_TARGETLOWERINGOBJECTFILE_H
#define LLVM_TARGET_TARGETLOWERINGOBJECTFILE_H
#include "llvm/ADT/ArrayRef.h"
#include "llvm/IR/Module.h"
#include "llvm/MC/MCObjectFileInfo.h"
#include "llvm/MC/SectionKind.h"
namespace llvm {
class MachineModuleInfo;
class Mangler;
class MCContext;
class MCExpr;
class MCSection;
class MCSymbol;
class MCSymbolRefExpr;
class MCStreamer;
class ConstantExpr;
class GlobalValue;
class TargetMachine;
class TargetLoweringObjectFile : public MCObjectFileInfo {
MCContext *Ctx;
const DataLayout *DL;
TargetLoweringObjectFile(
const TargetLoweringObjectFile&) LLVM_DELETED_FUNCTION;
void operator=(const TargetLoweringObjectFile&) LLVM_DELETED_FUNCTION;
public:
MCContext &getContext() const { return *Ctx; }
TargetLoweringObjectFile() : MCObjectFileInfo(), Ctx(0), DL(0) {}
virtual ~TargetLoweringObjectFile();
virtual void Initialize(MCContext &ctx, const TargetMachine &TM);
virtual void emitPersonalityValue(MCStreamer &Streamer,
const TargetMachine &TM,
const MCSymbol *Sym) const;
virtual StringRef getDepLibFromLinkerOpt(StringRef LinkerOption) const {
return StringRef();
}
virtual void emitModuleFlags(MCStreamer &Streamer,
ArrayRef<Module::ModuleFlagEntry> Flags,
Mangler &Mang, const TargetMachine &TM) const {}
virtual bool shouldEmitUsedDirectiveFor(const GlobalValue *GV,
Mangler &Mang,
const TargetMachine &TM) const {
return GV != 0;
}
virtual const MCSection *getSectionForConstant(SectionKind Kind) const;
static SectionKind getKindForGlobal(const GlobalValue *GV,
const TargetMachine &TM);
const MCSection *SectionForGlobal(const GlobalValue *GV,
SectionKind Kind, Mangler &Mang,
const TargetMachine &TM) const;
const MCSection *SectionForGlobal(const GlobalValue *GV,
Mangler &Mang,
const TargetMachine &TM) const {
return SectionForGlobal(GV, getKindForGlobal(GV, TM), Mang, TM);
}
virtual const MCSection *
getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
Mangler &Mang, const TargetMachine &TM) const = 0;
virtual const MCSection *getSpecialCasedSectionGlobals(const GlobalValue *GV,
SectionKind Kind,
Mangler &Mang) const {
return 0;
}
virtual const MCExpr *
getTTypeGlobalReference(const GlobalValue *GV, unsigned Encoding,
Mangler &Mang, const TargetMachine &TM,
MachineModuleInfo *MMI, MCStreamer &Streamer) const;
MCSymbol *getSymbolWithGlobalValueBase(const GlobalValue *GV,
StringRef Suffix, Mangler &Mang,
const TargetMachine &TM) const;
virtual MCSymbol *
getCFIPersonalitySymbol(const GlobalValue *GV, Mangler &Mang,
const TargetMachine &TM,
MachineModuleInfo *MMI) const;
const MCExpr *
getTTypeReference(const MCSymbolRefExpr *Sym, unsigned Encoding,
MCStreamer &Streamer) const;
virtual const MCSection *
getStaticCtorSection(unsigned Priority = 65535) const {
(void)Priority;
return StaticCtorSection;
}
virtual const MCSection *
getStaticDtorSection(unsigned Priority = 65535) const {
(void)Priority;
return StaticDtorSection;
}
virtual const MCExpr *getDebugThreadLocalSymbol(const MCSymbol *Sym) const;
virtual const MCExpr *
getExecutableRelativeSymbol(const ConstantExpr *CE, Mangler &Mang,
const TargetMachine &TM) const {
return 0;
}
virtual bool isSectionAtomizableBySymbols(const MCSection &Section) const;
protected:
virtual const MCSection *
SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
Mangler &Mang, const TargetMachine &TM) const;
};
}
#endif