Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libc] newhdrgen: removed Include class #99584

Merged
merged 1 commit into from
Jul 18, 2024
Merged

Conversation

RoseZhang03
Copy link
Contributor

Include class is not used (includes are made through Macro class, Type
class, and imports from .h.def files).

Include class is not used (includes are made through Macro class, Type
class, and imports from .h.def files).
Copy link
Contributor

@michaelrj-google michaelrj-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@RoseZhang03 RoseZhang03 merged commit 043aca3 into llvm:main Jul 18, 2024
5 of 6 checks passed
@llvmbot llvmbot added the libc label Jul 19, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Jul 19, 2024

@llvm/pr-subscribers-libc

Author: None (RoseZhang03)

Changes

Include class is not used (includes are made through Macro class, Type
class, and imports from .h.def files).


Full diff: https://github.com/llvm/llvm-project/pull/99584.diff

4 Files Affected:

  • (removed) libc/newhdrgen/class_implementation/classes/include.py (-17)
  • (modified) libc/newhdrgen/gpu_headers.py (-1)
  • (modified) libc/newhdrgen/header.py (-7)
  • (modified) libc/newhdrgen/yaml_to_classes.py (-4)
diff --git a/libc/newhdrgen/class_implementation/classes/include.py b/libc/newhdrgen/class_implementation/classes/include.py
deleted file mode 100644
index 2657f2e7c931c..0000000000000
--- a/libc/newhdrgen/class_implementation/classes/include.py
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env python
-#
-# ====-- Include 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 Include:
-    def __init__(self, name):
-        self.name = name
-
-    def __str__(self):
-        return f'#include "{self.name}"'
diff --git a/libc/newhdrgen/gpu_headers.py b/libc/newhdrgen/gpu_headers.py
index cc13096cd47c1..d123e4af2de65 100644
--- a/libc/newhdrgen/gpu_headers.py
+++ b/libc/newhdrgen/gpu_headers.py
@@ -17,7 +17,6 @@ def __init__(self, name):
         self.enumerations = []
         self.objects = []
         self.functions = []
-        self.includes = []
 
     def add_macro(self, macro):
         self.macros.append(macro)
diff --git a/libc/newhdrgen/header.py b/libc/newhdrgen/header.py
index 141e3c9b2736b..7ec2dee596f8c 100644
--- a/libc/newhdrgen/header.py
+++ b/libc/newhdrgen/header.py
@@ -17,7 +17,6 @@ def __init__(self, name):
         self.enumerations = []
         self.objects = []
         self.functions = []
-        self.includes = []
 
     def add_macro(self, macro):
         self.macros.append(macro)
@@ -34,15 +33,9 @@ def add_object(self, object):
     def add_function(self, function):
         self.functions.append(function)
 
-    def add_include(self, include):
-        self.includes.append(include)
-
     def __str__(self):
         content = [""]
 
-        for include in self.includes:
-            content.append(str(include))
-
         for macro in self.macros:
             content.append(f"{macro}\n")
 
diff --git a/libc/newhdrgen/yaml_to_classes.py b/libc/newhdrgen/yaml_to_classes.py
index 205bb35fe691a..78588055cc960 100644
--- a/libc/newhdrgen/yaml_to_classes.py
+++ b/libc/newhdrgen/yaml_to_classes.py
@@ -16,7 +16,6 @@
 from class_implementation.classes.macro import Macro
 from class_implementation.classes.type import Type
 from class_implementation.classes.function import Function
-from class_implementation.classes.include import Include
 from class_implementation.classes.enumeration import Enumeration
 from class_implementation.classes.object import Object
 
@@ -103,9 +102,6 @@ def yaml_to_classes(yaml_data, header_class, entry_points=None):
             Object(object_data["object_name"], object_data["object_type"])
         )
 
-    for include_data in yaml_data.get("includes", []):
-        header.add_include(Include(include_data))
-
     return header
 
 

sgundapa pushed a commit to sgundapa/upstream_effort that referenced this pull request Jul 23, 2024
Include class is not used (includes are made through Macro class, Type
class, and imports from .h.def files).
yuxuanchen1997 pushed a commit that referenced this pull request Jul 25, 2024
Include class is not used (includes are made through Macro class, Type
class, and imports from .h.def files).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants