2 from __future__
import print_function
10 # FIXME: This should get outputs from gn.
11 OUTPUT
= """struct AvailableComponent {
12 /// The name of the component.
15 /// The name of the library for this component (or NULL).
18 /// Whether the component is installed.
21 /// The list of libraries required when linking this component.
22 const char *RequiredLibraries[84];
23 } AvailableComponents[84] = {
24 { "aggressiveinstcombine", "LLVMAggressiveInstCombine", true, {"analysis", "core", "support", "transformutils"} },
25 { "all", nullptr, true, {"demangle", "support", "tablegen", "core", "fuzzmutate", "filecheck", "interfacestub", "irreader", "codegen", "selectiondag", "asmprinter", "mirparser", "globalisel", "binaryformat", "bitreader", "bitwriter", "bitstreamreader", "dwarflinker", "extensions", "frontendopenmp", "transformutils", "instrumentation", "aggressiveinstcombine", "instcombine", "scalaropts", "ipo", "vectorize", "objcarcopts", "coroutines", "cfguard", "linker", "analysis", "lto", "mc", "mcparser", "mcdisassembler", "mca", "object", "objectyaml", "option", "remarks", "debuginfodwarf", "debuginfogsym", "debuginfomsf", "debuginfocodeview", "debuginfopdb", "symbolize", "executionengine", "interpreter", "jitlink", "mcjit", "orcjit", "orcshared", "orctargetprocess", "runtimedyld", "target", "asmparser", "lineeditor", "profiledata", "coverage", "passes", "textapi", "dlltooldriver", "libdriver", "xray", "windowsmanifest"} },
26 { "all-targets", nullptr, true, {} },
27 { "analysis", "LLVMAnalysis", true, {"binaryformat", "core", "object", "profiledata", "support"} },
28 { "asmparser", "LLVMAsmParser", true, {"binaryformat", "core", "support"} },
29 { "asmprinter", "LLVMAsmPrinter", true, {"analysis", "binaryformat", "codegen", "core", "debuginfocodeview", "debuginfodwarf", "debuginfomsf", "mc", "mcparser", "remarks", "support", "target"} },
30 { "binaryformat", "LLVMBinaryFormat", true, {"support"} },
31 { "bitreader", "LLVMBitReader", true, {"bitstreamreader", "core", "support"} },
32 { "bitstreamreader", "LLVMBitstreamReader", true, {"support"} },
33 { "bitwriter", "LLVMBitWriter", true, {"analysis", "core", "mc", "object", "support"} },
34 { "cfguard", "LLVMCFGuard", true, {"core", "support"} },
35 { "codegen", "LLVMCodeGen", true, {"analysis", "bitreader", "bitwriter", "core", "mc", "profiledata", "scalaropts", "support", "target", "transformutils"} },
36 { "core", "LLVMCore", true, {"binaryformat", "remarks", "support"} },
37 { "coroutines", "LLVMCoroutines", true, {"analysis", "core", "ipo", "scalaropts", "support", "transformutils"} },
38 { "coverage", "LLVMCoverage", true, {"core", "object", "profiledata", "support"} },
39 { "debuginfocodeview", "LLVMDebugInfoCodeView", true, {"support", "debuginfomsf"} },
40 { "debuginfodwarf", "LLVMDebugInfoDWARF", true, {"binaryformat", "object", "mc", "support"} },
41 { "debuginfogsym", "LLVMDebugInfoGSYM", true, {"mc", "object", "support", "debuginfodwarf"} },
42 { "debuginfomsf", "LLVMDebugInfoMSF", true, {"support"} },
43 { "debuginfopdb", "LLVMDebugInfoPDB", true, {"binaryformat", "object", "support", "debuginfocodeview", "debuginfomsf"} },
44 { "demangle", "LLVMDemangle", true, {} },
45 { "dlltooldriver", "LLVMDlltoolDriver", true, {"object", "option", "support"} },
46 { "dwarflinker", "LLVMDWARFLinker", true, {"debuginfodwarf", "asmprinter", "codegen", "mc", "object", "support"} },
47 { "engine", nullptr, true, {"interpreter"} },
48 { "executionengine", "LLVMExecutionEngine", true, {"core", "mc", "object", "runtimedyld", "support", "target"} },
49 { "extensions", "LLVMExtensions", true, {"support"} },
50 { "filecheck", "LLVMFileCheck", true, {} },
51 { "frontendopenmp", "LLVMFrontendOpenMP", true, {"core", "support", "transformutils"} },
52 { "fuzzmutate", "LLVMFuzzMutate", true, {"analysis", "bitreader", "bitwriter", "core", "scalaropts", "support", "target"} },
53 { "globalisel", "LLVMGlobalISel", true, {"analysis", "codegen", "core", "mc", "selectiondag", "support", "target", "transformutils"} },
54 { "instcombine", "LLVMInstCombine", true, {"analysis", "core", "support", "transformutils"} },
55 { "instrumentation", "LLVMInstrumentation", true, {"analysis", "core", "mc", "support", "transformutils", "profiledata"} },
56 { "interfacestub", "LLVMInterfaceStub", true, {"object", "support"} },
57 { "interpreter", "LLVMInterpreter", true, {"codegen", "core", "executionengine", "support"} },
58 { "ipo", "LLVMipo", true, {"aggressiveinstcombine", "analysis", "bitreader", "bitwriter", "core", "frontendopenmp", "instcombine", "irreader", "linker", "object", "profiledata", "scalaropts", "support", "transformutils", "vectorize", "instrumentation"} },
59 { "irreader", "LLVMIRReader", true, {"asmparser", "bitreader", "core", "support"} },
60 { "jitlink", "LLVMJITLink", true, {"binaryformat", "object", "orctargetprocess", "support"} },
61 { "libdriver", "LLVMLibDriver", true, {"binaryformat", "bitreader", "object", "option", "support", "binaryformat", "bitreader", "object", "option", "support"} },
62 { "lineeditor", "LLVMLineEditor", true, {"support"} },
63 { "linker", "LLVMLinker", true, {"core", "support", "transformutils"} },
64 { "lto", "LLVMLTO", true, {"aggressiveinstcombine", "analysis", "binaryformat", "bitreader", "bitwriter", "codegen", "core", "extensions", "ipo", "instcombine", "linker", "mc", "objcarcopts", "object", "passes", "remarks", "scalaropts", "support", "target", "transformutils"} },
65 { "mc", "LLVMMC", true, {"support", "binaryformat", "debuginfocodeview"} },
66 { "mca", "LLVMMCA", true, {"mc", "support"} },
67 { "mcdisassembler", "LLVMMCDisassembler", true, {"mc", "support"} },
68 { "mcjit", "LLVMMCJIT", true, {"core", "executionengine", "object", "runtimedyld", "support", "target"} },
69 { "mcparser", "LLVMMCParser", true, {"mc", "support"} },
70 { "mirparser", "LLVMMIRParser", true, {"asmparser", "binaryformat", "codegen", "core", "mc", "support", "target"} },
71 { "native", nullptr, true, {} },
72 { "nativecodegen", nullptr, true, {} },
73 { "objcarcopts", "LLVMObjCARCOpts", true, {"analysis", "core", "support", "transformutils"} },
74 { "object", "LLVMObject", true, {"bitreader", "core", "mc", "binaryformat", "mcparser", "support", "textapi"} },
75 { "objectyaml", "LLVMObjectYAML", true, {"binaryformat", "object", "support", "debuginfocodeview", "mc"} },
76 { "option", "LLVMOption", true, {"support"} },
77 { "orcjit", "LLVMOrcJIT", true, {"core", "executionengine", "jitlink", "object", "orcshared", "orctargetprocess", "mc", "passes", "runtimedyld", "support", "target", "transformutils"} },
78 { "orcshared", "LLVMOrcShared", true, {"support"} },
79 { "orctargetprocess", "LLVMOrcTargetProcess", true, {"orcshared", "support"} },
80 { "passes", "LLVMPasses", true, {"aggressiveinstcombine", "analysis", "core", "coroutines", "ipo", "instcombine", "objcarcopts", "scalaropts", "support", "target", "transformutils", "vectorize", "instrumentation"} },
81 { "profiledata", "LLVMProfileData", true, {"core", "support", "demangle"} },
82 { "remarks", "LLVMRemarks", true, {"bitstreamreader", "support"} },
83 { "runtimedyld", "LLVMRuntimeDyld", true, {"core", "mc", "object", "support"} },
84 { "scalaropts", "LLVMScalarOpts", true, {"aggressiveinstcombine", "analysis", "core", "instcombine", "support", "transformutils"} },
85 { "selectiondag", "LLVMSelectionDAG", true, {"analysis", "codegen", "core", "mc", "support", "target", "transformutils"} },
86 { "support", "LLVMSupport", true, {"demangle"} },
87 { "symbolize", "LLVMSymbolize", true, {"debuginfodwarf", "debuginfopdb", "object", "support", "demangle"} },
88 { "tablegen", "LLVMTableGen", true, {"support"} },
89 { "target", "LLVMTarget", true, {"analysis", "core", "mc", "support"} },
90 { "textapi", "LLVMTextAPI", true, {"support", "binaryformat"} },
91 { "transformutils", "LLVMTransformUtils", true, {"analysis", "core", "support"} },
92 { "vectorize", "LLVMVectorize", true, {"analysis", "core", "support", "transformutils"} },
93 { "windowsmanifest", "LLVMWindowsManifest", true, {"support"} },
94 { "xray", "LLVMXRay", true, {"support", "object"} },
100 parser
= argparse
.ArgumentParser()
101 parser
.add_argument('-o', '--output', required
=True, help='output file')
102 args
= parser
.parse_args()
104 with
open(args
.output
, 'w') as f
:
108 if __name__
== '__main__':