summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/ARMConstantPoolValue.cpp
diff options
context:
space:
mode:
authorLauro Ramos Venancio <lauro.venancio@gmail.com>2007-04-27 13:54:47 +0000
committerLauro Ramos Venancio <lauro.venancio@gmail.com>2007-04-27 13:54:47 +0000
commitc39c12a3fae1cf979ce7b39d83d394f73506dcaa (patch)
tree098c7d07bf16b9325ae9cbf74e67aaf80acf5337 /llvm/lib/Target/ARM/ARMConstantPoolValue.cpp
parentc9f22fd1a4341822c3a6d934ab7139ce2c427ec3 (diff)
downloadbcm5719-llvm-c39c12a3fae1cf979ce7b39d83d394f73506dcaa.tar.gz
bcm5719-llvm-c39c12a3fae1cf979ce7b39d83d394f73506dcaa.zip
ARM TLS: implement "general dynamic", "initial exec" and "local exec" models.
llvm-svn: 36506
Diffstat (limited to 'llvm/lib/Target/ARM/ARMConstantPoolValue.cpp')
-rw-r--r--llvm/lib/Target/ARM/ARMConstantPoolValue.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/llvm/lib/Target/ARM/ARMConstantPoolValue.cpp b/llvm/lib/Target/ARM/ARMConstantPoolValue.cpp
index 1fe66fb174b..30a8eafefd1 100644
--- a/llvm/lib/Target/ARM/ARMConstantPoolValue.cpp
+++ b/llvm/lib/Target/ARM/ARMConstantPoolValue.cpp
@@ -20,18 +20,20 @@ using namespace llvm;
ARMConstantPoolValue::ARMConstantPoolValue(GlobalValue *gv, unsigned id,
ARMCP::ARMCPKind k,
unsigned char PCAdj,
- const char *Modif)
+ const char *Modif,
+ bool AddCA)
: MachineConstantPoolValue((const Type*)gv->getType()),
GV(gv), S(NULL), LabelId(id), Kind(k), PCAdjust(PCAdj),
- Modifier(Modif) {}
+ Modifier(Modif), AddCurrentAddress(AddCA) {}
ARMConstantPoolValue::ARMConstantPoolValue(const char *s, unsigned id,
ARMCP::ARMCPKind k,
unsigned char PCAdj,
- const char *Modif)
+ const char *Modif,
+ bool AddCA)
: MachineConstantPoolValue((const Type*)Type::Int32Ty),
GV(NULL), S(s), LabelId(id), Kind(k), PCAdjust(PCAdj),
- Modifier(Modif) {}
+ Modifier(Modif), AddCurrentAddress(AddCA) {}
ARMConstantPoolValue::ARMConstantPoolValue(GlobalValue *gv,
ARMCP::ARMCPKind k,
@@ -78,6 +80,11 @@ void ARMConstantPoolValue::print(std::ostream &O) const {
if (isNonLazyPointer()) O << "$non_lazy_ptr";
else if (isStub()) O << "$stub";
if (Modifier) O << "(" << Modifier << ")";
- if (PCAdjust != 0) O << "-(LPIC" << LabelId << "+"
- << (unsigned)PCAdjust << ")";
+ if (PCAdjust != 0) {
+ O << "-(LPIC" << LabelId << "+"
+ << (unsigned)PCAdjust;
+ if (AddCurrentAddress)
+ O << "-.";
+ O << ")";
+ }
}
OpenPOWER on IntegriCloud