Roland McGrath 07e13b764d
[libc] Remove unnecessary subdirectory layers in utils/hdrgen (#121363)
Two extra layers of subdirectory for a handful of single-symbol
Python source files did not improve anything, and it complicated
integration of the hdrgen Python outside the LLVM CMake build.
2024-12-30 17:28:59 -08:00

20 lines
639 B
Python

# ====-- Macro class for libc function headers ----------------*- python -*--==#
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
# ==-------------------------------------------------------------------------==#
class Macro:
def __init__(self, name, value=None):
self.name = name
self.value = value
def __str__(self):
if self.value != None:
return f"#define {self.name} {self.value}"
else:
return f"#define {self.name}"