[llvm-branch-commits] [llvm-branch] r92944 - in /llvm/branches/Apple/Zoidberg/lib/Target: TargetLoweringObjectFile.cpp X86/X86FastISel.cpp

Eric Christopher echristo at apple.com
Thu Jan 7 13:03:07 PST 2010


Author: echristo
Date: Thu Jan  7 15:03:06 2010
New Revision: 92944

URL: http://llvm.org/viewvc/llvm-project?rev=92944&view=rev
Log:
Merge revisions 92933 and 92934 from mainline, fixes
rdar://7452959


Modified:
    llvm/branches/Apple/Zoidberg/lib/Target/TargetLoweringObjectFile.cpp
    llvm/branches/Apple/Zoidberg/lib/Target/X86/X86FastISel.cpp

Modified: llvm/branches/Apple/Zoidberg/lib/Target/TargetLoweringObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/lib/Target/TargetLoweringObjectFile.cpp?rev=92944&r1=92943&r2=92944&view=diff

==============================================================================
--- llvm/branches/Apple/Zoidberg/lib/Target/TargetLoweringObjectFile.cpp (original)
+++ llvm/branches/Apple/Zoidberg/lib/Target/TargetLoweringObjectFile.cpp Thu Jan  7 15:03:06 2010
@@ -922,7 +922,7 @@
 TargetLoweringObjectFileMachO::getSectionForConstant(SectionKind Kind) const {
   // If this constant requires a relocation, we have to put it in the data
   // segment, not in the text segment.
-  if (Kind.isDataRel())
+  if (Kind.isDataRel() || Kind.isReadOnlyWithRel())
     return ConstDataSection;
 
   if (Kind.isMergeableConst4())

Modified: llvm/branches/Apple/Zoidberg/lib/Target/X86/X86FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/lib/Target/X86/X86FastISel.cpp?rev=92944&r1=92943&r2=92944&view=diff

==============================================================================
--- llvm/branches/Apple/Zoidberg/lib/Target/X86/X86FastISel.cpp (original)
+++ llvm/branches/Apple/Zoidberg/lib/Target/X86/X86FastISel.cpp Thu Jan  7 15:03:06 2010
@@ -19,6 +19,7 @@
 #include "X86RegisterInfo.h"
 #include "X86Subtarget.h"
 #include "X86TargetMachine.h"
+#include "llvm/Constant.h"
 #include "llvm/CallingConv.h"
 #include "llvm/DerivedTypes.h"
 #include "llvm/GlobalVariable.h"
@@ -1652,6 +1653,12 @@
     PICBase = X86::RIP;
   }
 
+  // If we've gotten here we need to make sure we don't have a constant
+  // that needs a relocation, because then we shouldn't put it into the
+  // constant pool.
+  if (C->getRelocationInfo() != Constant::NoRelocation)
+    return 0;
+  
   // Create the load from the constant pool.
   unsigned MCPOffset = MCP.getConstantPoolIndex(C, Align);
   unsigned ResultReg = createResultReg(RC);





More information about the llvm-branch-commits mailing list