[llvm-commits] [llvm] r156837 - in /llvm/trunk/utils/llvm-build/llvmbuild: componentinfo.py main.py

Daniel Dunbar daniel at zuster.org
Tue May 15 11:44:13 PDT 2012


Author: ddunbar
Date: Tue May 15 13:44:12 2012
New Revision: 156837

URL: http://llvm.org/viewvc/llvm-project?rev=156837&view=rev
Log:
llvm-build: Don't emit library information for disabled targets.

Modified:
    llvm/trunk/utils/llvm-build/llvmbuild/componentinfo.py
    llvm/trunk/utils/llvm-build/llvmbuild/main.py

Modified: llvm/trunk/utils/llvm-build/llvmbuild/componentinfo.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/llvm-build/llvmbuild/componentinfo.py?rev=156837&r1=156836&r2=156837&view=diff
==============================================================================
--- llvm/trunk/utils/llvm-build/llvmbuild/componentinfo.py (original)
+++ llvm/trunk/utils/llvm-build/llvmbuild/componentinfo.py Tue May 15 13:44:12 2012
@@ -68,6 +68,21 @@
     def get_llvmbuild_fragment(self):
         abstract
 
+    def get_parent_target_group(self):
+        """get_parent_target_group() -> ComponentInfo or None
+
+        Return the nearest parent target group (if any), or None if the
+        component is not part of any target group.
+        """
+
+        # If this is a target group, return it.
+        if self.type_name == 'TargetGroup':
+            return self
+
+        # Otherwise recurse on the parent, if any.
+        if self.parent_instance:
+            return self.parent_instance.get_parent_target_group()
+
 class GroupComponentInfo(ComponentInfo):
     """
     Group components have no semantics as far as the build system are concerned,

Modified: llvm/trunk/utils/llvm-build/llvmbuild/main.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/llvm-build/llvmbuild/main.py?rev=156837&r1=156836&r2=156837&view=diff
==============================================================================
--- llvm/trunk/utils/llvm-build/llvmbuild/main.py (original)
+++ llvm/trunk/utils/llvm-build/llvmbuild/main.py Tue May 15 13:44:12 2012
@@ -319,11 +319,16 @@
         # dependencies for added library groups.
         entries = {}
         for c in self.ordered_component_infos:
-            # Skip optional components which are not enabled
+            # Skip optional components which are not enabled.
             if c.type_name == 'OptionalLibrary' \
                 and c.name not in enabled_optional_components:
                 continue
 
+            # Skip target groups which are not enabled.
+            tg = c.get_parent_target_group()
+            if tg and not tg.enabled:
+                continue
+
             # Only certain components are in the table.
             if c.type_name not in ('Library', 'OptionalLibrary', \
                                    'LibraryGroup', 'TargetGroup'):





More information about the llvm-commits mailing list