17 #include "llvm/Config/llvm-config.h" 37 bool addCurrentAddress)
39 PCAdjust(PCAdj), Modifier(modifier),
40 AddCurrentAddress(addCurrentAddress) {}
46 bool addCurrentAddress)
48 LabelId(id), Kind(kind), PCAdjust(PCAdj), Modifier(modifier),
49 AddCurrentAddress(addCurrentAddress) {}
88 if (ACPV->Kind == Kind &&
89 ACPV->PCAdjust == PCAdjust &&
90 ACPV->Modifier == Modifier &&
91 ACPV->LabelId == LabelId &&
92 ACPV->AddCurrentAddress == AddCurrentAddress) {
101 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) 103 errs() <<
" " << *
this;
110 O <<
"-(LPC" << LabelId <<
"+" << (
unsigned)PCAdjust;
111 if (AddCurrentAddress) O <<
"-.";
120 ARMConstantPoolConstant::ARMConstantPoolConstant(
Type *Ty,
126 bool AddCurrentAddress)
130 ARMConstantPoolConstant::ARMConstantPoolConstant(
const Constant *C,
135 bool AddCurrentAddress)
140 ARMConstantPoolConstant::ARMConstantPoolConstant(
const GlobalVariable *GV,
178 bool AddCurrentAddress) {
184 return dyn_cast_or_null<GlobalValue>(CVal);
188 return dyn_cast_or_null<BlockAddress>(CVal);
192 unsigned Alignment) {
194 getExistingMachineCPValueImpl<ARMConstantPoolConstant>(
CP, Alignment);
197 CP->getConstants()[index].Val.MachineCPVal);
198 auto *
Constant = cast<ARMConstantPoolConstant>(CPV);
199 Constant->GVars.insert(GVars.begin(), GVars.end());
211 for (
const auto *GV : GVars)
217 O << CVal->getName();
226 unsigned id,
unsigned char PCAdj,
228 bool AddCurrentAddress)
235 unsigned char PCAdj) {
240 unsigned Alignment) {
241 return getExistingMachineCPValueImpl<ARMConstantPoolSymbol>(
CP, Alignment);
263 ARMConstantPoolMBB::ARMConstantPoolMBB(
LLVMContext &C,
265 unsigned id,
unsigned char PCAdj,
267 bool AddCurrentAddress)
269 Modifier, AddCurrentAddress),
275 unsigned char PCAdj) {
280 unsigned Alignment) {
281 return getExistingMachineCPValueImpl<ARMConstantPoolMBB>(
CP, Alignment);
286 return ACPMBB && ACPMBB->MBB == MBB &&
void AddPointer(const void *Ptr)
Add* - Add various data types to Bit data.
StringRef getModifierText() const
The MachineConstantPool class keeps track of constants referenced by a function which must be spilled...
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
static ARMConstantPoolSymbol * Create(LLVMContext &C, StringRef s, unsigned ID, unsigned char PCAdj)
This class represents lattice values for constants.
int getExistingMachineCPValue(MachineConstantPool *CP, unsigned Alignment) override
ARMConstantPoolValue - ARM specific constantpool value.
Global Offset Table, Thread Pointer Offset.
const BlockAddress * getBlockAddress() const
LLVMContext & getContext() const
All values hold a context through their type.
Global Offset Table, PC Relative.
void print(raw_ostream &O) const override
print - Implement operator<<
ARMConstantPoolValue(Type *Ty, unsigned id, ARMCP::ARMCPKind Kind, unsigned char PCAdj, ARMCP::ARMCPModifier Modifier, bool AddCurrentAddress)
The address of a basic block.
int getExistingMachineCPValue(MachineConstantPool *CP, unsigned Alignment) override
Printable printMBBReference(const MachineBasicBlock &MBB)
Prints a machine basic block reference.
void AddInteger(signed I)
void print(raw_ostream &O) const override
print - Implement operator<<
Type * getType() const
All values are typed, get the type of this value.
int getExistingMachineCPValue(MachineConstantPool *CP, unsigned Alignment) override
void addSelectionDAGCSEId(FoldingSetNodeID &ID) override
void addSelectionDAGCSEId(FoldingSetNodeID &ID) override
bool hasSameValue(ARMConstantPoolValue *ACPV) override
hasSameValue - Return true if this ARM constpool value can share the same constantpool entry as anoth...
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important class for using LLVM in a threaded context.
This is an important base class in LLVM.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
virtual bool hasSameValue(ARMConstantPoolValue *ACPV)
hasSameValue - Return true if this ARM constpool value can share the same constantpool entry as anoth...
bool hasSameValue(ARMConstantPoolValue *ACPV) override
hasSameValue - Return true if this ARM constpool value can share the same constantpool entry as anoth...
Thread Local Storage (General Dynamic Mode)
Abstract base class for all machine specific constantpool value subclasses.
void addSelectionDAGCSEId(FoldingSetNodeID &ID) override
static ARMConstantPoolMBB * Create(LLVMContext &C, const MachineBasicBlock *mbb, unsigned ID, unsigned char PCAdj)
void print(raw_ostream &O) const override
print - Implement operator<<
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
const GlobalValue * getGV() const
ARMConstantPoolConstant - ARM-specific constant pool values for Constants, Functions, and BlockAddresses.
ARMConstantPoolSymbol - ARM-specific constantpool values for external symbols.
bool hasSameValue(ARMConstantPoolValue *ACPV) override
hasSameValue - Return true if this ARM constpool value can share the same constantpool entry as anoth...
~ARMConstantPoolValue() override
ARMConstantPoolMBB - ARM-specific constantpool value of a machine basic block.
void addSelectionDAGCSEId(FoldingSetNodeID &ID) override
void print(raw_ostream &O) const override
print - Implement operator<<
Section Relative (Windows TLS)
static IntegerType * getInt32Ty(LLVMContext &C)
void AddString(StringRef String)
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
This class implements an extremely fast bulk output stream that can only output to a stream...
StringRef - Represent a constant reference to a string, i.e.
int getExistingMachineCPValue(MachineConstantPool *CP, unsigned Alignment) override
static ARMConstantPoolConstant * Create(const Constant *C, unsigned ID)