FuncCallExprAST.py (9230:33eb3c8a98b9) FuncCallExprAST.py (9271:3859f5d4f2c6)
1# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
2# Copyright (c) 2009 The Hewlett-Packard Development Company
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

--- 192 unchanged lines hidden (view full) ---

201 code("unset_cache_entry(m_cache_entry_ptr);");
202 elif self.proc_name == "set_tbe":
203 code("set_tbe(m_tbe_ptr, %s);" %(cvec[0]));
204 elif self.proc_name == "unset_tbe":
205 code("unset_tbe(m_tbe_ptr);");
206
207 else:
208 # Normal function
1# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
2# Copyright (c) 2009 The Hewlett-Packard Development Company
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

--- 192 unchanged lines hidden (view full) ---

201 code("unset_cache_entry(m_cache_entry_ptr);");
202 elif self.proc_name == "set_tbe":
203 code("set_tbe(m_tbe_ptr, %s);" %(cvec[0]));
204 elif self.proc_name == "unset_tbe":
205 code("unset_tbe(m_tbe_ptr);");
206
207 else:
208 # Normal function
209
210 # if the func is internal to the chip but not the machine
211 # then it can only be accessed through the chip pointer
212 internal = ""
213 if "external" not in func and not func.isInternalMachineFunc:
209 if "external" not in func and not func.isInternalMachineFunc:
214 internal = "m_chip_ptr->"
210 self.error("Invalid function")
215
216 params = ""
217 first_param = True
218
219 for (param_code, type) in zip(cvec, type_vec):
220 if first_param:
221 params = str(param_code)
222 first_param = False
223 else:
224 params += ', '
225 params += str(param_code);
226
227 fix = code.nofix()
211
212 params = ""
213 first_param = True
214
215 for (param_code, type) in zip(cvec, type_vec):
216 if first_param:
217 params = str(param_code)
218 first_param = False
219 else:
220 params += ', '
221 params += str(param_code);
222
223 fix = code.nofix()
228 code('(${internal}${{func.c_ident}}($params))')
224 code('(${{func.c_ident}}($params))')
229 code.fix(fix)
230
231 return func.return_type
225 code.fix(fix)
226
227 return func.return_type