aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/ARM/ARMConstantPoolValue.cpp
diff options
context:
space:
mode:
authorLauro Ramos Venancio <lauro.venancio@gmail.com>2007-04-22 00:04:12 +0000
committerLauro Ramos Venancio <lauro.venancio@gmail.com>2007-04-22 00:04:12 +0000
commit0ae4a3357a556261f25b1584a2d9914637c69e65 (patch)
tree50dc3483a2a5d6535fd82ad1f354d5df756395e5 /lib/Target/ARM/ARMConstantPoolValue.cpp
parent88894b6c40cf2d94a1c9ab8435cf6ed6c622692a (diff)
Implement PIC for arm-linux.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36324 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMConstantPoolValue.cpp')
-rw-r--r--lib/Target/ARM/ARMConstantPoolValue.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/lib/Target/ARM/ARMConstantPoolValue.cpp b/lib/Target/ARM/ARMConstantPoolValue.cpp
index a219c352ba..1fe66fb174 100644
--- a/lib/Target/ARM/ARMConstantPoolValue.cpp
+++ b/lib/Target/ARM/ARMConstantPoolValue.cpp
@@ -19,15 +19,26 @@ using namespace llvm;
ARMConstantPoolValue::ARMConstantPoolValue(GlobalValue *gv, unsigned id,
ARMCP::ARMCPKind k,
- unsigned char PCAdj)
+ unsigned char PCAdj,
+ const char *Modif)
: MachineConstantPoolValue((const Type*)gv->getType()),
- GV(gv), S(NULL), LabelId(id), Kind(k), PCAdjust(PCAdj) {}
+ GV(gv), S(NULL), LabelId(id), Kind(k), PCAdjust(PCAdj),
+ Modifier(Modif) {}
ARMConstantPoolValue::ARMConstantPoolValue(const char *s, unsigned id,
ARMCP::ARMCPKind k,
- unsigned char PCAdj)
+ unsigned char PCAdj,
+ const char *Modif)
: MachineConstantPoolValue((const Type*)Type::Int32Ty),
- GV(NULL), S(s), LabelId(id), Kind(k), PCAdjust(PCAdj) {}
+ GV(NULL), S(s), LabelId(id), Kind(k), PCAdjust(PCAdj),
+ Modifier(Modif) {}
+
+ARMConstantPoolValue::ARMConstantPoolValue(GlobalValue *gv,
+ ARMCP::ARMCPKind k,
+ const char *Modif)
+ : MachineConstantPoolValue((const Type*)Type::Int32Ty),
+ GV(gv), S(NULL), LabelId(0), Kind(k), PCAdjust(0),
+ Modifier(Modif) {}
int ARMConstantPoolValue::getExistingMachineCPValue(MachineConstantPool *CP,
unsigned Alignment) {
@@ -66,6 +77,7 @@ void ARMConstantPoolValue::print(std::ostream &O) const {
O << S;
if (isNonLazyPointer()) O << "$non_lazy_ptr";
else if (isStub()) O << "$stub";
+ if (Modifier) O << "(" << Modifier << ")";
if (PCAdjust != 0) O << "-(LPIC" << LabelId << "+"
<< (unsigned)PCAdjust << ")";
}