diff options
author | mseaborn@chromium.org <mseaborn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-26 23:38:35 +0000 |
---|---|---|
committer | mseaborn@chromium.org <mseaborn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-26 23:38:35 +0000 |
commit | c3064ecd51f4351a649b5dbea2879b0497320875 (patch) | |
tree | 187c88e4779eec5827938979ebb56ad88f94cb98 /ppapi/generators/idl_c_proto.py | |
parent | a7bed07581acc3812eda369aa86db1484b63f686 (diff) | |
download | chromium_src-c3064ecd51f4351a649b5dbea2879b0497320875.zip chromium_src-c3064ecd51f4351a649b5dbea2879b0497320875.tar.gz chromium_src-c3064ecd51f4351a649b5dbea2879b0497320875.tar.bz2 |
PNaCl PPAPI shims: Update for new PNaCl ABI for by-value struct passing
The PNaCl ABI is changing so that by-value struct arguments (and
return values) are expanded out to being passed by pointer, on all
architectures.
This means that __attribute__((pnaclcall)) no longer reflects PNaCl
user code's calling conventions, so we have to change the PNaCl PPAPI
shims. The new shims can be pure C without any special attributes.
Remove now-unused ptr_prefix argument.
This updates nacl_revision to pull in the following NaCl changes:
r11238: (kschimpf) Update pnacl_llvm_rev to 5712db994c8a4abb8c2512fb2900650f8335af66.
r11239: (mseaborn) Update PNaCl toolchain revision in TOOL_REVISIONS to get ExpandByVal
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3400
TEST=cd ppapi/generators && ./generator.py + compile shims
+ "ppapi/generators/idl_gen_pnacl.py --test"
Review URL: https://codereview.chromium.org/14134011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196881 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/generators/idl_c_proto.py')
-rwxr-xr-x | ppapi/generators/idl_c_proto.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/ppapi/generators/idl_c_proto.py b/ppapi/generators/idl_c_proto.py index 79656308..fff3e65 100755 --- a/ppapi/generators/idl_c_proto.py +++ b/ppapi/generators/idl_c_proto.py @@ -398,7 +398,7 @@ class CGen(object): def Compose(self, rtype, name, arrayspec, callspec, prefix, func_as_ptr, - ptr_prefix, include_name, unsized_as_ptr): + include_name, unsized_as_ptr): self.LogEnter('Compose: %s %s' % (rtype, name)) arrayspec = ''.join(arrayspec) @@ -417,10 +417,10 @@ class CGen(object): params = [] for ptype, pname, parray, pspec in callspec: params.append(self.Compose(ptype, pname, parray, pspec, '', True, - ptr_prefix='', include_name=True, + include_name=True, unsized_as_ptr=unsized_as_ptr)) if func_as_ptr: - name = '(%s*%s)' % (ptr_prefix, name) + name = '(*%s)' % name if not params: params = ['void'] out = '%s %s(%s)' % (rtype, name, ', '.join(params)) @@ -433,14 +433,13 @@ class CGen(object): # Returns the 'C' style signature of the object # prefix - A prefix for the object's name # func_as_ptr - Formats a function as a function pointer - # ptr_prefix - A prefix that goes before the "*" for a function pointer # include_name - If true, include member name in the signature. - # If false, leave it out. In any case, prefix and ptr_prefix - # are always included. + # If false, leave it out. In any case, prefix is always + # included. # include_version - if True, include version in the member name # def GetSignature(self, node, release, mode, prefix='', func_as_ptr=True, - ptr_prefix='', include_name=True, include_version=False): + include_name=True, include_version=False): self.LogEnter('GetSignature %s %s as func=%s' % (node, mode, func_as_ptr)) rtype, name, arrayspec, callspec = self.GetComponents(node, release, mode) @@ -451,7 +450,7 @@ class CGen(object): unsized_as_ptr = not callspec out = self.Compose(rtype, name, arrayspec, callspec, prefix, - func_as_ptr, ptr_prefix, include_name, unsized_as_ptr) + func_as_ptr, include_name, unsized_as_ptr) self.LogExit('Exit GetSignature: %s' % out) return out |