[llvm-commits] [llvm-gcc-4.2] r49232 - /llvm-gcc-4.2/trunk/gcc/llvm-abi.h

Devang Patel dpatel at apple.com
Fri Apr 4 14:19:19 PDT 2008


Author: dpatel
Date: Fri Apr  4 16:19:18 2008
New Revision: 49232

URL: http://llvm.org/viewvc/llvm-project?rev=49232&view=rev
Log:
Use LLVM type directly.

Modified:
    llvm-gcc-4.2/trunk/gcc/llvm-abi.h

Modified: llvm-gcc-4.2/trunk/gcc/llvm-abi.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-abi.h?rev=49232&r1=49231&r2=49232&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-abi.h (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-abi.h Fri Apr  4 16:19:18 2008
@@ -180,12 +180,12 @@
   return int_size_in_bytes(type) == 0;
 }
 
-// getLLVMScalarTypeForStructReturn - Return LLVM Type if TYPE can be 
+// getLLVMScalarTypeForStructReturn - Return LLVM Type if TY can be 
 // returned as a scalar, otherwise return NULL. This is the default
 // target independent implementation.
-static const Type* getLLVMScalarTypeForStructReturn(tree type) {
+static const Type* getLLVMScalarTypeForStructReturn(const Type *Ty) {
 
-  unsigned Size = TREE_INT_CST_LOW(TYPE_SIZE_UNIT(type));
+  unsigned Size = getTargetData().getABITypeSize(Ty);
   if (Size == 0)
     return Type::VoidTy;
   else if (Size == 1)
@@ -318,7 +318,7 @@
       } else {
         // Otherwise return as an integer value large enough to hold the entire
         // aggregate.
-        const Type* ScalarTy = getLLVMScalarTypeForStructReturn(type);
+        const Type* ScalarTy = getLLVMScalarTypeForStructReturn(Ty);
         if (ScalarTy)
           C.HandleAggregateResultAsScalar(ScalarTy);
         else {





More information about the llvm-commits mailing list