[libc-commits] [libc] [libc] Add some integration features into newhdrgen (PR #114272)

Michael Jones via libc-commits libc-commits at lists.llvm.org
Tue Dec 10 11:07:29 PST 2024


================
@@ -252,30 +273,62 @@ def main():
     )
     args = parser.parse_args()
 
+    def write_to_file(path, contents):
+        if (
+            not args.write_if_changed
+            or not path.exists()
+            or path.read_text() != contents
+        ):
+            path.write_text(contents)
----------------
michaelrj-google wrote:

given that this is only used in one place at the moment, would it make more sense to inline this function?

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


More information about the libc-commits mailing list