llvm.org GIT mirror llvm / b0c594f
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146436 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Dunbar 7 years ago
26 changed file(s) with 112 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
1414 ;
1515 ;===------------------------------------------------------------------------===;
1616
17 [common]
18 subdirectories = bindings docs examples lib projects runtime tools utils
19
1720 [component_0]
1821 type = Group
1922 name = Miscellaneous
1414 ;
1515 ;===------------------------------------------------------------------------===;
1616
17 [common]
18 subdirectories = IPA
19
1720 [component_0]
1821 type = Library
1922 name = Analysis
1414 ;
1515 ;===------------------------------------------------------------------------===;
1616
17 [common]
18 subdirectories = Reader Writer
19
1720 [component_0]
1821 type = Group
1922 name = Bitcode
1414 ;
1515 ;===------------------------------------------------------------------------===;
1616
17 [common]
18 subdirectories = AsmPrinter SelectionDAG
19
1720 [component_0]
1821 type = Library
1922 name = CodeGen
1414 ;
1515 ;===------------------------------------------------------------------------===;
1616
17 [common]
18 subdirectories = Interpreter JIT MCJIT RuntimeDyld
19
1720 [component_0]
1821 type = Library
1922 name = ExecutionEngine
1414 ;
1515 ;===------------------------------------------------------------------------===;
1616
17 [common]
18 subdirectories = Analysis Archive AsmParser Bitcode CodeGen DebugInfo ExecutionEngine Linker MC Object Support TableGen Target Transforms VMCore
19
1720 [component_0]
1821 type = Group
1922 name = Libraries
1414 ;
1515 ;===------------------------------------------------------------------------===;
1616
17 [common]
18 subdirectories = MCDisassembler MCParser
19
1720 [component_0]
1821 type = Library
1922 name = MC
1414 ;
1515 ;===------------------------------------------------------------------------===;
1616
17 [common]
18 subdirectories = AsmParser Disassembler InstPrinter MCTargetDesc TargetInfo
19
1720 [component_0]
1821 type = TargetGroup
1922 name = ARM
1414 ;
1515 ;===------------------------------------------------------------------------===;
1616
17 [common]
18 subdirectories = TargetInfo
19
1720 [component_0]
1821 type = TargetGroup
1922 name = CBackend
1414 ;
1515 ;===------------------------------------------------------------------------===;
1616
17 [common]
18 subdirectories = MCTargetDesc TargetInfo
19
1720 [component_0]
1821 type = TargetGroup
1922 name = CellSPU
1414 ;
1515 ;===------------------------------------------------------------------------===;
1616
17 [common]
18 subdirectories = TargetInfo
19
1720 [component_0]
1821 type = TargetGroup
1922 name = CppBackend
None ;===- ./lib/Target/Hexagon/LLVMBuild.txt ----------------------*- Conf -*--===;
0 ;===- ./lib/Target/Hexagon/LLVMBuild.txt -----------------------*- Conf -*--===;
11 ;
22 ; The LLVM Compiler Infrastructure
33 ;
1414 ;
1515 ;===------------------------------------------------------------------------===;
1616
17 [common]
18 subdirectories = TargetInfo
19
1720 [component_0]
1821 type = TargetGroup
1922 name = Hexagon
2629 parent = Hexagon
2730 required_libraries = AsmPrinter CodeGen Core HexagonInfo SelectionDAG Support Target MC
2831 add_to_library_groups = Hexagon
29
2020 parent = Hexagon
2121 required_libraries = MC Support
2222 add_to_library_groups = Hexagon
23
1313 ; http://llvm.org/docs/LLVMBuild.html
1414 ;
1515 ;===------------------------------------------------------------------------===;
16
17 [common]
18 subdirectories = ARM CBackend CellSPU CppBackend Hexagon MBlaze MSP430 Mips PTX PowerPC Sparc X86 XCore
1619
1720 ; This is a special group whose required libraries are extended (by llvm-build)
1821 ; with the best execution engine (the native JIT, if available, or the
1414 ;
1515 ;===------------------------------------------------------------------------===;
1616
17 [common]
18 subdirectories = AsmParser Disassembler InstPrinter MCTargetDesc TargetInfo
19
1720 [component_0]
1821 type = TargetGroup
1922 name = MBlaze
1414 ;
1515 ;===------------------------------------------------------------------------===;
1616
17 [common]
18 subdirectories = InstPrinter MCTargetDesc TargetInfo
19
1720 [component_0]
1821 type = TargetGroup
1922 name = MSP430
1414 ;
1515 ;===------------------------------------------------------------------------===;
1616
17 [common]
18 subdirectories = InstPrinter MCTargetDesc TargetInfo
19
1720 [component_0]
1821 type = TargetGroup
1922 name = Mips
1414 ;
1515 ;===------------------------------------------------------------------------===;
1616
17 [common]
18 subdirectories = InstPrinter MCTargetDesc TargetInfo
19
1720 [component_0]
1821 type = TargetGroup
1922 name = PTX
1414 ;
1515 ;===------------------------------------------------------------------------===;
1616
17 [common]
18 subdirectories = InstPrinter MCTargetDesc TargetInfo
19
1720 [component_0]
1821 type = TargetGroup
1922 name = PowerPC
1414 ;
1515 ;===------------------------------------------------------------------------===;
1616
17 [common]
18 subdirectories = MCTargetDesc TargetInfo
19
1720 [component_0]
1821 type = TargetGroup
1922 name = Sparc
1414 ;
1515 ;===------------------------------------------------------------------------===;
1616
17 [common]
18 subdirectories = AsmParser Disassembler InstPrinter MCTargetDesc TargetInfo Utils
19
1720 [component_0]
1821 type = TargetGroup
1922 name = X86
1414 ;
1515 ;===------------------------------------------------------------------------===;
1616
17 [common]
18 subdirectories = MCTargetDesc TargetInfo
19
1720 [component_0]
1821 type = TargetGroup
1922 name = XCore
1414 ;
1515 ;===------------------------------------------------------------------------===;
1616
17 [common]
18 subdirectories = IPO InstCombine Instrumentation Scalar Utils
19
1720 [component_0]
1821 type = Group
1922 name = Transforms
1414 ;
1515 ;===------------------------------------------------------------------------===;
1616
17 [common]
18 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
19
1720 [component_0]
1821 type = Group
1922 name = Tools
1414 ;
1515 ;===------------------------------------------------------------------------===;
1616
17 [common]
18 subdirectories = TableGen unittest
19
1720 [component_0]
1821 type = Group
1922 name = BuildTools
213213
214214 info_basedir[ci.subpath] = info_basedir.get(ci.subpath, []) + [ci]
215215
216 # Compute the list of subdirectories to scan.
217 subpath_subdirs = {}
218 for ci in self.component_infos:
219 # Ignore root components.
220 if ci.subpath == '/':
221 continue
222
223 # Otherwise, append this subpath to the parent list.
224 parent_path = os.path.dirname(ci.subpath)
225 subpath_subdirs[parent_path] = parent_list = subpath_subdirs.get(
226 parent_path, set())
227 parent_list.add(os.path.basename(ci.subpath))
228
216229 # Generate the build files.
217230 for subpath, infos in info_basedir.items():
218231 # Order the components by name to have a canonical ordering.
219232 infos.sort(key = lambda ci: ci.name)
220233
221234 # Format the components into llvmbuild fragments.
222 fragments = filter(None, [ci.get_llvmbuild_fragment()
223 for ci in infos])
235 fragments = []
236
237 # Add the common fragments.
238 subdirectories = subpath_subdirs.get(subpath)
239 if subdirectories:
240 fragment = """\
241 subdirectories = %s
242 """ % (" ".join(sorted(subdirectories)),)
243 fragments.append(("common", fragment))
244
245 # Add the component fragments.
246 num_common_fragments = len(fragments)
247 for ci in infos:
248 fragment = ci.get_llvmbuild_fragment()
249 if fragment is None:
250 continue
251
252 name = "component_%d" % (len(fragments) - num_common_fragments)
253 fragments.append((name, fragment))
254
224255 if not fragments:
225256 continue
226257
241272 if ln.startswith(';'):
242273 comment_block += ln
243274 elif ln.startswith('[') and ln.endswith(']\n'):
244 comments_map[ln[:-1]] = comment_block
275 comments_map[ln[1:-2]] = comment_block
245276 else:
246277 comment_block = ""
247278 f.close()
274305 ;===------------------------------------------------------------------------===;
275306 """ % header_string
276307
277 for i,fragment in enumerate(fragments):
278 name = '[component_%d]' % i
308 # Write out each fragment.each component fragment.
309 for name,fragment in fragments:
279310 comment = comments_map.get(name)
280311 if comment is not None:
281312 f.write(comment)
282 print >>f, name
313 print >>f, "[%s]" % name
283314 f.write(fragment)
284 if fragment is not fragments[-1]:
315 if fragment is not fragments[-1][1]:
285316 print >>f
317
286318 f.close()
287319
288320 def write_library_table(self, output_path):