diff options
author | Chris Lattner <sabre@nondot.org> | 2006-01-29 20:49:17 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-01-29 20:49:17 +0000 |
commit | 37dd6f1b79bd888cb88ced7e5ce5a8ebc7aa44e2 (patch) | |
tree | 2deda8bb3f7d4af0ca50b899f95c977ffb55d8fc | |
parent | 7859313bae07a5c46cbec7e5012483425fcda7c0 (diff) |
Functions that are lazily streamed in from the .bc file are *not* external.
This fixes llvm-test/SingleSource/UnitTests/2006-01-29-SimpleIndirectCall.c
and PR704
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25793 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/PowerPC/PPCCodeEmitter.cpp | 3 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCISelLowering.cpp | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/Target/PowerPC/PPCCodeEmitter.cpp b/lib/Target/PowerPC/PPCCodeEmitter.cpp index d9d854bbfa..8fd9a2957e 100644 --- a/lib/Target/PowerPC/PPCCodeEmitter.cpp +++ b/lib/Target/PowerPC/PPCCodeEmitter.cpp @@ -196,7 +196,8 @@ int PPCCodeEmitter::getMachineOpValue(MachineInstr &MI, MachineOperand &MO) { bool isExternal = MO.isExternalSymbol() || MO.getGlobal()->hasWeakLinkage() || MO.getGlobal()->hasLinkOnceLinkage() || - MO.getGlobal()->isExternal(); + (MO.getGlobal()->isExternal() && + !MO.getGlobal()->hasNotBeenReadFromBytecode()); unsigned Reloc = 0; if (MI.getOpcode() == PPC::BL) Reloc = PPC::reloc_pcrel_bx; diff --git a/lib/Target/PowerPC/PPCISelLowering.cpp b/lib/Target/PowerPC/PPCISelLowering.cpp index 2c3a072889..3e8214a057 100644 --- a/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/lib/Target/PowerPC/PPCISelLowering.cpp @@ -437,7 +437,8 @@ SDOperand PPCTargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) { SDOperand Lo = DAG.getNode(PPCISD::Lo, MVT::i32, GA, Zero); Lo = DAG.getNode(ISD::ADD, MVT::i32, Hi, Lo); - if (!GV->hasWeakLinkage() && !GV->hasLinkOnceLinkage() && !GV->isExternal()) + if (!GV->hasWeakLinkage() && !GV->hasLinkOnceLinkage() && + (!GV->isExternal() || GV->hasNotBeenReadFromBytecode())) return Lo; // If the global is weak or external, we have to go through the lazy |