Paste: llvm patch for mingw64

Author: kssreeram
Mode: patch
Date: Wed, 5 Jan 2011 23:32:21
Plain Text |
Index: lib/Target/X86/X86FrameInfo.cpp

===================================================================

--- lib/Target/X86/X86FrameInfo.cpp	(revision 122869)

+++ lib/Target/X86/X86FrameInfo.cpp	(working copy)

@@ -566,6 +566,8 @@

 
     const char *StackProbeSymbol =
       STI.isTargetWindows() ? "_chkstk" : "_alloca";
+    if (Is64Bit && STI.isTargetCygMing())
+      StackProbeSymbol = "__chkstk";
     unsigned CallOp = Is64Bit ? X86::CALL64pcrel32 : X86::CALLpcrel32;
     if (!isEAXAlive) {
       BuildMI(MBB, MBBI, DL, TII.get(X86::MOV32ri), X86::EAX)
Index: lib/Target/X86/X86ISelDAGToDAG.cpp

===================================================================

--- lib/Target/X86/X86ISelDAGToDAG.cpp	(revision 122869)

+++ lib/Target/X86/X86ISelDAGToDAG.cpp	(working copy)

@@ -530,9 +530,12 @@

 void X86DAGToDAGISel::EmitSpecialCodeForMain(MachineBasicBlock *BB,
                                              MachineFrameInfo *MFI) {
   const TargetInstrInfo *TII = TM.getInstrInfo();
-  if (Subtarget->isTargetCygMing())
+  if (Subtarget->isTargetCygMing()) {
+    unsigned CallOp =
+      Subtarget->is64Bit() ? X86::CALL64pcrel32 : X86::CALLpcrel32;
     BuildMI(BB, DebugLoc(),
-            TII->get(X86::CALLpcrel32)).addExternalSymbol("__main");
+            TII->get(CallOp)).addExternalSymbol("__main");
+  }
 }
 
 void X86DAGToDAGISel::EmitFunctionEntryCode() {

New Annotation

Summary:
Author:
Mode:
Body: