[llvm-commits] [llvm] r146436 - in /llvm/trunk: ./ lib/ lib/Analysis/ lib/Bitcode/ lib/CodeGen/ lib/ExecutionEngine/ lib/MC/ lib/Target/ lib/Target/ARM/ lib/Target/CBackend/ lib/Target/CellSPU/ lib/Target/CppBackend/ lib/Target/Hexagon/ lib/Target/Hexagon/TargetInfo/ lib/Target/MBlaze/ lib/Target/MSP430/ lib/Target/Mips/ lib/Target/PTX/ lib/Target/PowerPC/ lib/Target/Sparc/ lib/Target/X86/ lib/Target/XCore/ lib/Transforms/ tools/ utils/ utils/llvm-build/llvmbuild/
Daniel Dunbar
daniel at zuster.org
Mon Dec 12 14:45:54 PST 2011
Author: ddunbar
Date: Mon Dec 12 16:45:54 2011
New Revision: 146436
URL: http://llvm.org/viewvc/llvm-project?rev=146436&view=rev
Log:
LLVMBuild: Introduce a common section which currently has a list of the
subdirectories to traverse into.
- Originally I wanted to avoid this and just autoscan, but this has one key
flaw in that new subdirectories can not automatically trigger a rerun of the
llvm-build tool. This is particularly a pain when switching back and forth
between trees where one has added a subdirectory, as the dependencies will
tend to be wrong. This will also eliminates FIXME implicitly.
Modified:
llvm/trunk/LLVMBuild.txt
llvm/trunk/lib/Analysis/LLVMBuild.txt
llvm/trunk/lib/Bitcode/LLVMBuild.txt
llvm/trunk/lib/CodeGen/LLVMBuild.txt
llvm/trunk/lib/ExecutionEngine/LLVMBuild.txt
llvm/trunk/lib/LLVMBuild.txt
llvm/trunk/lib/MC/LLVMBuild.txt
llvm/trunk/lib/Target/ARM/LLVMBuild.txt
llvm/trunk/lib/Target/CBackend/LLVMBuild.txt
llvm/trunk/lib/Target/CellSPU/LLVMBuild.txt
llvm/trunk/lib/Target/CppBackend/LLVMBuild.txt
llvm/trunk/lib/Target/Hexagon/LLVMBuild.txt
llvm/trunk/lib/Target/Hexagon/TargetInfo/LLVMBuild.txt
llvm/trunk/lib/Target/LLVMBuild.txt
llvm/trunk/lib/Target/MBlaze/LLVMBuild.txt
llvm/trunk/lib/Target/MSP430/LLVMBuild.txt
llvm/trunk/lib/Target/Mips/LLVMBuild.txt
llvm/trunk/lib/Target/PTX/LLVMBuild.txt
llvm/trunk/lib/Target/PowerPC/LLVMBuild.txt
llvm/trunk/lib/Target/Sparc/LLVMBuild.txt
llvm/trunk/lib/Target/X86/LLVMBuild.txt
llvm/trunk/lib/Target/XCore/LLVMBuild.txt
llvm/trunk/lib/Transforms/LLVMBuild.txt
llvm/trunk/tools/LLVMBuild.txt
llvm/trunk/utils/LLVMBuild.txt
llvm/trunk/utils/llvm-build/llvmbuild/main.py
Modified: llvm/trunk/LLVMBuild.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/LLVMBuild.txt?rev=146436&r1=146435&r2=146436&view=diff
==============================================================================
--- llvm/trunk/LLVMBuild.txt (original)
+++ llvm/trunk/LLVMBuild.txt Mon Dec 12 16:45:54 2011
@@ -15,6 +15,9 @@
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = bindings docs examples lib projects runtime tools utils
+
[component_0]
type = Group
name = Miscellaneous
Modified: llvm/trunk/lib/Analysis/LLVMBuild.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LLVMBuild.txt?rev=146436&r1=146435&r2=146436&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LLVMBuild.txt (original)
+++ llvm/trunk/lib/Analysis/LLVMBuild.txt Mon Dec 12 16:45:54 2011
@@ -15,6 +15,9 @@
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = IPA
+
[component_0]
type = Library
name = Analysis
Modified: llvm/trunk/lib/Bitcode/LLVMBuild.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/LLVMBuild.txt?rev=146436&r1=146435&r2=146436&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/LLVMBuild.txt (original)
+++ llvm/trunk/lib/Bitcode/LLVMBuild.txt Mon Dec 12 16:45:54 2011
@@ -15,6 +15,9 @@
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = Reader Writer
+
[component_0]
type = Group
name = Bitcode
Modified: llvm/trunk/lib/CodeGen/LLVMBuild.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMBuild.txt?rev=146436&r1=146435&r2=146436&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LLVMBuild.txt (original)
+++ llvm/trunk/lib/CodeGen/LLVMBuild.txt Mon Dec 12 16:45:54 2011
@@ -15,6 +15,9 @@
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = AsmPrinter SelectionDAG
+
[component_0]
type = Library
name = CodeGen
Modified: llvm/trunk/lib/ExecutionEngine/LLVMBuild.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/LLVMBuild.txt?rev=146436&r1=146435&r2=146436&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/LLVMBuild.txt (original)
+++ llvm/trunk/lib/ExecutionEngine/LLVMBuild.txt Mon Dec 12 16:45:54 2011
@@ -15,6 +15,9 @@
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = Interpreter JIT MCJIT RuntimeDyld
+
[component_0]
type = Library
name = ExecutionEngine
Modified: llvm/trunk/lib/LLVMBuild.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LLVMBuild.txt?rev=146436&r1=146435&r2=146436&view=diff
==============================================================================
--- llvm/trunk/lib/LLVMBuild.txt (original)
+++ llvm/trunk/lib/LLVMBuild.txt Mon Dec 12 16:45:54 2011
@@ -15,6 +15,9 @@
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = Analysis Archive AsmParser Bitcode CodeGen DebugInfo ExecutionEngine Linker MC Object Support TableGen Target Transforms VMCore
+
[component_0]
type = Group
name = Libraries
Modified: llvm/trunk/lib/MC/LLVMBuild.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/LLVMBuild.txt?rev=146436&r1=146435&r2=146436&view=diff
==============================================================================
--- llvm/trunk/lib/MC/LLVMBuild.txt (original)
+++ llvm/trunk/lib/MC/LLVMBuild.txt Mon Dec 12 16:45:54 2011
@@ -15,6 +15,9 @@
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = MCDisassembler MCParser
+
[component_0]
type = Library
name = MC
Modified: llvm/trunk/lib/Target/ARM/LLVMBuild.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/LLVMBuild.txt?rev=146436&r1=146435&r2=146436&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/LLVMBuild.txt (original)
+++ llvm/trunk/lib/Target/ARM/LLVMBuild.txt Mon Dec 12 16:45:54 2011
@@ -15,6 +15,9 @@
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = AsmParser Disassembler InstPrinter MCTargetDesc TargetInfo
+
[component_0]
type = TargetGroup
name = ARM
Modified: llvm/trunk/lib/Target/CBackend/LLVMBuild.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/LLVMBuild.txt?rev=146436&r1=146435&r2=146436&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CBackend/LLVMBuild.txt (original)
+++ llvm/trunk/lib/Target/CBackend/LLVMBuild.txt Mon Dec 12 16:45:54 2011
@@ -15,6 +15,9 @@
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = TargetInfo
+
[component_0]
type = TargetGroup
name = CBackend
Modified: llvm/trunk/lib/Target/CellSPU/LLVMBuild.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/LLVMBuild.txt?rev=146436&r1=146435&r2=146436&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CellSPU/LLVMBuild.txt (original)
+++ llvm/trunk/lib/Target/CellSPU/LLVMBuild.txt Mon Dec 12 16:45:54 2011
@@ -15,6 +15,9 @@
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = MCTargetDesc TargetInfo
+
[component_0]
type = TargetGroup
name = CellSPU
Modified: llvm/trunk/lib/Target/CppBackend/LLVMBuild.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/LLVMBuild.txt?rev=146436&r1=146435&r2=146436&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CppBackend/LLVMBuild.txt (original)
+++ llvm/trunk/lib/Target/CppBackend/LLVMBuild.txt Mon Dec 12 16:45:54 2011
@@ -15,6 +15,9 @@
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = TargetInfo
+
[component_0]
type = TargetGroup
name = CppBackend
Modified: llvm/trunk/lib/Target/Hexagon/LLVMBuild.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/LLVMBuild.txt?rev=146436&r1=146435&r2=146436&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/LLVMBuild.txt (original)
+++ llvm/trunk/lib/Target/Hexagon/LLVMBuild.txt Mon Dec 12 16:45:54 2011
@@ -1,4 +1,4 @@
-;===- ./lib/Target/Hexagon/LLVMBuild.txt ----------------------*- Conf -*--===;
+;===- ./lib/Target/Hexagon/LLVMBuild.txt -----------------------*- Conf -*--===;
;
; The LLVM Compiler Infrastructure
;
@@ -15,6 +15,9 @@
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = TargetInfo
+
[component_0]
type = TargetGroup
name = Hexagon
@@ -27,4 +30,3 @@
parent = Hexagon
required_libraries = AsmPrinter CodeGen Core HexagonInfo SelectionDAG Support Target MC
add_to_library_groups = Hexagon
-
Modified: llvm/trunk/lib/Target/Hexagon/TargetInfo/LLVMBuild.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/TargetInfo/LLVMBuild.txt?rev=146436&r1=146435&r2=146436&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/TargetInfo/LLVMBuild.txt (original)
+++ llvm/trunk/lib/Target/Hexagon/TargetInfo/LLVMBuild.txt Mon Dec 12 16:45:54 2011
@@ -21,4 +21,3 @@
parent = Hexagon
required_libraries = MC Support
add_to_library_groups = Hexagon
-
Modified: llvm/trunk/lib/Target/LLVMBuild.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/LLVMBuild.txt?rev=146436&r1=146435&r2=146436&view=diff
==============================================================================
--- llvm/trunk/lib/Target/LLVMBuild.txt (original)
+++ llvm/trunk/lib/Target/LLVMBuild.txt Mon Dec 12 16:45:54 2011
@@ -15,6 +15,9 @@
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = ARM CBackend CellSPU CppBackend Hexagon MBlaze MSP430 Mips PTX PowerPC Sparc X86 XCore
+
; This is a special group whose required libraries are extended (by llvm-build)
; with the best execution engine (the native JIT, if available, or the
; interpreter).
Modified: llvm/trunk/lib/Target/MBlaze/LLVMBuild.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MBlaze/LLVMBuild.txt?rev=146436&r1=146435&r2=146436&view=diff
==============================================================================
--- llvm/trunk/lib/Target/MBlaze/LLVMBuild.txt (original)
+++ llvm/trunk/lib/Target/MBlaze/LLVMBuild.txt Mon Dec 12 16:45:54 2011
@@ -15,6 +15,9 @@
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = AsmParser Disassembler InstPrinter MCTargetDesc TargetInfo
+
[component_0]
type = TargetGroup
name = MBlaze
Modified: llvm/trunk/lib/Target/MSP430/LLVMBuild.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/LLVMBuild.txt?rev=146436&r1=146435&r2=146436&view=diff
==============================================================================
--- llvm/trunk/lib/Target/MSP430/LLVMBuild.txt (original)
+++ llvm/trunk/lib/Target/MSP430/LLVMBuild.txt Mon Dec 12 16:45:54 2011
@@ -15,6 +15,9 @@
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = InstPrinter MCTargetDesc TargetInfo
+
[component_0]
type = TargetGroup
name = MSP430
Modified: llvm/trunk/lib/Target/Mips/LLVMBuild.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/LLVMBuild.txt?rev=146436&r1=146435&r2=146436&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/LLVMBuild.txt (original)
+++ llvm/trunk/lib/Target/Mips/LLVMBuild.txt Mon Dec 12 16:45:54 2011
@@ -15,6 +15,9 @@
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = InstPrinter MCTargetDesc TargetInfo
+
[component_0]
type = TargetGroup
name = Mips
Modified: llvm/trunk/lib/Target/PTX/LLVMBuild.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PTX/LLVMBuild.txt?rev=146436&r1=146435&r2=146436&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PTX/LLVMBuild.txt (original)
+++ llvm/trunk/lib/Target/PTX/LLVMBuild.txt Mon Dec 12 16:45:54 2011
@@ -15,6 +15,9 @@
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = InstPrinter MCTargetDesc TargetInfo
+
[component_0]
type = TargetGroup
name = PTX
Modified: llvm/trunk/lib/Target/PowerPC/LLVMBuild.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/LLVMBuild.txt?rev=146436&r1=146435&r2=146436&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/LLVMBuild.txt (original)
+++ llvm/trunk/lib/Target/PowerPC/LLVMBuild.txt Mon Dec 12 16:45:54 2011
@@ -15,6 +15,9 @@
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = InstPrinter MCTargetDesc TargetInfo
+
[component_0]
type = TargetGroup
name = PowerPC
Modified: llvm/trunk/lib/Target/Sparc/LLVMBuild.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/LLVMBuild.txt?rev=146436&r1=146435&r2=146436&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/LLVMBuild.txt (original)
+++ llvm/trunk/lib/Target/Sparc/LLVMBuild.txt Mon Dec 12 16:45:54 2011
@@ -15,6 +15,9 @@
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = MCTargetDesc TargetInfo
+
[component_0]
type = TargetGroup
name = Sparc
Modified: llvm/trunk/lib/Target/X86/LLVMBuild.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/LLVMBuild.txt?rev=146436&r1=146435&r2=146436&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/LLVMBuild.txt (original)
+++ llvm/trunk/lib/Target/X86/LLVMBuild.txt Mon Dec 12 16:45:54 2011
@@ -15,6 +15,9 @@
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = AsmParser Disassembler InstPrinter MCTargetDesc TargetInfo Utils
+
[component_0]
type = TargetGroup
name = X86
Modified: llvm/trunk/lib/Target/XCore/LLVMBuild.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/LLVMBuild.txt?rev=146436&r1=146435&r2=146436&view=diff
==============================================================================
--- llvm/trunk/lib/Target/XCore/LLVMBuild.txt (original)
+++ llvm/trunk/lib/Target/XCore/LLVMBuild.txt Mon Dec 12 16:45:54 2011
@@ -15,6 +15,9 @@
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = MCTargetDesc TargetInfo
+
[component_0]
type = TargetGroup
name = XCore
Modified: llvm/trunk/lib/Transforms/LLVMBuild.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/LLVMBuild.txt?rev=146436&r1=146435&r2=146436&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/LLVMBuild.txt (original)
+++ llvm/trunk/lib/Transforms/LLVMBuild.txt Mon Dec 12 16:45:54 2011
@@ -15,6 +15,9 @@
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = IPO InstCombine Instrumentation Scalar Utils
+
[component_0]
type = Group
name = Transforms
Modified: llvm/trunk/tools/LLVMBuild.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/LLVMBuild.txt?rev=146436&r1=146435&r2=146436&view=diff
==============================================================================
--- llvm/trunk/tools/LLVMBuild.txt (original)
+++ llvm/trunk/tools/LLVMBuild.txt Mon Dec 12 16:45:54 2011
@@ -15,6 +15,9 @@
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = bugpoint llc lli llvm-ar llvm-as llvm-bcanalyzer llvm-cov llvm-diff llvm-dis llvm-dwarfdump llvm-extract llvm-ld llvm-link llvm-mc llvm-nm llvm-objdump llvm-prof llvm-ranlib llvm-rtdyld llvm-size llvm-stub macho-dump opt
+
[component_0]
type = Group
name = Tools
Modified: llvm/trunk/utils/LLVMBuild.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/LLVMBuild.txt?rev=146436&r1=146435&r2=146436&view=diff
==============================================================================
--- llvm/trunk/utils/LLVMBuild.txt (original)
+++ llvm/trunk/utils/LLVMBuild.txt Mon Dec 12 16:45:54 2011
@@ -15,6 +15,9 @@
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = TableGen unittest
+
[component_0]
type = Group
name = BuildTools
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=146436&r1=146435&r2=146436&view=diff
==============================================================================
--- llvm/trunk/utils/llvm-build/llvmbuild/main.py (original)
+++ llvm/trunk/utils/llvm-build/llvmbuild/main.py Mon Dec 12 16:45:54 2011
@@ -214,14 +214,45 @@
info_basedir[ci.subpath] = info_basedir.get(ci.subpath, []) + [ci]
+ # Compute the list of subdirectories to scan.
+ subpath_subdirs = {}
+ for ci in self.component_infos:
+ # Ignore root components.
+ if ci.subpath == '/':
+ continue
+
+ # Otherwise, append this subpath to the parent list.
+ parent_path = os.path.dirname(ci.subpath)
+ subpath_subdirs[parent_path] = parent_list = subpath_subdirs.get(
+ parent_path, set())
+ parent_list.add(os.path.basename(ci.subpath))
+
# Generate the build files.
for subpath, infos in info_basedir.items():
# Order the components by name to have a canonical ordering.
infos.sort(key = lambda ci: ci.name)
# Format the components into llvmbuild fragments.
- fragments = filter(None, [ci.get_llvmbuild_fragment()
- for ci in infos])
+ fragments = []
+
+ # Add the common fragments.
+ subdirectories = subpath_subdirs.get(subpath)
+ if subdirectories:
+ fragment = """\
+subdirectories = %s
+""" % (" ".join(sorted(subdirectories)),)
+ fragments.append(("common", fragment))
+
+ # Add the component fragments.
+ num_common_fragments = len(fragments)
+ for ci in infos:
+ fragment = ci.get_llvmbuild_fragment()
+ if fragment is None:
+ continue
+
+ name = "component_%d" % (len(fragments) - num_common_fragments)
+ fragments.append((name, fragment))
+
if not fragments:
continue
@@ -242,7 +273,7 @@
if ln.startswith(';'):
comment_block += ln
elif ln.startswith('[') and ln.endswith(']\n'):
- comments_map[ln[:-1]] = comment_block
+ comments_map[ln[1:-2]] = comment_block
else:
comment_block = ""
f.close()
@@ -275,15 +306,16 @@
;===------------------------------------------------------------------------===;
""" % header_string
- for i,fragment in enumerate(fragments):
- name = '[component_%d]' % i
+ # Write out each fragment.each component fragment.
+ for name,fragment in fragments:
comment = comments_map.get(name)
if comment is not None:
f.write(comment)
- print >>f, name
+ print >>f, "[%s]" % name
f.write(fragment)
- if fragment is not fragments[-1]:
+ if fragment is not fragments[-1][1]:
print >>f
+
f.close()
def write_library_table(self, output_path):
More information about the llvm-commits
mailing list