[llvm-commits] [dragonegg] r97390 - in /dragonegg/trunk: llvm-abi.h llvm-convert.cpp llvm-types.cpp

Duncan Sands baldrick at free.fr
Sun Feb 28 05:15:24 PST 2010


Author: baldrick
Date: Sun Feb 28 07:15:24 2010
New Revision: 97390

URL: http://llvm.org/viewvc/llvm-project?rev=97390&view=rev
Log:
Port commit 95385 (rafael) from llvm-gcc:
On linux ppc, don't use the inreg attribute to mark arguments that have to go to
memory. Use pad arguments instead.

I tested this with a llvm-gcc bootstrap + test-suite on linux x86-64 and with
test-suite run on linux pcc.

Thanks to Dale Johannesen for running the gcc compatibility tests  on darwin
ppc.

Modified:
    dragonegg/trunk/llvm-abi.h
    dragonegg/trunk/llvm-convert.cpp
    dragonegg/trunk/llvm-types.cpp

Modified: dragonegg/trunk/llvm-abi.h
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-abi.h?rev=97390&r1=97389&r2=97390&view=diff
==============================================================================
--- dragonegg/trunk/llvm-abi.h (original)
+++ dragonegg/trunk/llvm-abi.h Sun Feb 28 07:15:24 2010
@@ -119,6 +119,7 @@
   /// LLVM Struct, StructTy is the LLVM type of the struct we are entering.
   virtual void EnterField(unsigned FieldNo, const llvm::Type *StructTy) {}
   virtual void ExitField() {}
+  virtual void HandlePad(const llvm::Type *LLVMTy) {}
 };
 
 // LLVM_SHOULD_NOT_RETURN_COMPLEX_IN_MEMORY - A hook to allow

Modified: dragonegg/trunk/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-convert.cpp?rev=97390&r1=97389&r2=97390&view=diff
==============================================================================
--- dragonegg/trunk/llvm-convert.cpp (original)
+++ dragonegg/trunk/llvm-convert.cpp Sun Feb 28 07:15:24 2010
@@ -387,6 +387,10 @@
     /// getCallingConv - This provides the desired CallingConv for the function.
     CallingConv::ID& getCallingConv(void) { return CallingConv; }
 
+    void HandlePad(const llvm::Type *LLVMTy) {
+      ++AI;
+    }
+
     bool isShadowReturn() const {
       return isShadowRet;
     }
@@ -476,8 +480,7 @@
     }
 
     void HandleByValArgument(const llvm::Type *LLVMTy, tree type) {
-      // Should not get here.
-      abort();
+      ++AI;
     }
 
     void HandleFCAArgument(const llvm::Type *LLVMTy,
@@ -739,7 +742,7 @@
         TheDebugInfo->EmitDeclare(Args, dwarf::DW_TAG_arg_variable,
                                   Name, TREE_TYPE(Args),
                                   AI, Builder);
-      ++AI;
+      ABIConverter.HandleArgument(TREE_TYPE(Args), ScalarArgs);
     } else {
       // Otherwise, we create an alloca to hold the argument value and provide
       // an l-value.  On entry to the function, we copy formal argument values
@@ -2520,6 +2523,10 @@
       isShadowRet = true;
     }
 
+    void HandlePad(const llvm::Type *LLVMTy) {
+      CallOperands.push_back(UndefValue::get(LLVMTy));
+    }
+
     /// HandleScalarShadowResult - This callback is invoked if the function
     /// returns a scalar value by using a "shadow" first parameter, which is a
     /// pointer to the scalar, of type PtrArgTy.  If RetPtr is set to true,

Modified: dragonegg/trunk/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-types.cpp?rev=97390&r1=97389&r2=97390&view=diff
==============================================================================
--- dragonegg/trunk/llvm-types.cpp (original)
+++ dragonegg/trunk/llvm-types.cpp Sun Feb 28 07:15:24 2010
@@ -938,6 +938,10 @@
       HandleShadowResult(PtrArgTy, RetPtr);
     }
 
+    void HandlePad(const llvm::Type *LLVMTy) {
+      HandleScalarArgument(LLVMTy, 0, 0);
+    }
+
     void HandleScalarArgument(const llvm::Type *LLVMTy, tree type,
                               unsigned RealSize = 0) {
       if (KNRPromotion) {





More information about the llvm-commits mailing list