Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: ppapi/generators/idl_gen_pnacl.py

Issue 10950042: PNaCl: Build a PPAPI shims library for all architectures (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ppapi/generators/idl_gen_wrapper.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Generator for Pnacl Shim functions that bridges the calling conventions 6 """Generator for Pnacl Shim functions that bridges the calling conventions
7 between GCC and PNaCl. """ 7 between GCC and PNaCl. """
8 8
9 from datetime import datetime 9 from datetime import datetime
10 import difflib 10 import difflib
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 self._skip_opt = False 44 self._skip_opt = False
45 self._pnacl_attribute = '__attribute__((pnaclcall))' 45 self._pnacl_attribute = '__attribute__((pnaclcall))'
46 46
47 ############################################################ 47 ############################################################
48 48
49 def OwnHeaderFile(self): 49 def OwnHeaderFile(self):
50 """Return the header file that specifies the API of this wrapper. 50 """Return the header file that specifies the API of this wrapper.
51 We do not generate the header files. """ 51 We do not generate the header files. """
52 return 'ppapi/generators/pnacl_shim.h' 52 return 'ppapi/generators/pnacl_shim.h'
53 53
54 def GetGuardStart(self):
55 return ('\n/* The PNaCl PPAPI shims are only needed on x86-64. */\n'
56 '#if defined(__x86_64__)\n\n')
57
58 def GetGuardEnd(self):
59 return '\n#endif\n'
60
54 def InterfaceNeedsWrapper(self, iface, releases): 61 def InterfaceNeedsWrapper(self, iface, releases):
55 """Return true if the interface has ANY methods that need wrapping. 62 """Return true if the interface has ANY methods that need wrapping.
56 """ 63 """
57 if self._skip_opt: 64 if self._skip_opt:
58 return True 65 return True
59 for release in iface.GetUniqueReleases(releases): 66 for release in iface.GetUniqueReleases(releases):
60 version = iface.GetVersion(release) 67 version = iface.GetVersion(release)
61 if self.InterfaceVersionNeedsWrapping(iface, version): 68 if self.InterfaceVersionNeedsWrapping(iface, version):
62 return True 69 return True
63 return False 70 return False
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 return TestFiles(filenames, test_releases) 233 return TestFiles(filenames, test_releases)
227 234
228 # Otherwise, generate the output file (for potential use as golden file). 235 # Otherwise, generate the output file (for potential use as golden file).
229 ast = ParseFiles(filenames) 236 ast = ParseFiles(filenames)
230 return pnaclgen.GenerateRange(ast, test_releases, filenames) 237 return pnaclgen.GenerateRange(ast, test_releases, filenames)
231 238
232 239
233 if __name__ == '__main__': 240 if __name__ == '__main__':
234 retval = Main(sys.argv[1:]) 241 retval = Main(sys.argv[1:])
235 sys.exit(retval) 242 sys.exit(retval)
OLDNEW
« no previous file with comments | « no previous file | ppapi/generators/idl_gen_wrapper.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698