Skip to content

Commit 078d13e

Browse files
committed
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
1 parent fc8a7d8 commit 078d13e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,11 @@ static unsigned duplicateCPV(MachineFunction &MF, unsigned &CPI) {
923923

924924
unsigned PCLabelId = AFI->createConstPoolEntryUId();
925925
ARMConstantPoolValue *NewCPV = 0;
926+
// FIXME: The below assumes PIC relocation model and that the function
927+
// is Thumb mode (t1 or t2). PCAdjustment would be 8 for ARM mode PIC, and
928+
// zero for non-PIC in ARM or Thumb. The callers are all of thumb LDR
929+
// instructions, so that's probably OK, but is PIC always correct when
930+
// we get here?
926931
if (ACPV->isGlobalValue())
927932
NewCPV = new ARMConstantPoolValue(ACPV->getGV(), PCLabelId,
928933
ARMCP::CPValue, 4);
@@ -932,6 +937,9 @@ static unsigned duplicateCPV(MachineFunction &MF, unsigned &CPI) {
932937
else if (ACPV->isBlockAddress())
933938
NewCPV = new ARMConstantPoolValue(ACPV->getBlockAddress(), PCLabelId,
934939
ARMCP::CPBlockAddress, 4);
940+
else if (ACPV->isLSDA())
941+
NewCPV = new ARMConstantPoolValue(MF.getFunction(), PCLabelId,
942+
ARMCP::CPLSDA, 4);
935943
else
936944
llvm_unreachable("Unexpected ARM constantpool value type!!");
937945
CPI = MCP->getConstantPoolIndex(NewCPV, MCPE.getAlignment());

0 commit comments

Comments
 (0)