print('Error: New sync IPC messages must be reviewed by an IPC peer and recorded in %s' % options.syncMsgList, file=sys.stderr) # NOQA: E501 sys.exit(1) if not ipdl.checkFixedSyncMessages(parser): # Errors have alraedy been printed to stderr, just exit sys.exit(1) # Second pass: generate code for f in files: # Read from parser cache filename = normalizedFilename(f) ast = ipdl.parse(None, filename, includedirs=includedirs) ipdl.gencxx(filename, ast, headersdir, cppdir, segmentCapacityDict) if ast.protocol: allmessages[ast.protocol.name] = ipdl.genmsgenum(ast) allprotocols.append(ast.protocol.name) # e.g. PContent::RequestMemoryReport (not prefixed or suffixed.) for md in ast.protocol.messageDecls: allmessageprognames.append('%s::%s' % (md.namespace, md.decl.progname)) allprotocols.sort() # Check if we have undefined message names in segmentCapacityDict. # This is a fool-proof of the 'message-metadata.ini' file. undefinedMessages = set(segmentCapacityDict.keys()) - set(allmessageprognames) if len(undefinedMessages) > 0: print('Error: Undefined message names in message-metadata.ini:', file=sys.stderr) print(undefinedMessages, file=sys.stderr) sys.exit(1)
log(3, ' pretty printed code:') ipdl.genipdl(ast, codedir) if not ipdl.checkFixedSyncMessages(parser): # Errors have alraedy been printed to stderr, just exit sys.exit(1) # Second pass: generate code for f in files: # Read from parser cache filename = normalizedFilename(f) ast = ipdl.parse(None, filename, includedirs=includedirs) ipdl.gencxx(filename, ast, headersdir, cppdir) if ast.protocol: allmessages[ast.protocol.name] = ipdl.genmsgenum(ast) allprotocols.append('%sMsgStart' % ast.protocol.name) allprotocols.sort() ipcmsgstart = StringIO() print >>ipcmsgstart, """ // CODE GENERATED by ipdl.py. Do not edit. #ifndef IPCMessageStart_h #define IPCMessageStart_h enum IPCMessageStart { """