X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FTarget%2FARM%2FARMConstantPoolValue.h;h=6b98d446b003bb5680e12c0ade6466a6057632d4;hb=31d157ae1ac2cd9c787dc3c1d28e64c682803844;hp=6b69cb6caa5c54f5a0fbd1773b4979e54bcbace7;hpb=9c18f51daaf89b9c706aa0557bede2cbb0debb69;p=oota-llvm.git diff --git a/lib/Target/ARM/ARMConstantPoolValue.h b/lib/Target/ARM/ARMConstantPoolValue.h index 6b69cb6caa5..6b98d446b00 100644 --- a/lib/Target/ARM/ARMConstantPoolValue.h +++ b/lib/Target/ARM/ARMConstantPoolValue.h @@ -1,4 +1,4 @@ -//===- ARMConstantPoolValue.h - ARM constantpool value ----------*- C++ -*-===// +//===-- ARMConstantPoolValue.h - ARM constantpool value ---------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -49,7 +49,6 @@ namespace ARMCP { /// represent PC-relative displacement between the address of the load /// instruction and the constant being loaded, i.e. (&GV-(LPIC+8)). class ARMConstantPoolValue : public MachineConstantPoolValue { - const MachineBasicBlock *MBB; // MachineBasicBlock being loaded. unsigned LabelId; // Label id of the load. ARMCP::ARMCPKind Kind; // Kind of constant. unsigned char PCAdjust; // Extra adjustment if constantpool is pc-relative. @@ -66,15 +65,8 @@ protected: unsigned char PCAdj, ARMCP::ARMCPModifier Modifier, bool AddCurrentAddress); public: - ARMConstantPoolValue(LLVMContext &C, const MachineBasicBlock *mbb,unsigned id, - ARMCP::ARMCPKind Kind = ARMCP::CPValue, - unsigned char PCAdj = 0, - ARMCP::ARMCPModifier Modifier = ARMCP::no_modifier, - bool AddCurrentAddress = false); virtual ~ARMConstantPoolValue(); - const MachineBasicBlock *getMBB() const; - ARMCP::ARMCPModifier getModifier() const { return Modifier; } const char *getModifierText() const; bool hasModifier() const { return Modifier != ARMCP::no_modifier; } @@ -101,6 +93,12 @@ public: /// constantpool entry as another ARM constpool value. virtual bool hasSameValue(ARMConstantPoolValue *ACPV); + bool equals(const ARMConstantPoolValue *A) const { + return this->LabelId == A->LabelId && + this->PCAdjust == A->PCAdjust && + this->Modifier == A->Modifier; + } + virtual void print(raw_ostream &O) const; void print(raw_ostream *O) const { if (O) print(*O); } void dump() const; @@ -200,14 +198,15 @@ public: /// ARMConstantPoolMBB - ARM-specific constantpool value of a machine basic /// block. class ARMConstantPoolMBB : public ARMConstantPoolValue { - MachineBasicBlock *MBB; // Machine basic block. + const MachineBasicBlock *MBB; // Machine basic block. - ARMConstantPoolMBB(LLVMContext &C, MachineBasicBlock *mbb, unsigned id, + ARMConstantPoolMBB(LLVMContext &C, const MachineBasicBlock *mbb, unsigned id, unsigned char PCAdj, ARMCP::ARMCPModifier Modifier, bool AddCurrentAddress); public: - static ARMConstantPoolMBB *Create(LLVMContext &C, MachineBasicBlock *mbb, + static ARMConstantPoolMBB *Create(LLVMContext &C, + const MachineBasicBlock *mbb, unsigned ID, unsigned char PCAdj); const MachineBasicBlock *getMBB() const { return MBB; }