summaryrefslogtreecommitdiff
path: root/lib/Target/ARM/ARMConstantPoolValue.h
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2011-10-01 08:36:59 +0000
committerBill Wendling <isanbard@gmail.com>2011-10-01 08:36:59 +0000
commitff4a8023ecf328047c8f98c7f42bf5e8b46b2f11 (patch)
treede52788027149a0c6b287c0471f4002308bb87a2 /lib/Target/ARM/ARMConstantPoolValue.h
parent3f4e4592c3da4d69478ca37d17cb1d6c7024ec50 (diff)
downloadllvm-ff4a8023ecf328047c8f98c7f42bf5e8b46b2f11.tar.gz
llvm-ff4a8023ecf328047c8f98c7f42bf5e8b46b2f11.tar.bz2
llvm-ff4a8023ecf328047c8f98c7f42bf5e8b46b2f11.tar.xz
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.h41
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