summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-01-29 20:49:17 +0000
committerChris Lattner <sabre@nondot.org>2006-01-29 20:49:17 +0000
commit32058cfb7b822348c2a6f32d3ccffc34fb4e6911 (patch)
tree8e161273b435fc5043f8e2558623d44b7ab2f8d6 /llvm/lib
parenta8821624d4b99319dfa3930b1769ecb3234e62b8 (diff)
downloadbcm5719-llvm-32058cfb7b822348c2a6f32d3ccffc34fb4e6911.tar.gz
bcm5719-llvm-32058cfb7b822348c2a6f32d3ccffc34fb4e6911.zip
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 llvm-svn: 25793
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp3
-rw-r--r--llvm/lib/Target/PowerPC/PPCISelLowering.cpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp b/llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp
index d9d854bbfa4..8fd9a2957ee 100644
--- a/llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp
+++ b/llvm/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/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
index 2c3a0728896..3e8214a0574 100644
--- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud