[libc-commits] [libc] [libc][hdrgen] Extend guard attribute support for types (PR #191663)

Victor Campos via libc-commits libc-commits at lists.llvm.org
Tue Apr 14 03:18:47 PDT 2026


================
@@ -338,3 +337,14 @@ def json_data(self):
             "standards": self.standards,
             "includes": sorted(str(file) for file in {COMMON_HEADER} | self.includes()),
         }
+
+    def __emit_guard(self, content, current_guard, new_guard):
+        if current_guard != new_guard:
----------------
vhscampos wrote:

This function only does something if this condition is true. Just move the condition outside the function, that is, check the condition at the call sites, not inside the function

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


More information about the libc-commits mailing list