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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146436
91177308-0d34-0410-b5e6-
96231b3b80d8
26 files changed:
;
;===------------------------------------------------------------------------===;
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = bindings docs examples lib projects runtime tools utils
+
[component_0]
type = Group
name = Miscellaneous
[component_0]
type = Group
name = Miscellaneous
;
;===------------------------------------------------------------------------===;
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = IPA
+
[component_0]
type = Library
name = Analysis
[component_0]
type = Library
name = Analysis
;
;===------------------------------------------------------------------------===;
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = Reader Writer
+
[component_0]
type = Group
name = Bitcode
[component_0]
type = Group
name = Bitcode
;
;===------------------------------------------------------------------------===;
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = AsmPrinter SelectionDAG
+
[component_0]
type = Library
name = CodeGen
[component_0]
type = Library
name = CodeGen
;
;===------------------------------------------------------------------------===;
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = Interpreter JIT MCJIT RuntimeDyld
+
[component_0]
type = Library
name = ExecutionEngine
[component_0]
type = Library
name = ExecutionEngine
;
;===------------------------------------------------------------------------===;
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = Analysis Archive AsmParser Bitcode CodeGen DebugInfo ExecutionEngine Linker MC Object Support TableGen Target Transforms VMCore
+
[component_0]
type = Group
name = Libraries
[component_0]
type = Group
name = Libraries
;
;===------------------------------------------------------------------------===;
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = MCDisassembler MCParser
+
[component_0]
type = Library
name = MC
[component_0]
type = Library
name = MC
;
;===------------------------------------------------------------------------===;
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = AsmParser Disassembler InstPrinter MCTargetDesc TargetInfo
+
[component_0]
type = TargetGroup
name = ARM
[component_0]
type = TargetGroup
name = ARM
;
;===------------------------------------------------------------------------===;
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = TargetInfo
+
[component_0]
type = TargetGroup
name = CBackend
[component_0]
type = TargetGroup
name = CBackend
;
;===------------------------------------------------------------------------===;
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = MCTargetDesc TargetInfo
+
[component_0]
type = TargetGroup
name = CellSPU
[component_0]
type = TargetGroup
name = CellSPU
;
;===------------------------------------------------------------------------===;
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = TargetInfo
+
[component_0]
type = TargetGroup
name = CppBackend
[component_0]
type = TargetGroup
name = CppBackend
-;===- ./lib/Target/Hexagon/LLVMBuild.txt ----------------------*- Conf -*--===;
+;===- ./lib/Target/Hexagon/LLVMBuild.txt -----------------------*- Conf -*--===;
;
; The LLVM Compiler Infrastructure
;
;
; The LLVM Compiler Infrastructure
;
;
;===------------------------------------------------------------------------===;
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = TargetInfo
+
[component_0]
type = TargetGroup
name = Hexagon
[component_0]
type = TargetGroup
name = Hexagon
parent = Hexagon
required_libraries = AsmPrinter CodeGen Core HexagonInfo SelectionDAG Support Target MC
add_to_library_groups = Hexagon
parent = Hexagon
required_libraries = AsmPrinter CodeGen Core HexagonInfo SelectionDAG Support Target MC
add_to_library_groups = Hexagon
parent = Hexagon
required_libraries = MC Support
add_to_library_groups = Hexagon
parent = Hexagon
required_libraries = MC Support
add_to_library_groups = Hexagon
;
;===------------------------------------------------------------------------===;
;
;===------------------------------------------------------------------------===;
+[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).
; 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).
;
;===------------------------------------------------------------------------===;
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = AsmParser Disassembler InstPrinter MCTargetDesc TargetInfo
+
[component_0]
type = TargetGroup
name = MBlaze
[component_0]
type = TargetGroup
name = MBlaze
;
;===------------------------------------------------------------------------===;
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = InstPrinter MCTargetDesc TargetInfo
+
[component_0]
type = TargetGroup
name = MSP430
[component_0]
type = TargetGroup
name = MSP430
;
;===------------------------------------------------------------------------===;
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = InstPrinter MCTargetDesc TargetInfo
+
[component_0]
type = TargetGroup
name = Mips
[component_0]
type = TargetGroup
name = Mips
;
;===------------------------------------------------------------------------===;
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = InstPrinter MCTargetDesc TargetInfo
+
[component_0]
type = TargetGroup
name = PTX
[component_0]
type = TargetGroup
name = PTX
;
;===------------------------------------------------------------------------===;
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = InstPrinter MCTargetDesc TargetInfo
+
[component_0]
type = TargetGroup
name = PowerPC
[component_0]
type = TargetGroup
name = PowerPC
;
;===------------------------------------------------------------------------===;
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = MCTargetDesc TargetInfo
+
[component_0]
type = TargetGroup
name = Sparc
[component_0]
type = TargetGroup
name = Sparc
;
;===------------------------------------------------------------------------===;
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = AsmParser Disassembler InstPrinter MCTargetDesc TargetInfo Utils
+
[component_0]
type = TargetGroup
name = X86
[component_0]
type = TargetGroup
name = X86
;
;===------------------------------------------------------------------------===;
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = MCTargetDesc TargetInfo
+
[component_0]
type = TargetGroup
name = XCore
[component_0]
type = TargetGroup
name = XCore
;
;===------------------------------------------------------------------------===;
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = IPO InstCombine Instrumentation Scalar Utils
+
[component_0]
type = Group
name = Transforms
[component_0]
type = Group
name = Transforms
;
;===------------------------------------------------------------------------===;
;
;===------------------------------------------------------------------------===;
+[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
[component_0]
type = Group
name = Tools
;
;===------------------------------------------------------------------------===;
;
;===------------------------------------------------------------------------===;
+[common]
+subdirectories = TableGen unittest
+
[component_0]
type = Group
name = BuildTools
[component_0]
type = Group
name = BuildTools
info_basedir[ci.subpath] = info_basedir.get(ci.subpath, []) + [ci]
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.
# 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
if not fragments:
continue
if ln.startswith(';'):
comment_block += ln
elif ln.startswith('[') and ln.endswith(']\n'):
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()
else:
comment_block = ""
f.close()
;===------------------------------------------------------------------------===;
""" % header_string
;===------------------------------------------------------------------------===;
""" % 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)
comment = comments_map.get(name)
if comment is not None:
f.write(comment)
+ print >>f, "[%s]" % name
- if fragment is not fragments[-1]:
+ if fragment is not fragments[-1][1]:
f.close()
def write_library_table(self, output_path):
f.close()
def write_library_table(self, output_path):