aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2010-09-10 21:48:08 +0000
committerBill Wendling <isanbard@gmail.com>2010-09-10 21:48:08 +0000
commit078d13e7b6d8933cdcfa3fae9d69b7a91cc5cf8a (patch)
treeff0dc9111150b51b88e4e53e0e7195be8fb85f9b
parentfc8a7d88acb94f7deb96c8daaec7edef53795ff0 (diff)
downloadllvm-078d13e7b6d8933cdcfa3fae9d69b7a91cc5cf8a.zip
llvm-078d13e7b6d8933cdcfa3fae9d69b7a91cc5cf8a.tar.gz
llvm-078d13e7b6d8933cdcfa3fae9d69b7a91cc5cf8a.tar.bz2
Approved by Evan:
$ svn merge -c 113637 https://llvm.org/svn/llvm-project/llvm/trunk --- Merging r113637 into '.': U lib/Target/ARM/ARMBaseInstrInfo.cpp llvm-svn: 113639
-rw-r--r--llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
index 79e9a58..3a8bebe 100644
--- a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
+++ b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
@@ -923,6 +923,11 @@ static unsigned duplicateCPV(MachineFunction &MF, unsigned &CPI) {
unsigned PCLabelId = AFI->createConstPoolEntryUId();
ARMConstantPoolValue *NewCPV = 0;
+ // FIXME: The below assumes PIC relocation model and that the function
+ // is Thumb mode (t1 or t2). PCAdjustment would be 8 for ARM mode PIC, and
+ // zero for non-PIC in ARM or Thumb. The callers are all of thumb LDR
+ // instructions, so that's probably OK, but is PIC always correct when
+ // we get here?
if (ACPV->isGlobalValue())
NewCPV = new ARMConstantPoolValue(ACPV->getGV(), PCLabelId,
ARMCP::CPValue, 4);
@@ -932,6 +937,9 @@ static unsigned duplicateCPV(MachineFunction &MF, unsigned &CPI) {
else if (ACPV->isBlockAddress())
NewCPV = new ARMConstantPoolValue(ACPV->getBlockAddress(), PCLabelId,
ARMCP::CPBlockAddress, 4);
+ else if (ACPV->isLSDA())
+ NewCPV = new ARMConstantPoolValue(MF.getFunction(), PCLabelId,
+ ARMCP::CPLSDA, 4);
else
llvm_unreachable("Unexpected ARM constantpool value type!!");
CPI = MCP->getConstantPoolIndex(NewCPV, MCPE.getAlignment());