From 4214723eda328720c9c68046270f597ced5a61ca Mon Sep 17 00:00:00 2001 From: Rachida Kebichi Date: Tue, 4 May 2021 11:30:43 -0400 Subject: [PATCH] SWDEV-283958 Workaround for unnamed structs CppHeaderParser has limited support for unnamed structs. It leaves the name empty so this results in classes (a.k.a structs) having trailing '::' characters, also giving no way to distingush two unnamed structs at the same level of nesting. An example are the inner structs of hipExternalSemaphoreSignalParams. The workaround consists in skipping over these, so they are not generated in the output header file which lists all ostream ops<<. Only the inner unnamed structs are skipped, the rest is processed as it should. Change-Id: I17439c46095469b7adb7aee0b0f0b3d234aabc11 [ROCm/roctracer commit: faada3e569766163c854a4d95ca8630199ddac60] --- projects/roctracer/script/gen_ostream_ops.py | 1 + 1 file changed, 1 insertion(+) diff --git a/projects/roctracer/script/gen_ostream_ops.py b/projects/roctracer/script/gen_ostream_ops.py index 180103a54e..0ffb43ef07 100755 --- a/projects/roctracer/script/gen_ostream_ops.py +++ b/projects/roctracer/script/gen_ostream_ops.py @@ -147,6 +147,7 @@ def gen_cppheader(infilepath, outfilepath, rank): output_filename_h.write("// End of basic ostream ops\n\n") for c in cppHeader.classes: + if c[-2] == ':' and c[-1] == ':': continue #ostream operator cannot be overloaded for anonymous struct therefore it is skipped if "union" in c: continue if c in structs_analyzed: