[libc-commits] [libc] [libc] newhdrgen: updated sorting of guarded functions in fuction generation (PR #98241)

via libc-commits libc-commits at lists.llvm.org
Tue Jul 9 16:46:22 PDT 2024


================
@@ -23,9 +23,12 @@ def __init__(
         self.attributes = attributes or ""
 
     def __str__(self):
-        attributes_str = self.attributes
+        attributes_str = " ".join(self.attributes)
         arguments_str = ", ".join(self.arguments)
-        result = f"{self.return_type} {self.name}({arguments_str}){attributes_str};"
+        if attributes_str == "":
----------------
RoseZhang03 wrote:

That's what I wanted to do, but if we have attributes we will need a space between the attribute and the return type. Normally there would be no space in front.

https://github.com/llvm/llvm-project/pull/98241


More information about the libc-commits mailing list