summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-09-10 21:38:22 +0000
committerJim Grosbach <grosbach@apple.com>2010-09-10 21:38:22 +0000
commit1f77ee5691ea21e55a3f987fd7055cb3f2598459 (patch)
treef1912e04fce152357d77b1d111d5b52e4b4340f9
parentc48e6e9f28a72312476906a0375731772b544176 (diff)
downloadbcm5719-llvm-1f77ee5691ea21e55a3f987fd7055cb3f2598459.tar.gz
bcm5719-llvm-1f77ee5691ea21e55a3f987fd7055cb3f2598459.zip
Add a missing case to duplicateCPV() for LSDA constants. Add a FIXME. rdar://8302157
llvm-svn: 113637
-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 e7b35c69288..e7024d6da71 100644
--- a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
+++ b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
@@ -922,6 +922,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);
@@ -931,6 +936,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());
OpenPOWER on IntegriCloud