Update gen_ostream_ops.py

[ROCm/roctracer commit: 2901da60a5]
This commit is contained in:
rkebichi
2020-01-24 10:19:09 -05:00
committed by GitHub
parent 2c8940e2cb
commit c0510a4ffa
+2 -6
View File
@@ -121,8 +121,7 @@ def process_struct(f,c,cppHeader,nname,apiname):
nc = c+"::"
process_struct(f,nc,cppHeader,name,apiname)
def gen_cppheader(infilepath, includes, outfilepath):
def gen_cppheader(infilepath, outfilepath):
try:
cppHeader = CppHeaderParser.CppHeader(infilepath)
except CppHeaderParser.CppParseError as e:
@@ -146,8 +145,6 @@ def gen_cppheader(infilepath, includes, outfilepath):
'#include <iostream>\n' + \
'\n' + \
'#include "roctracer.h"\n'
for w in includes.split(','):
HEADER_S += '#include "' + w + '"\n'
f.write(HEADER_S)
f.write('\n')
f.write('namespace roctracer {\n')
@@ -188,10 +185,9 @@ def gen_cppheader(infilepath, includes, outfilepath):
parser = argparse.ArgumentParser(description='genOstreamOps.py: generates ostream operators for all typedefs in provided input file.')
requiredNamed = parser.add_argument_group('Required arguments')
requiredNamed.add_argument('-in', metavar='file', help='Header file to be parsed', required=True)
requiredNamed.add_argument('-includes', metavar='list', help='Comma separated list of include file names', required=True)
requiredNamed.add_argument('-out', metavar='file', help='Output file with ostream operators', required=True)
args = vars(parser.parse_args())
if __name__ == '__main__':
gen_cppheader(args['in'],args['includes'],args['out'])
gen_cppheader(args['in'],args['out'])