diff options
author | Bill Wendling <isanbard@gmail.com> | 2011-10-01 08:36:59 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2011-10-01 08:36:59 +0000 |
commit | ff4a8023ecf328047c8f98c7f42bf5e8b46b2f11 (patch) | |
tree | de52788027149a0c6b287c0471f4002308bb87a2 /lib/Target/ARM/ARMConstantPoolValue.h | |
parent | 3f4e4592c3da4d69478ca37d17cb1d6c7024ec50 (diff) |
Add an ARMConstantPool class for external symbols. This will split out the support for external symbols from the base class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140938 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMConstantPoolValue.h')
-rw-r--r-- | lib/Target/ARM/ARMConstantPoolValue.h | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/lib/Target/ARM/ARMConstantPoolValue.h b/lib/Target/ARM/ARMConstantPoolValue.h index fea43790c0..4ced33ab2c 100644 --- a/lib/Target/ARM/ARMConstantPoolValue.h +++ b/lib/Target/ARM/ARMConstantPoolValue.h @@ -63,6 +63,9 @@ protected: unsigned char PCAdj, ARMCP::ARMCPModifier Modifier, bool AddCurrentAddress); + ARMConstantPoolValue(LLVMContext &C, unsigned id, ARMCP::ARMCPKind Kind, + unsigned char PCAdj, ARMCP::ARMCPModifier Modifier, + bool AddCurrentAddress); public: ARMConstantPoolValue(LLVMContext &C, const MachineBasicBlock *mbb,unsigned id, ARMCP::ARMCPKind Kind = ARMCP::CPValue, @@ -73,7 +76,7 @@ public: unsigned char PCAdj = 0, ARMCP::ARMCPModifier Modifier = ARMCP::no_modifier, bool AddCurrentAddress = false); - ~ARMConstantPoolValue(); + virtual ~ARMConstantPoolValue(); const char *getSymbol() const { return S; } const MachineBasicBlock *getMBB() const; @@ -166,6 +169,42 @@ public: static bool classof(const ARMConstantPoolConstant *) { return true; } }; +/// ARMConstantPoolSymbol - ARM-specific constantpool values for external +/// symbols. +class ARMConstantPoolSymbol : public ARMConstantPoolValue { + const char *S; // ExtSymbol being loaded. + + ARMConstantPoolSymbol(LLVMContext &C, const char *s, unsigned id, + unsigned char PCAdj, ARMCP::ARMCPModifier Modifier, + bool AddCurrentAddress); + +public: + ~ARMConstantPoolSymbol(); + + static ARMConstantPoolSymbol *Create(LLVMContext &C, const char *s, + unsigned ID, unsigned char PCAdj, + ARMCP::ARMCPModifier Modifier, + bool AddCurrentAddress); + + const char *getSymbol() const { return S; } + + virtual int getExistingMachineCPValue(MachineConstantPool *CP, + unsigned Alignment); + + virtual void addSelectionDAGCSEId(FoldingSetNodeID &ID); + + /// hasSameValue - Return true if this ARM constpool value can share the same + /// constantpool entry as another ARM constpool value. + virtual bool hasSameValue(ARMConstantPoolValue *ACPV); + + virtual void print(raw_ostream &O) const; + + static bool classof(const ARMConstantPoolValue *ACPV) { + return ACPV->isExtSymbol(); + } + static bool classof(const ARMConstantPoolSymbol *) { return true; } +}; + } // End llvm namespace #endif |