1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_bridges.hxx"
26 
27 #include "abi.hxx"
28 
29 #include <rtl/ustring.hxx>
30 
31 using namespace x86_64;
32 
return_in_hidden_param(typelib_TypeDescriptionReference * pTypeRef)33 bool x86_64::return_in_hidden_param( typelib_TypeDescriptionReference *pTypeRef )
34 {
35     switch ( pTypeRef->eTypeClass )
36     {
37         case typelib_TypeClass_VOID:
38             return false;
39         case typelib_TypeClass_CHAR:
40         case typelib_TypeClass_BOOLEAN:
41         case typelib_TypeClass_BYTE:
42         case typelib_TypeClass_SHORT:
43         case typelib_TypeClass_UNSIGNED_SHORT:
44         case typelib_TypeClass_LONG:
45         case typelib_TypeClass_UNSIGNED_LONG:
46         case typelib_TypeClass_HYPER:
47         case typelib_TypeClass_UNSIGNED_HYPER:
48         case typelib_TypeClass_ENUM:
49             return false;
50         case typelib_TypeClass_FLOAT:
51             return false;
52         case typelib_TypeClass_DOUBLE:
53             return false;
54         case typelib_TypeClass_STRING:
55         case typelib_TypeClass_TYPE:
56         case typelib_TypeClass_ANY:
57         case typelib_TypeClass_TYPEDEF:
58         case typelib_TypeClass_UNION:
59         case typelib_TypeClass_SEQUENCE:
60         case typelib_TypeClass_ARRAY:
61         case typelib_TypeClass_INTERFACE:
62             return true;
63         case typelib_TypeClass_STRUCT:
64         case typelib_TypeClass_EXCEPTION:
65             {
66                 typelib_TypeDescription * pTypeDescr = 0;
67                 TYPELIB_DANGER_GET( &pTypeDescr, pTypeRef );
68 
69                 /* If the struct is larger than 8 bytes, pass it on the stack.  */
70                 if ( pTypeDescr->nSize > 8 )
71                 {
72                     TYPELIB_DANGER_RELEASE( pTypeDescr );
73                     return false;
74                 }
75                 else
76                 {
77                     TYPELIB_DANGER_RELEASE( pTypeDescr );
78                     return true;
79                 }
80             }
81 
82         default:
83 #if OSL_DEBUG_LEVEL > 1
84             OSL_TRACE( "Unhandled case: pType->eTypeClass == %d\n", pTypeRef->eTypeClass );
85 #endif
86             OSL_ASSERT(0);
87     }
88     return 0; /* Never reached.  */
89 }
90 
91