[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp PPCISelLowering.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun Jan 29 12:49:29 PST 2006



Changes in directory llvm/lib/Target/PowerPC:

PPCCodeEmitter.cpp updated: 1.44 -> 1.45
PPCISelLowering.cpp updated: 1.79 -> 1.80
---
Log message:

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: http://llvm.cs.uiuc.edu/PR704 


---
Diffs of the changes:  (+4 -2)

 PPCCodeEmitter.cpp  |    3 ++-
 PPCISelLowering.cpp |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)


Index: llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp
diff -u llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp:1.44 llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp:1.45
--- llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp:1.44	Sun Jan 22 16:53:01 2006
+++ llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp	Sun Jan 29 14:49:17 2006
@@ -196,7 +196,8 @@
     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;


Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.79 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.80
--- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.79	Sun Jan 29 02:41:37 2006
+++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp	Sun Jan 29 14:49:17 2006
@@ -437,7 +437,8 @@
     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






More information about the llvm-commits mailing list