24 using namespace dwarf;
41 GV, Encoding, TM, MMI, Streamer);
69 X86FreeBSDTargetObjectFile::Initialize(
MCContext &Ctx,
76 X86FuchsiaTargetObjectFile::Initialize(
MCContext &Ctx,
83 X86LinuxNaClTargetObjectFile::Initialize(
MCContext &Ctx,
89 const MCExpr *X86WindowsTargetObjectFile::lowerRelativeReference(
105 if (!isa<GlobalObject>(LHS) || !isa<GlobalVariable>(RHS) ||
108 cast<GlobalVariable>(RHS)->hasInitializer() || RHS->
hasSection())
119 unsigned Size = HexString.size();
120 assert(Width >= Size &&
"hex string is too large!");
121 HexString.insert(HexString.begin(), Width - Size,
'0');
128 if (isa<UndefValue>(C)) {
130 }
else if (
const auto *CFP = dyn_cast<ConstantFP>(C)) {
132 }
else if (
const auto *CI = dyn_cast<ConstantInt>(C)) {
135 unsigned NumElements;
136 if (isa<VectorType>(Ty))
140 std::string HexString;
141 for (
int I = NumElements - 1,
E = -1;
I !=
E; --
I)
147 MCSection *X86WindowsTargetObjectFile::getSectionForConstant(
149 unsigned &Align)
const {
154 std::string COMDATSymName;
177 if (!COMDATSymName.empty())
178 return getContext().getCOFFSection(
".rdata", Characteristics, Kind,
Instances of this class represent a uniqued identifier for a section in the current translation unit...
A parsed version of the target data layout string in and methods for querying it. ...
bool isMergeableConst() const
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
This represents an "assembler immediate".
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
MCSymbol * getCFIPersonalitySymbol(const GlobalValue *GV, const TargetMachine &TM, MachineModuleInfo *MMI) const override
static std::string scalarConstantToHexString(const Constant *C)
MCSymbol * getSymbol(const GlobalValue *GV) const
static std::string APIntToHexString(const APInt &AI)
const MCExpr * getTTypeGlobalReference(const GlobalValue *GV, unsigned Encoding, const TargetMachine &TM, MachineModuleInfo *MMI, MCStreamer &Streamer) const override
The mach-o version of this method defaults to returning a stub reference.
uint64_t getLimitedValue(uint64_t Limit=~0ULL) const
If this value is smaller than the specified limit, return it, otherwise return the limit value...
uint64_t getArrayNumElements() const
StringRef getName() const
Return a constant reference to the value's name.
virtual void Initialize(MCContext &ctx, const TargetMachine &TM)
This method must be called before any actual lowering is done.
const MCExpr * getDebugThreadLocalSymbol(const MCSymbol *Sym) const override
Describe a TLS variable address within debug info.
Base class for the full range of assembler expressions which are needed for parsing.
Context object for machine code objects.
bool isMergeableConst32() const
static const MCBinaryExpr * createAdd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)
bool isMergeableConst16() const
static GCRegistry::Add< CoreCLRGC > E("coreclr","CoreCLR-compatible GC")
Streaming machine code generation interface.
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important base class in LLVM.
virtual MCSection * getSectionForConstant(const DataLayout &DL, SectionKind Kind, const Constant *C, unsigned &Align) const
Given a constant with the SectionKind, return a section that it should be placed in.
unsigned getBitWidth() const
Return the number of bits in the APInt.
SectionKind - This is a simple POD value that classifies the properties of a section.
Constant * getAggregateElement(unsigned Elt) const
For aggregates (struct/array/vector) return the constant that corresponds to the specified element if...
bool isThreadLocal() const
If the value is "Thread Local", its value isn't shared by the threads.
const MCExpr * getTTypeGlobalReference(const GlobalValue *GV, unsigned Encoding, const TargetMachine &TM, MachineModuleInfo *MMI, MCStreamer &Streamer) const override
The mach-o version of this method defaults to returning a stub reference.
bool hasExternalLinkage() const
unsigned UseInitArray
UseInitArray - Use .init_array instead of .ctors for static constructors.
Type * getType() const
All values are typed, get the type of this value.
bool isMergeableConst8() const
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
Class for arbitrary precision integers.
unsigned getVectorNumElements() const
PointerType * getType() const
Global values are always pointers.
COFFYAML::WeakExternalCharacteristics Characteristics
const MCExpr * getIndirectSymViaGOTPCRel(const MCSymbol *Sym, const MCValue &MV, int64_t Offset, MachineModuleInfo *MMI, MCStreamer &Streamer) const override
Get MachO PC relative GOT entry relocation.
static std::string utohexstr(uint64_t X, bool LowerCase=false)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
int64_t getConstant() const
unsigned getPrimitiveSizeInBits() const LLVM_READONLY
Return the basic size of this type if it is a primitive type.
bool isMergeableConst4() const
Primary interface to the complete machine description for the target machine.
static APInt getNullValue(unsigned numBits)
Get the '0' value.
unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
static const MCConstantExpr * create(int64_t Value, MCContext &Ctx)
This class contains meta information specific to a module.
This file describes how to lower LLVM code to machine code.