Skip to content

Commit

Permalink
added ARGN to CMakeLists function call and reformatted __NOEXCEPT
Browse files Browse the repository at this point in the history
  • Loading branch information
RoseZhang03 committed Jul 17, 2024
1 parent 3ffc0ee commit 50da8f0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions libc/include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ macro(add_header_macro TARGET_NAME YAML_FILE DEF_FILE GEN_HDR DEPENDS)
DEF_FILE ${DEF_FILE}
GEN_HDR ${GEN_HDR}
${DEPENDS}
${ARGN}
)
else()
add_gen_header(
${TARGET_NAME}
DEF_FILE ${DEF_FILE}
GEN_HDR ${GEN_HDR}
${DEPENDS}
${ARGN}
)
endif()
endmacro()
Expand Down
4 changes: 2 additions & 2 deletions libc/newhdrgen/class_implementation/classes/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __str__(self):
attributes_str = " ".join(self.attributes)
arguments_str = ", ".join(self.arguments)
if attributes_str == "":
result = f"{self.return_type} {self.name}({arguments_str});"
result = f"{self.return_type} {self.name}({arguments_str}) __NOEXCEPT;"

This comment has been minimized.

Copy link
@aaryanshukla

aaryanshukla Jul 17, 2024

Contributor

Revert this back to using NOEXCEPT in header.py. Since we use function.py for libc and gpu headers, the NOEXCEPT is not needed for gpu headers so we can move it to header.py instead.

else:
result = f"{attributes_str} {self.return_type} {self.name}({arguments_str})"
result = f"{attributes_str} {self.return_type} {self.name}({arguments_str}) __NOEXCEPT;"
return result
8 changes: 4 additions & 4 deletions libc/newhdrgen/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,24 @@ def __str__(self):
current_guard = None
for function in self.functions:
if function.guard == None:
content.append(str(function) + " __NOEXCEPT;")
content.append(str(function))
content.append("")
else:
if current_guard == None:
current_guard = function.guard
content.append(f"#ifdef {current_guard}")
content.append(str(function) + " __NOEXCEPT;")
content.append(str(function))
content.append("")
elif current_guard == function.guard:
content.append(str(function) + " __NOEXCEPT;")
content.append(str(function))
content.append("")
else:
content.pop()
content.append(f"#endif // {current_guard}")
content.append("")
current_guard = function.guard
content.append(f"#ifdef {current_guard}")
content.append(str(function) + " __NOEXCEPT;")
content.append(str(function))
content.append("")
if current_guard != None:
content.pop()
Expand Down

0 comments on commit 50da8f0

Please sign in to comment.