[llvm] 9218ff5 - llvmbuildectomy - replace llvm-build by plain cmake

via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 13 01:35:44 PST 2020


Author: serge-sans-paille
Date: 2020-11-13T10:35:24+01:00
New Revision: 9218ff50f93085d0a16a974db28ca8f14bc66f64

URL: https://github.com/llvm/llvm-project/commit/9218ff50f93085d0a16a974db28ca8f14bc66f64
DIFF: https://github.com/llvm/llvm-project/commit/9218ff50f93085d0a16a974db28ca8f14bc66f64.diff

LOG: llvmbuildectomy - replace llvm-build by plain cmake

No longer rely on an external tool to build the llvm component layout.

Instead, leverage the existing `add_llvm_componentlibrary` cmake function and
introduce `add_llvm_component_group` to accurately describe component behavior.

These function store extra properties in the created targets. These properties
are processed once all components are defined to resolve library dependencies
and produce the header expected by llvm-config.

Differential Revision: https://reviews.llvm.org/D90848

Added: 
    llvm/cmake/modules/LLVM-Build.cmake

Modified: 
    llvm/CMakeLists.txt
    llvm/cmake/modules/AddLLVM.cmake
    llvm/cmake/modules/LLVM-Config.cmake
    llvm/docs/CodingStandards.rst
    llvm/docs/CommandGuide/index.rst
    llvm/docs/GettingInvolved.rst
    llvm/docs/WritingAnLLVMNewPMPass.rst
    llvm/lib/Analysis/CMakeLists.txt
    llvm/lib/AsmParser/CMakeLists.txt
    llvm/lib/BinaryFormat/CMakeLists.txt
    llvm/lib/Bitcode/Reader/CMakeLists.txt
    llvm/lib/Bitcode/Writer/CMakeLists.txt
    llvm/lib/Bitstream/Reader/CMakeLists.txt
    llvm/lib/CMakeLists.txt
    llvm/lib/CodeGen/AsmPrinter/CMakeLists.txt
    llvm/lib/CodeGen/CMakeLists.txt
    llvm/lib/CodeGen/GlobalISel/CMakeLists.txt
    llvm/lib/CodeGen/MIRParser/CMakeLists.txt
    llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt
    llvm/lib/DWARFLinker/CMakeLists.txt
    llvm/lib/DebugInfo/CodeView/CMakeLists.txt
    llvm/lib/DebugInfo/DWARF/CMakeLists.txt
    llvm/lib/DebugInfo/GSYM/CMakeLists.txt
    llvm/lib/DebugInfo/MSF/CMakeLists.txt
    llvm/lib/DebugInfo/PDB/CMakeLists.txt
    llvm/lib/DebugInfo/Symbolize/CMakeLists.txt
    llvm/lib/Demangle/CMakeLists.txt
    llvm/lib/ExecutionEngine/CMakeLists.txt
    llvm/lib/ExecutionEngine/IntelJITEvents/CMakeLists.txt
    llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt
    llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt
    llvm/lib/ExecutionEngine/MCJIT/CMakeLists.txt
    llvm/lib/ExecutionEngine/OProfileJIT/CMakeLists.txt
    llvm/lib/ExecutionEngine/Orc/CMakeLists.txt
    llvm/lib/ExecutionEngine/Orc/Shared/CMakeLists.txt
    llvm/lib/ExecutionEngine/Orc/TargetProcess/CMakeLists.txt
    llvm/lib/ExecutionEngine/PerfJITEvents/CMakeLists.txt
    llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt
    llvm/lib/Extensions/CMakeLists.txt
    llvm/lib/Frontend/OpenMP/CMakeLists.txt
    llvm/lib/FuzzMutate/CMakeLists.txt
    llvm/lib/IR/CMakeLists.txt
    llvm/lib/IRReader/CMakeLists.txt
    llvm/lib/InterfaceStub/CMakeLists.txt
    llvm/lib/LTO/CMakeLists.txt
    llvm/lib/LineEditor/CMakeLists.txt
    llvm/lib/Linker/CMakeLists.txt
    llvm/lib/MC/CMakeLists.txt
    llvm/lib/MC/MCDisassembler/CMakeLists.txt
    llvm/lib/MC/MCParser/CMakeLists.txt
    llvm/lib/MCA/CMakeLists.txt
    llvm/lib/Object/CMakeLists.txt
    llvm/lib/ObjectYAML/CMakeLists.txt
    llvm/lib/Option/CMakeLists.txt
    llvm/lib/Passes/CMakeLists.txt
    llvm/lib/ProfileData/CMakeLists.txt
    llvm/lib/ProfileData/Coverage/CMakeLists.txt
    llvm/lib/Remarks/CMakeLists.txt
    llvm/lib/Support/CMakeLists.txt
    llvm/lib/TableGen/CMakeLists.txt
    llvm/lib/Target/AArch64/AsmParser/CMakeLists.txt
    llvm/lib/Target/AArch64/CMakeLists.txt
    llvm/lib/Target/AArch64/Disassembler/CMakeLists.txt
    llvm/lib/Target/AArch64/MCTargetDesc/CMakeLists.txt
    llvm/lib/Target/AArch64/TargetInfo/CMakeLists.txt
    llvm/lib/Target/AArch64/Utils/CMakeLists.txt
    llvm/lib/Target/AMDGPU/AsmParser/CMakeLists.txt
    llvm/lib/Target/AMDGPU/CMakeLists.txt
    llvm/lib/Target/AMDGPU/Disassembler/CMakeLists.txt
    llvm/lib/Target/AMDGPU/MCTargetDesc/CMakeLists.txt
    llvm/lib/Target/AMDGPU/TargetInfo/CMakeLists.txt
    llvm/lib/Target/AMDGPU/Utils/CMakeLists.txt
    llvm/lib/Target/ARC/CMakeLists.txt
    llvm/lib/Target/ARC/Disassembler/CMakeLists.txt
    llvm/lib/Target/ARC/MCTargetDesc/CMakeLists.txt
    llvm/lib/Target/ARC/TargetInfo/CMakeLists.txt
    llvm/lib/Target/ARM/AsmParser/CMakeLists.txt
    llvm/lib/Target/ARM/CMakeLists.txt
    llvm/lib/Target/ARM/Disassembler/CMakeLists.txt
    llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt
    llvm/lib/Target/ARM/TargetInfo/CMakeLists.txt
    llvm/lib/Target/ARM/Utils/CMakeLists.txt
    llvm/lib/Target/AVR/AsmParser/CMakeLists.txt
    llvm/lib/Target/AVR/CMakeLists.txt
    llvm/lib/Target/AVR/Disassembler/CMakeLists.txt
    llvm/lib/Target/AVR/MCTargetDesc/CMakeLists.txt
    llvm/lib/Target/AVR/TargetInfo/CMakeLists.txt
    llvm/lib/Target/BPF/AsmParser/CMakeLists.txt
    llvm/lib/Target/BPF/CMakeLists.txt
    llvm/lib/Target/BPF/Disassembler/CMakeLists.txt
    llvm/lib/Target/BPF/MCTargetDesc/CMakeLists.txt
    llvm/lib/Target/BPF/TargetInfo/CMakeLists.txt
    llvm/lib/Target/CMakeLists.txt
    llvm/lib/Target/CSKY/CMakeLists.txt
    llvm/lib/Target/CSKY/TargetInfo/CMakeLists.txt
    llvm/lib/Target/Hexagon/AsmParser/CMakeLists.txt
    llvm/lib/Target/Hexagon/CMakeLists.txt
    llvm/lib/Target/Hexagon/Disassembler/CMakeLists.txt
    llvm/lib/Target/Hexagon/MCTargetDesc/CMakeLists.txt
    llvm/lib/Target/Hexagon/TargetInfo/CMakeLists.txt
    llvm/lib/Target/Lanai/AsmParser/CMakeLists.txt
    llvm/lib/Target/Lanai/CMakeLists.txt
    llvm/lib/Target/Lanai/Disassembler/CMakeLists.txt
    llvm/lib/Target/Lanai/MCTargetDesc/CMakeLists.txt
    llvm/lib/Target/Lanai/TargetInfo/CMakeLists.txt
    llvm/lib/Target/MSP430/AsmParser/CMakeLists.txt
    llvm/lib/Target/MSP430/CMakeLists.txt
    llvm/lib/Target/MSP430/Disassembler/CMakeLists.txt
    llvm/lib/Target/MSP430/MCTargetDesc/CMakeLists.txt
    llvm/lib/Target/MSP430/TargetInfo/CMakeLists.txt
    llvm/lib/Target/Mips/AsmParser/CMakeLists.txt
    llvm/lib/Target/Mips/CMakeLists.txt
    llvm/lib/Target/Mips/Disassembler/CMakeLists.txt
    llvm/lib/Target/Mips/MCTargetDesc/CMakeLists.txt
    llvm/lib/Target/Mips/TargetInfo/CMakeLists.txt
    llvm/lib/Target/NVPTX/CMakeLists.txt
    llvm/lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt
    llvm/lib/Target/NVPTX/TargetInfo/CMakeLists.txt
    llvm/lib/Target/PowerPC/AsmParser/CMakeLists.txt
    llvm/lib/Target/PowerPC/CMakeLists.txt
    llvm/lib/Target/PowerPC/Disassembler/CMakeLists.txt
    llvm/lib/Target/PowerPC/MCTargetDesc/CMakeLists.txt
    llvm/lib/Target/PowerPC/TargetInfo/CMakeLists.txt
    llvm/lib/Target/RISCV/AsmParser/CMakeLists.txt
    llvm/lib/Target/RISCV/CMakeLists.txt
    llvm/lib/Target/RISCV/Disassembler/CMakeLists.txt
    llvm/lib/Target/RISCV/MCTargetDesc/CMakeLists.txt
    llvm/lib/Target/RISCV/TargetInfo/CMakeLists.txt
    llvm/lib/Target/RISCV/Utils/CMakeLists.txt
    llvm/lib/Target/Sparc/AsmParser/CMakeLists.txt
    llvm/lib/Target/Sparc/CMakeLists.txt
    llvm/lib/Target/Sparc/Disassembler/CMakeLists.txt
    llvm/lib/Target/Sparc/MCTargetDesc/CMakeLists.txt
    llvm/lib/Target/Sparc/TargetInfo/CMakeLists.txt
    llvm/lib/Target/SystemZ/AsmParser/CMakeLists.txt
    llvm/lib/Target/SystemZ/CMakeLists.txt
    llvm/lib/Target/SystemZ/Disassembler/CMakeLists.txt
    llvm/lib/Target/SystemZ/MCTargetDesc/CMakeLists.txt
    llvm/lib/Target/SystemZ/TargetInfo/CMakeLists.txt
    llvm/lib/Target/VE/AsmParser/CMakeLists.txt
    llvm/lib/Target/VE/CMakeLists.txt
    llvm/lib/Target/VE/Disassembler/CMakeLists.txt
    llvm/lib/Target/VE/MCTargetDesc/CMakeLists.txt
    llvm/lib/Target/VE/TargetInfo/CMakeLists.txt
    llvm/lib/Target/WebAssembly/AsmParser/CMakeLists.txt
    llvm/lib/Target/WebAssembly/CMakeLists.txt
    llvm/lib/Target/WebAssembly/Disassembler/CMakeLists.txt
    llvm/lib/Target/WebAssembly/MCTargetDesc/CMakeLists.txt
    llvm/lib/Target/WebAssembly/TargetInfo/CMakeLists.txt
    llvm/lib/Target/X86/AsmParser/CMakeLists.txt
    llvm/lib/Target/X86/CMakeLists.txt
    llvm/lib/Target/X86/Disassembler/CMakeLists.txt
    llvm/lib/Target/X86/MCTargetDesc/CMakeLists.txt
    llvm/lib/Target/X86/TargetInfo/CMakeLists.txt
    llvm/lib/Target/XCore/CMakeLists.txt
    llvm/lib/Target/XCore/Disassembler/CMakeLists.txt
    llvm/lib/Target/XCore/MCTargetDesc/CMakeLists.txt
    llvm/lib/Target/XCore/TargetInfo/CMakeLists.txt
    llvm/lib/Testing/Support/CMakeLists.txt
    llvm/lib/TextAPI/CMakeLists.txt
    llvm/lib/ToolDrivers/llvm-dlltool/CMakeLists.txt
    llvm/lib/ToolDrivers/llvm-lib/CMakeLists.txt
    llvm/lib/Transforms/AggressiveInstCombine/CMakeLists.txt
    llvm/lib/Transforms/CFGuard/CMakeLists.txt
    llvm/lib/Transforms/Coroutines/CMakeLists.txt
    llvm/lib/Transforms/HelloNew/CMakeLists.txt
    llvm/lib/Transforms/IPO/CMakeLists.txt
    llvm/lib/Transforms/InstCombine/CMakeLists.txt
    llvm/lib/Transforms/Instrumentation/CMakeLists.txt
    llvm/lib/Transforms/ObjCARC/CMakeLists.txt
    llvm/lib/Transforms/Scalar/CMakeLists.txt
    llvm/lib/Transforms/Utils/CMakeLists.txt
    llvm/lib/Transforms/Vectorize/CMakeLists.txt
    llvm/lib/WindowsManifest/CMakeLists.txt
    llvm/lib/XRay/CMakeLists.txt

Removed: 
    llvm/LLVMBuild.txt
    llvm/bindings/LLVMBuild.txt
    llvm/docs/CommandGuide/llvm-build.rst
    llvm/docs/LLVMBuild.rst
    llvm/docs/LLVMBuild.txt
    llvm/examples/LLVMBuild.txt
    llvm/lib/Analysis/LLVMBuild.txt
    llvm/lib/AsmParser/LLVMBuild.txt
    llvm/lib/BinaryFormat/LLVMBuild.txt
    llvm/lib/Bitcode/LLVMBuild.txt
    llvm/lib/Bitcode/Reader/LLVMBuild.txt
    llvm/lib/Bitcode/Writer/LLVMBuild.txt
    llvm/lib/Bitstream/LLVMBuild.txt
    llvm/lib/Bitstream/Reader/LLVMBuild.txt
    llvm/lib/CodeGen/AsmPrinter/LLVMBuild.txt
    llvm/lib/CodeGen/GlobalISel/LLVMBuild.txt
    llvm/lib/CodeGen/LLVMBuild.txt
    llvm/lib/CodeGen/MIRParser/LLVMBuild.txt
    llvm/lib/CodeGen/SelectionDAG/LLVMBuild.txt
    llvm/lib/DWARFLinker/LLVMBuild.txt
    llvm/lib/DebugInfo/CodeView/LLVMBuild.txt
    llvm/lib/DebugInfo/DWARF/LLVMBuild.txt
    llvm/lib/DebugInfo/GSYM/LLVMBuild.txt
    llvm/lib/DebugInfo/LLVMBuild.txt
    llvm/lib/DebugInfo/MSF/LLVMBuild.txt
    llvm/lib/DebugInfo/PDB/LLVMBuild.txt
    llvm/lib/DebugInfo/Symbolize/LLVMBuild.txt
    llvm/lib/Demangle/LLVMBuild.txt
    llvm/lib/ExecutionEngine/IntelJITEvents/LLVMBuild.txt
    llvm/lib/ExecutionEngine/Interpreter/LLVMBuild.txt
    llvm/lib/ExecutionEngine/JITLink/LLVMBuild.txt
    llvm/lib/ExecutionEngine/LLVMBuild.txt
    llvm/lib/ExecutionEngine/MCJIT/LLVMBuild.txt
    llvm/lib/ExecutionEngine/OProfileJIT/LLVMBuild.txt
    llvm/lib/ExecutionEngine/Orc/LLVMBuild.txt
    llvm/lib/ExecutionEngine/Orc/Shared/LLVMBuild.txt
    llvm/lib/ExecutionEngine/PerfJITEvents/LLVMBuild.txt
    llvm/lib/ExecutionEngine/RuntimeDyld/LLVMBuild.txt
    llvm/lib/Extensions/LLVMBuild.txt
    llvm/lib/Frontend/LLVMBuild.txt
    llvm/lib/Frontend/OpenMP/LLVMBuild.txt
    llvm/lib/FuzzMutate/LLVMBuild.txt
    llvm/lib/IR/LLVMBuild.txt
    llvm/lib/IRReader/LLVMBuild.txt
    llvm/lib/InterfaceStub/LLVMBuild.txt
    llvm/lib/LLVMBuild.txt
    llvm/lib/LTO/LLVMBuild.txt
    llvm/lib/LineEditor/LLVMBuild.txt
    llvm/lib/Linker/LLVMBuild.txt
    llvm/lib/MC/LLVMBuild.txt
    llvm/lib/MC/MCDisassembler/LLVMBuild.txt
    llvm/lib/MC/MCParser/LLVMBuild.txt
    llvm/lib/MCA/LLVMBuild.txt
    llvm/lib/Object/LLVMBuild.txt
    llvm/lib/ObjectYAML/LLVMBuild.txt
    llvm/lib/Option/LLVMBuild.txt
    llvm/lib/Passes/LLVMBuild.txt
    llvm/lib/ProfileData/Coverage/LLVMBuild.txt
    llvm/lib/ProfileData/LLVMBuild.txt
    llvm/lib/Remarks/LLVMBuild.txt
    llvm/lib/Support/LLVMBuild.txt
    llvm/lib/TableGen/LLVMBuild.txt
    llvm/lib/Target/AArch64/AsmParser/LLVMBuild.txt
    llvm/lib/Target/AArch64/Disassembler/LLVMBuild.txt
    llvm/lib/Target/AArch64/LLVMBuild.txt
    llvm/lib/Target/AArch64/MCTargetDesc/LLVMBuild.txt
    llvm/lib/Target/AArch64/TargetInfo/LLVMBuild.txt
    llvm/lib/Target/AArch64/Utils/LLVMBuild.txt
    llvm/lib/Target/AMDGPU/AsmParser/LLVMBuild.txt
    llvm/lib/Target/AMDGPU/Disassembler/LLVMBuild.txt
    llvm/lib/Target/AMDGPU/LLVMBuild.txt
    llvm/lib/Target/AMDGPU/MCTargetDesc/LLVMBuild.txt
    llvm/lib/Target/AMDGPU/TargetInfo/LLVMBuild.txt
    llvm/lib/Target/AMDGPU/Utils/LLVMBuild.txt
    llvm/lib/Target/ARC/Disassembler/LLVMBuild.txt
    llvm/lib/Target/ARC/LLVMBuild.txt
    llvm/lib/Target/ARC/MCTargetDesc/LLVMBuild.txt
    llvm/lib/Target/ARC/TargetInfo/LLVMBuild.txt
    llvm/lib/Target/ARM/AsmParser/LLVMBuild.txt
    llvm/lib/Target/ARM/Disassembler/LLVMBuild.txt
    llvm/lib/Target/ARM/LLVMBuild.txt
    llvm/lib/Target/ARM/MCTargetDesc/LLVMBuild.txt
    llvm/lib/Target/ARM/TargetInfo/LLVMBuild.txt
    llvm/lib/Target/ARM/Utils/LLVMBuild.txt
    llvm/lib/Target/AVR/AsmParser/LLVMBuild.txt
    llvm/lib/Target/AVR/Disassembler/LLVMBuild.txt
    llvm/lib/Target/AVR/LLVMBuild.txt
    llvm/lib/Target/AVR/MCTargetDesc/LLVMBuild.txt
    llvm/lib/Target/AVR/TargetInfo/LLVMBuild.txt
    llvm/lib/Target/BPF/AsmParser/LLVMBuild.txt
    llvm/lib/Target/BPF/Disassembler/LLVMBuild.txt
    llvm/lib/Target/BPF/LLVMBuild.txt
    llvm/lib/Target/BPF/MCTargetDesc/LLVMBuild.txt
    llvm/lib/Target/BPF/TargetInfo/LLVMBuild.txt
    llvm/lib/Target/CSKY/LLVMBuild.txt
    llvm/lib/Target/CSKY/TargetInfo/LLVMBuild.txt
    llvm/lib/Target/Hexagon/AsmParser/LLVMBuild.txt
    llvm/lib/Target/Hexagon/Disassembler/LLVMBuild.txt
    llvm/lib/Target/Hexagon/LLVMBuild.txt
    llvm/lib/Target/Hexagon/MCTargetDesc/LLVMBuild.txt
    llvm/lib/Target/Hexagon/TargetInfo/LLVMBuild.txt
    llvm/lib/Target/LLVMBuild.txt
    llvm/lib/Target/Lanai/AsmParser/LLVMBuild.txt
    llvm/lib/Target/Lanai/Disassembler/LLVMBuild.txt
    llvm/lib/Target/Lanai/LLVMBuild.txt
    llvm/lib/Target/Lanai/MCTargetDesc/LLVMBuild.txt
    llvm/lib/Target/Lanai/TargetInfo/LLVMBuild.txt
    llvm/lib/Target/MSP430/AsmParser/LLVMBuild.txt
    llvm/lib/Target/MSP430/Disassembler/LLVMBuild.txt
    llvm/lib/Target/MSP430/LLVMBuild.txt
    llvm/lib/Target/MSP430/MCTargetDesc/LLVMBuild.txt
    llvm/lib/Target/MSP430/TargetInfo/LLVMBuild.txt
    llvm/lib/Target/Mips/AsmParser/LLVMBuild.txt
    llvm/lib/Target/Mips/Disassembler/LLVMBuild.txt
    llvm/lib/Target/Mips/LLVMBuild.txt
    llvm/lib/Target/Mips/MCTargetDesc/LLVMBuild.txt
    llvm/lib/Target/Mips/TargetInfo/LLVMBuild.txt
    llvm/lib/Target/NVPTX/LLVMBuild.txt
    llvm/lib/Target/NVPTX/MCTargetDesc/LLVMBuild.txt
    llvm/lib/Target/NVPTX/TargetInfo/LLVMBuild.txt
    llvm/lib/Target/PowerPC/AsmParser/LLVMBuild.txt
    llvm/lib/Target/PowerPC/Disassembler/LLVMBuild.txt
    llvm/lib/Target/PowerPC/LLVMBuild.txt
    llvm/lib/Target/PowerPC/MCTargetDesc/LLVMBuild.txt
    llvm/lib/Target/PowerPC/TargetInfo/LLVMBuild.txt
    llvm/lib/Target/RISCV/AsmParser/LLVMBuild.txt
    llvm/lib/Target/RISCV/Disassembler/LLVMBuild.txt
    llvm/lib/Target/RISCV/LLVMBuild.txt
    llvm/lib/Target/RISCV/MCTargetDesc/LLVMBuild.txt
    llvm/lib/Target/RISCV/TargetInfo/LLVMBuild.txt
    llvm/lib/Target/RISCV/Utils/LLVMBuild.txt
    llvm/lib/Target/Sparc/AsmParser/LLVMBuild.txt
    llvm/lib/Target/Sparc/Disassembler/LLVMBuild.txt
    llvm/lib/Target/Sparc/LLVMBuild.txt
    llvm/lib/Target/Sparc/MCTargetDesc/LLVMBuild.txt
    llvm/lib/Target/Sparc/TargetInfo/LLVMBuild.txt
    llvm/lib/Target/SystemZ/AsmParser/LLVMBuild.txt
    llvm/lib/Target/SystemZ/Disassembler/LLVMBuild.txt
    llvm/lib/Target/SystemZ/LLVMBuild.txt
    llvm/lib/Target/SystemZ/MCTargetDesc/LLVMBuild.txt
    llvm/lib/Target/SystemZ/TargetInfo/LLVMBuild.txt
    llvm/lib/Target/VE/AsmParser/LLVMBuild.txt
    llvm/lib/Target/VE/Disassembler/LLVMBuild.txt
    llvm/lib/Target/VE/LLVMBuild.txt
    llvm/lib/Target/VE/MCTargetDesc/LLVMBuild.txt
    llvm/lib/Target/VE/TargetInfo/LLVMBuild.txt
    llvm/lib/Target/WebAssembly/AsmParser/LLVMBuild.txt
    llvm/lib/Target/WebAssembly/Disassembler/LLVMBuild.txt
    llvm/lib/Target/WebAssembly/LLVMBuild.txt
    llvm/lib/Target/WebAssembly/MCTargetDesc/LLVMBuild.txt
    llvm/lib/Target/WebAssembly/TargetInfo/LLVMBuild.txt
    llvm/lib/Target/X86/AsmParser/LLVMBuild.txt
    llvm/lib/Target/X86/Disassembler/LLVMBuild.txt
    llvm/lib/Target/X86/LLVMBuild.txt
    llvm/lib/Target/X86/MCTargetDesc/LLVMBuild.txt
    llvm/lib/Target/X86/TargetInfo/LLVMBuild.txt
    llvm/lib/Target/XCore/Disassembler/LLVMBuild.txt
    llvm/lib/Target/XCore/LLVMBuild.txt
    llvm/lib/Target/XCore/MCTargetDesc/LLVMBuild.txt
    llvm/lib/Target/XCore/TargetInfo/LLVMBuild.txt
    llvm/lib/Testing/LLVMBuild.txt
    llvm/lib/Testing/Support/LLVMBuild.txt
    llvm/lib/TextAPI/LLVMBuild.txt
    llvm/lib/ToolDrivers/LLVMBuild.txt
    llvm/lib/ToolDrivers/llvm-dlltool/LLVMBuild.txt
    llvm/lib/ToolDrivers/llvm-lib/LLVMBuild.txt
    llvm/lib/Transforms/AggressiveInstCombine/LLVMBuild.txt
    llvm/lib/Transforms/CFGuard/LLVMBuild.txt
    llvm/lib/Transforms/Coroutines/LLVMBuild.txt
    llvm/lib/Transforms/HelloNew/LLVMBuild.txt
    llvm/lib/Transforms/IPO/LLVMBuild.txt
    llvm/lib/Transforms/InstCombine/LLVMBuild.txt
    llvm/lib/Transforms/Instrumentation/LLVMBuild.txt
    llvm/lib/Transforms/LLVMBuild.txt
    llvm/lib/Transforms/ObjCARC/LLVMBuild.txt
    llvm/lib/Transforms/Scalar/LLVMBuild.txt
    llvm/lib/Transforms/Utils/LLVMBuild.txt
    llvm/lib/Transforms/Vectorize/LLVMBuild.txt
    llvm/lib/WindowsManifest/LLVMBuild.txt
    llvm/lib/XRay/LLVMBuild.txt
    llvm/projects/LLVMBuild.txt
    llvm/tools/LLVMBuild.txt
    llvm/tools/bugpoint/LLVMBuild.txt
    llvm/tools/dsymutil/LLVMBuild.txt
    llvm/tools/llc/LLVMBuild.txt
    llvm/tools/lli/ChildTarget/LLVMBuild.txt
    llvm/tools/lli/LLVMBuild.txt
    llvm/tools/llvm-ar/LLVMBuild.txt
    llvm/tools/llvm-as/LLVMBuild.txt
    llvm/tools/llvm-bcanalyzer/LLVMBuild.txt
    llvm/tools/llvm-cat/LLVMBuild.txt
    llvm/tools/llvm-cfi-verify/LLVMBuild.txt
    llvm/tools/llvm-cfi-verify/lib/LLVMBuild.txt
    llvm/tools/llvm-cov/LLVMBuild.txt
    llvm/tools/llvm-cvtres/LLVMBuild.txt
    llvm/tools/llvm-cxxdump/LLVMBuild.txt
    llvm/tools/llvm-cxxmap/LLVMBuild.txt
    llvm/tools/llvm-diff/LLVMBuild.txt
    llvm/tools/llvm-dis/LLVMBuild.txt
    llvm/tools/llvm-dwarfdump/LLVMBuild.txt
    llvm/tools/llvm-dwp/LLVMBuild.txt
    llvm/tools/llvm-elfabi/LLVMBuild.txt
    llvm/tools/llvm-exegesis/LLVMBuild.txt
    llvm/tools/llvm-exegesis/lib/AArch64/LLVMBuild.txt
    llvm/tools/llvm-exegesis/lib/LLVMBuild.txt
    llvm/tools/llvm-exegesis/lib/Mips/LLVMBuild.txt
    llvm/tools/llvm-exegesis/lib/PowerPC/LLVMBuild.txt
    llvm/tools/llvm-exegesis/lib/X86/LLVMBuild.txt
    llvm/tools/llvm-extract/LLVMBuild.txt
    llvm/tools/llvm-ifs/LLVMBuild.txt
    llvm/tools/llvm-jitlink/LLVMBuild.txt
    llvm/tools/llvm-jitlistener/LLVMBuild.txt
    llvm/tools/llvm-libtool-darwin/LLVMBuild.txt
    llvm/tools/llvm-link/LLVMBuild.txt
    llvm/tools/llvm-lipo/LLVMBuild.txt
    llvm/tools/llvm-lto/LLVMBuild.txt
    llvm/tools/llvm-lto2/LLVMBuild.txt
    llvm/tools/llvm-mc/LLVMBuild.txt
    llvm/tools/llvm-mca/LLVMBuild.txt
    llvm/tools/llvm-modextract/LLVMBuild.txt
    llvm/tools/llvm-mt/LLVMBuild.txt
    llvm/tools/llvm-nm/LLVMBuild.txt
    llvm/tools/llvm-objcopy/LLVMBuild.txt
    llvm/tools/llvm-objdump/LLVMBuild.txt
    llvm/tools/llvm-pdbutil/LLVMBuild.txt
    llvm/tools/llvm-profdata/LLVMBuild.txt
    llvm/tools/llvm-rc/LLVMBuild.txt
    llvm/tools/llvm-readobj/LLVMBuild.txt
    llvm/tools/llvm-reduce/LLVMBuild.txt
    llvm/tools/llvm-rtdyld/LLVMBuild.txt
    llvm/tools/llvm-size/LLVMBuild.txt
    llvm/tools/llvm-split/LLVMBuild.txt
    llvm/tools/llvm-stress/LLVMBuild.txt
    llvm/tools/llvm-strings/LLVMBuild.txt
    llvm/tools/llvm-undname/LLVMBuild.txt
    llvm/tools/opt/LLVMBuild.txt
    llvm/tools/verify-uselistorder/LLVMBuild.txt
    llvm/utils/LLVMBuild.txt
    llvm/utils/TableGen/LLVMBuild.txt
    llvm/utils/llvm-build/README.txt
    llvm/utils/llvm-build/llvm-build
    llvm/utils/llvm-build/llvmbuild/__init__.py
    llvm/utils/llvm-build/llvmbuild/componentinfo.py
    llvm/utils/llvm-build/llvmbuild/main.py
    llvm/utils/llvm-build/llvmbuild/util.py
    llvm/utils/unittest/LLVMBuild.txt


################################################################################
diff  --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 21563e151180..1f43dd5eb390 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -714,67 +714,6 @@ if(NOT Python3_Interpreter_FOUND)
   set(Python3_EXECUTABLE ${Python2_EXECUTABLE})
 endif()
 
-######
-# LLVMBuild Integration
-#
-# We use llvm-build to generate all the data required by the CMake based
-# build system in one swoop:
-#
-#  - We generate a file (a CMake fragment) in the object root which contains
-#    all the definitions that are required by CMake.
-#
-#  - We generate the library table used by llvm-config.
-#
-#  - We generate the dependencies for the CMake fragment, so that we will
-#    automatically reconfigure ourselves.
-
-set(LLVMBUILDTOOL "${LLVM_MAIN_SRC_DIR}/utils/llvm-build/llvm-build")
-set(LLVMCONFIGLIBRARYDEPENDENCIESINC
-  "${LLVM_BINARY_DIR}/tools/llvm-config/LibraryDependencies.inc")
-set(LLVMBUILDCMAKEFRAG
-  "${LLVM_BINARY_DIR}/LLVMBuild.cmake")
-
-# Create the list of optional components that are enabled
-if (LLVM_USE_INTEL_JITEVENTS)
-  set(LLVMOPTIONALCOMPONENTS IntelJITEvents)
-endif (LLVM_USE_INTEL_JITEVENTS)
-if (LLVM_USE_OPROFILE)
-  set(LLVMOPTIONALCOMPONENTS ${LLVMOPTIONALCOMPONENTS} OProfileJIT)
-endif (LLVM_USE_OPROFILE)
-if (LLVM_USE_PERF)
-  set(LLVMOPTIONALCOMPONENTS ${LLVMOPTIONALCOMPONENTS} PerfJITEvents)
-endif (LLVM_USE_PERF)
-
-message(STATUS "Constructing LLVMBuild project information")
-execute_process(
-  COMMAND "${Python3_EXECUTABLE}" -B ${LLVMBUILDTOOL}
-            --native-target "${LLVM_NATIVE_ARCH}"
-            --enable-targets "${LLVM_TARGETS_TO_BUILD}"
-            --enable-optional-components "${LLVMOPTIONALCOMPONENTS}"
-            --write-library-table ${LLVMCONFIGLIBRARYDEPENDENCIESINC}
-            --write-cmake-fragment ${LLVMBUILDCMAKEFRAG}
-            OUTPUT_VARIABLE LLVMBUILDOUTPUT
-            ERROR_VARIABLE LLVMBUILDERRORS
-            OUTPUT_STRIP_TRAILING_WHITESPACE
-            ERROR_STRIP_TRAILING_WHITESPACE
-  RESULT_VARIABLE LLVMBUILDRESULT)
-
-# On Win32, CMake doesn't properly handle piping the default output/error
-# streams into the GUI console. So, we explicitly catch and report them.
-if( NOT "${LLVMBUILDOUTPUT}" STREQUAL "")
-  message(STATUS "llvm-build output: ${LLVMBUILDOUTPUT}")
-endif()
-if( NOT "${LLVMBUILDRESULT}" STREQUAL "0" )
-  message(FATAL_ERROR
-    "Unexpected failure executing llvm-build: ${LLVMBUILDERRORS}")
-endif()
-
-# Include the generated CMake fragment. This will define properties from the
-# LLVMBuild files in a format which is easy to consume from CMake, and will add
-# the dependencies so that CMake will reconfigure properly when the LLVMBuild
-# files change.
-include(${LLVMBUILDCMAKEFRAG})
-
 ######
 
 # Configure all of the various header file fragments LLVM uses which depend on

diff  --git a/llvm/LLVMBuild.txt b/llvm/LLVMBuild.txt
deleted file mode 100644
index 4cc65f21e854..000000000000
--- a/llvm/LLVMBuild.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-;===- ./LLVMBuild.txt ------------------------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = bindings docs examples lib projects tools utils
-
-[component_0]
-type = Group
-name = Miscellaneous
-parent = $ROOT

diff  --git a/llvm/bindings/LLVMBuild.txt b/llvm/bindings/LLVMBuild.txt
deleted file mode 100644
index 9e54226ef53f..000000000000
--- a/llvm/bindings/LLVMBuild.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-;===- ./bindings/LLVMBuild.txt ---------------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Group
-name = Bindings
-parent = $ROOT

diff  --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 2bf071e61d62..921335242a3b 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -616,6 +616,13 @@ function(llvm_add_library name)
     endif()
   endif()
 
+  if(ARG_STATIC)
+    set(libtype PUBLIC)
+  else()
+    # We can use PRIVATE since SO knows its dependent libs.
+    set(libtype PRIVATE)
+  endif()
+
   if(ARG_MODULE AND LLVM_EXPORT_SYMBOLS_FOR_PLUGINS AND ARG_PLUGIN_TOOL AND (WIN32 OR CYGWIN))
     # On DLL platforms symbols are imported from the tool by linking against it.
     set(llvm_libs ${ARG_PLUGIN_TOOL})
@@ -630,19 +637,19 @@ function(llvm_add_library name)
     endif()
   else()
     # Components have not been defined explicitly in CMake, so add the
-    # dependency information for this library as defined by LLVMBuild.
+    # dependency information for this library through their name, and let
+    # LLVMBuildResolveComponentsLink resolve the mapping.
     #
     # It would be nice to verify that we have the dependencies for this library
     # name, but using get_property(... SET) doesn't suffice to determine if a
     # property has been set to an empty value.
-    get_property(lib_deps GLOBAL PROPERTY LLVMBUILD_LIB_DEPS_${name})
-  endif()
+    set_property(TARGET ${name} PROPERTY LLVM_LINK_COMPONENTS ${ARG_LINK_COMPONENTS} ${LLVM_LINK_COMPONENTS})
 
-  if(ARG_STATIC)
-    set(libtype PUBLIC)
-  else()
-    # We can use PRIVATE since SO knows its dependent libs.
-    set(libtype PRIVATE)
+    # These two properties are internal properties only used to make sure the
+    # link step applied in LLVMBuildResolveComponentsLink uses the same
+    # properties as the target_link_libraries call below.
+    set_property(TARGET ${name} PROPERTY LLVM_LINK_LIBS ${ARG_LINK_LIBS})
+    set_property(TARGET ${name} PROPERTY LLVM_LIBTYPE ${libtype})
   endif()
 
   target_link_libraries(${name} ${libtype}
@@ -723,8 +730,49 @@ function(add_llvm_install_targets target)
   endif()
 endfunction()
 
+# Define special targets that behave like a component group. They don't have any
+# source attached but other components can add themselves to them. If the
+# component supports is a Target and it supports JIT compilation, HAS_JIT must
+# be passed. One can use ADD_TO_COMPONENT option from add_llvm_component_library
+# to link extra component into an existing group.
+function(add_llvm_component_group name)
+  cmake_parse_arguments(ARG "HAS_JIT" "" "LINK_COMPONENTS" ${ARGN})
+  add_custom_target(${name})
+  if(ARG_HAS_JIT)
+    set_property(TARGET ${name} PROPERTY COMPONENT_HAS_JIT ON)
+  endif()
+  if(ARG_LINK_COMPONENTS)
+    set_property(TARGET ${name} PROPERTY LLVM_LINK_COMPONENTS ${ARG_LINK_COMPONENTS})
+  endif()
+endfunction()
+
+# An LLVM component is a cmake target with the following cmake properties
+# eventually set:
+#   - LLVM_COMPONENT_NAME: the name of the component, which can be the name of
+#     the associated library or the one specified through COMPONENT_NAME
+#   - LLVM_LINK_COMPONENTS: a list of component this component depends on
+#   - COMPONENT_HAS_JIT: (only for group component) whether this target group
+#     supports JIT compilation
+# Additionnaly, the ADD_TO_COMPONENT <component> option make it possible to add this
+# component to the LLVM_LINK_COMPONENTS of <component>.
 function(add_llvm_component_library name)
-  add_llvm_library(${name} COMPONENT_LIB ${ARGN})
+  cmake_parse_arguments(ARG
+    ""
+    "COMPONENT_NAME;ADD_TO_COMPONENT"
+    ""
+    ${ARGN})
+  add_llvm_library(${name} COMPONENT_LIB ${ARG_UNPARSED_ARGUMENTS})
+  string(REGEX REPLACE "^LLVM" "" component_name ${name})
+  set_property(TARGET ${name} PROPERTY LLVM_COMPONENT_NAME ${component_name})
+
+  if(ARG_COMPONENT_NAME)
+    set_property(GLOBAL PROPERTY LLVM_COMPONENT_NAME_${ARG_COMPONENT_NAME} ${component_name})
+  endif()
+
+  if(ARG_ADD_TO_COMPONENT)
+    set_property(TARGET ${ARG_ADD_TO_COMPONENT} APPEND PROPERTY LLVM_LINK_COMPONENTS ${component_name})
+  endif()
+
 endfunction()
 
 macro(add_llvm_library name)

diff  --git a/llvm/cmake/modules/LLVM-Build.cmake b/llvm/cmake/modules/LLVM-Build.cmake
new file mode 100644
index 000000000000..746f09b09019
--- /dev/null
+++ b/llvm/cmake/modules/LLVM-Build.cmake
@@ -0,0 +1,99 @@
+# Generate C code in the file provided as OUTPUT that describes the properties
+# of all components. This C code is suitable for inclusion in `llvm-config`
+function(LLVMBuildGenerateCFragment)
+  cmake_parse_arguments(ARG "" "OUTPUT" "" ${ARGN})
+
+  # Write C header
+  #################
+  get_property(llvmbuild_components GLOBAL PROPERTY LLVM_COMPONENT_LIBS)
+  foreach(llvmbuild_component ${llvmbuild_components})
+    string(REGEX REPLACE "^LLVM" "" component_name ${llvmbuild_component})
+    list(APPEND all_component_libdeps ${component_name})
+  endforeach()
+  list(APPEND llvmbuild_components all)
+  list(APPEND llvmbuild_components all-targets)
+  list(APPEND llvmbuild_components Engine)
+  list(APPEND llvmbuild_components Native)
+  list(APPEND llvmbuild_components NativeCodeGen)
+  foreach(llvm_target_to_build ${LLVM_TARGETS_TO_BUILD})
+    list(APPEND llvmbuild_components ${llvm_target_to_build})
+  endforeach()
+
+  list(LENGTH llvmbuild_components llvmbuild_components_size)
+  file(WRITE ${ARG_OUTPUT}
+  "
+  struct AvailableComponent {
+    /// The name of the component.
+    const char *Name;
+
+    /// The name of the library for this component (or NULL).
+    const char *Library;
+
+    /// Whether the component is installed.
+    bool IsInstalled;
+
+    /// The list of libraries required when linking this component.
+    const char *RequiredLibraries[${llvmbuild_components_size}];
+  } AvailableComponents[${llvmbuild_components_size}] = {
+  ")
+
+  foreach(llvmbuild_component ${llvmbuild_components})
+    if(llvmbuild_component STREQUAL "all")
+      unset(llvmbuild_libname)
+      set(llvmbuild_libdeps ${all_component_libdeps})
+    else()
+      get_property(llvmbuild_libname TARGET ${llvmbuild_component} PROPERTY LLVM_COMPONENT_NAME)
+      get_property(llvmbuild_libdeps TARGET ${llvmbuild_component} PROPERTY LLVM_LINK_COMPONENTS)
+    endif()
+    string(TOLOWER ${llvmbuild_component} llvmbuild_componentname)
+
+    if(NOT llvmbuild_libname)
+      set(llvmbuild_llvmlibname nullptr)
+      string(TOLOWER ${llvmbuild_component} llvmbuild_libname)
+    else()
+      set(llvmbuild_llvmlibname "\"LLVM${llvmbuild_libname}\"")
+      string(TOLOWER ${llvmbuild_libname} llvmbuild_libname)
+    endif()
+
+    set(llvmbuild_clibdeps "")
+    foreach(llvmbuild_libdep ${llvmbuild_libdeps})
+      get_property(llvmbuild_libdepname GLOBAL PROPERTY LLVM_COMPONENT_NAME_${llvmbuild_libdep})
+      if(NOT llvmbuild_libdepname)
+        string(TOLOWER ${llvmbuild_libdep} llvmbuild_clibdep)
+      else()
+        string(TOLOWER ${llvmbuild_libdepname} llvmbuild_clibdep)
+      endif()
+      list(APPEND llvmbuild_clibdeps ${llvmbuild_clibdep})
+    endforeach()
+
+    list(TRANSFORM llvmbuild_clibdeps PREPEND "\"")
+    list(TRANSFORM llvmbuild_clibdeps APPEND "\"")
+    list(JOIN llvmbuild_clibdeps ", " llvmbuild_clibdeps_joint)
+    list(APPEND llvmbuild_centries "{ \"${llvmbuild_libname}\", ${llvmbuild_llvmlibname}, true, {${llvmbuild_clibdeps_joint}} },\n")
+  endforeach()
+
+  list(SORT llvmbuild_centries)
+  foreach(llvmbuild_centry ${llvmbuild_centries})
+    file(APPEND ${ARG_OUTPUT} "${llvmbuild_centry}")
+  endforeach()
+  file(APPEND ${ARG_OUTPUT} "};")
+endfunction()
+
+# Resolve cross-component dependencies, for each available component.
+function(LLVMBuildResolveComponentsLink)
+  get_property(llvm_components GLOBAL PROPERTY LLVM_COMPONENT_LIBS)
+  get_property(llvm_has_jit_native TARGET ${LLVM_NATIVE_ARCH} PROPERTY LLVM_HAS_JIT)
+  if(llvm_has_jit_native)
+    set_property(TARGET Engine APPEND PROPERTY LLVM_LINK_COMPONENTS "MCJIT" "Native")
+  else()
+    set_property(TARGET Engine APPEND PROPERTY LLVM_LINK_COMPONENTS "Interpreter")
+  endif()
+  foreach(llvm_component ${llvm_components})
+    get_property(link_components TARGET ${llvm_component} PROPERTY LLVM_LINK_COMPONENTS)
+    llvm_map_components_to_libnames(llvm_libs ${link_components})
+    if(llvm_libs)
+      get_property(libtype TARGET ${llvm_component} PROPERTY LLVM_LIBTYPE)
+      target_link_libraries(${llvm_component} ${libtype} ${llvm_libs})
+    endif()
+  endforeach()
+endfunction()

diff  --git a/llvm/cmake/modules/LLVM-Config.cmake b/llvm/cmake/modules/LLVM-Config.cmake
index 76d4d3e8dbba..5a79fc10552e 100644
--- a/llvm/cmake/modules/LLVM-Config.cmake
+++ b/llvm/cmake/modules/LLVM-Config.cmake
@@ -253,6 +253,10 @@ function(llvm_map_components_to_libnames out_libs)
   # Translate symbolic component names to real libraries:
   llvm_expand_pseudo_components(link_components ${link_components})
   foreach(c ${link_components})
+    get_property(c_rename GLOBAL PROPERTY LLVM_COMPONENT_NAME_${c})
+    if(c_rename)
+        set(c ${c_rename})
+    endif()
     if( c STREQUAL "native" )
       # already processed
     elseif( c STREQUAL "backend" )

diff  --git a/llvm/docs/CodingStandards.rst b/llvm/docs/CodingStandards.rst
index 9c95e3ebf28a..a5798bd73cb1 100644
--- a/llvm/docs/CodingStandards.rst
+++ b/llvm/docs/CodingStandards.rst
@@ -748,8 +748,7 @@ Library Layering
 ^^^^^^^^^^^^^^^^
 
 A directory of header files (for example ``include/llvm/Foo``) defines a
-library (``Foo``). Dependencies between libraries are defined by the
-``LLVMBuild.txt`` file in their implementation (``lib/Foo``). One library (both
+library (``Foo``). One library (both
 its headers and implementation) should only use things from the libraries
 listed in its dependencies.
 

diff  --git a/llvm/docs/CommandGuide/index.rst b/llvm/docs/CommandGuide/index.rst
index 2dae12bb7f6d..f822be96ceb0 100644
--- a/llvm/docs/CommandGuide/index.rst
+++ b/llvm/docs/CommandGuide/index.rst
@@ -73,7 +73,6 @@ Developer Tools
    FileCheck
    tblgen
    lit
-   llvm-build
    llvm-exegesis
    llvm-pdbutil
    llvm-locstats

diff  --git a/llvm/docs/CommandGuide/llvm-build.rst b/llvm/docs/CommandGuide/llvm-build.rst
deleted file mode 100644
index 1abf8fbd0463..000000000000
--- a/llvm/docs/CommandGuide/llvm-build.rst
+++ /dev/null
@@ -1,79 +0,0 @@
-llvm-build - LLVM Project Build Utility
-=======================================
-
-.. program:: llvm-build
-
-SYNOPSIS
---------
-
-**llvm-build** [*options*]
-
-DESCRIPTION
------------
-
-**llvm-build** is a tool for working with LLVM projects that use the LLVMBuild
-system for describing their components.
-
-At heart, **llvm-build** is responsible for loading, verifying, and manipulating
-the project's component data. The tool is primarily designed for use in
-implementing build systems and tools which need access to the project structure
-information.
-
-OPTIONS
--------
-
-**-h**, **--help**
-
- Print the builtin program help.
-
-**--source-root**\ =\ *PATH*
-
- If given, load the project at the given source root path. If this option is not
- given, the location of the project sources will be inferred from the location of
- the **llvm-build** script itself.
-
-**--print-tree**
-
- Print the component tree for the project.
-
-**--write-library-table**
-
- Write out the C++ fragment which defines the components, library names, and
- required libraries. This C++ fragment is built into llvm-config|llvm-config
- in order to provide clients with the list of required libraries for arbitrary
- component combinations.
-
-**--write-llvmbuild**
-
- Write out new *LLVMBuild.txt* files based on the loaded components. This is
- useful for auto-upgrading the schema of the files. **llvm-build** will try to a
- limited extent to preserve the comments which were written in the original
- source file, although at this time it only preserves block comments that precede
- the section names in the *LLVMBuild* files.
-
-**--write-cmake-fragment**
-
- Write out the LLVMBuild in the form of a CMake fragment, so it can easily be
- consumed by the CMake based build system. The exact contents and format of this
- file are closely tied to how LLVMBuild is integrated with CMake, see LLVM's
- top-level CMakeLists.txt.
-
-**--write-make-fragment**
-
- Write out the LLVMBuild in the form of a Makefile fragment, so it can easily be
- consumed by a Make based build system. The exact contents and format of this
- file are closely tied to how LLVMBuild is integrated with the Makefiles, see
- LLVM's Makefile.rules.
-
-**--llvmbuild-source-root**\ =\ *PATH*
-
- If given, expect the *LLVMBuild* files for the project to be rooted at the
- given path, instead of inside the source tree itself. This option is primarily
- designed for use in conjunction with **--write-llvmbuild** to test changes to
- *LLVMBuild* schema.
-
-EXIT STATUS
------------
-
-**llvm-build** exits with 0 if operation was successful. Otherwise, it will exist
-with a non-zero value.

diff  --git a/llvm/docs/GettingInvolved.rst b/llvm/docs/GettingInvolved.rst
index 32e042df03b2..3b6e14e5840e 100644
--- a/llvm/docs/GettingInvolved.rst
+++ b/llvm/docs/GettingInvolved.rst
@@ -65,7 +65,6 @@ Information about LLVM's development process.
    :hidden:
 
    Projects
-   LLVMBuild
    HowToReleaseLLVM
    Packaging
    ReleaseProcess
@@ -78,10 +77,6 @@ Information about LLVM's development process.
   tree) allow the project code to be located outside (or inside) the ``llvm/``
   tree, while using LLVM header files and libraries.
 
-:doc:`LLVMBuild`
-  Describes the LLVMBuild organization and files used by LLVM to specify
-  component descriptions.
-
 :doc:`HowToReleaseLLVM`
   This is a guide to preparing LLVM releases. Most developers can ignore it.
 

diff  --git a/llvm/docs/LLVMBuild.rst b/llvm/docs/LLVMBuild.rst
deleted file mode 100644
index 622780aee312..000000000000
--- a/llvm/docs/LLVMBuild.rst
+++ /dev/null
@@ -1,323 +0,0 @@
-===============
-LLVMBuild Guide
-===============
-
-.. contents::
-   :local:
-
-Introduction
-============
-
-This document describes the ``LLVMBuild`` organization and files which
-we use to describe parts of the LLVM ecosystem. For description of
-specific LLVMBuild related tools, please see the command guide.
-
-LLVM is designed to be a modular set of libraries which can be flexibly
-mixed together in order to build a variety of tools, like compilers,
-JITs, custom code generators, optimization passes, interpreters, and so
-on. Related projects in the LLVM system like Clang and LLDB also tend to
-follow this philosophy.
-
-In order to support this usage style, LLVM has a fairly strict structure
-as to how the source code and various components are organized. The
-``LLVMBuild.txt`` files are the explicit specification of that
-structure, and are used by the build systems and other tools in order to
-develop the LLVM project.
-
-Project Organization
-====================
-
-The source code for LLVM projects using the LLVMBuild system (LLVM,
-Clang, and LLDB) is organized into *components*, which define the
-separate pieces of functionality that make up the project. These
-projects may consist of many libraries, associated tools, build tools,
-or other utility tools (for example, testing tools).
-
-For the most part, the project contents are organized around defining
-one main component per each subdirectory. Each such directory contains
-an ``LLVMBuild.txt`` which contains the component definitions.
-
-The component descriptions for the project as a whole are automatically
-gathered by the LLVMBuild tools. The tools automatically traverse the
-source directory structure to find all of the component description
-files. NOTE: For performance/sanity reasons, we only traverse into
-subdirectories when the parent itself contains an ``LLVMBuild.txt``
-description file.
-
-Build Integration
-=================
-
-The LLVMBuild files themselves are just a declarative way to describe
-the project structure. The actual building of the LLVM project is
-handled by another build system (See: :doc:`CMake <CMake>`).
-
-The build system implementation will load the relevant contents of the
-LLVMBuild files and use that to drive the actual project build.
-Typically, the build system will only need to load this information at
-"configure" time, and use it to generate native information. Build
-systems will also handle automatically reconfiguring their information
-when the contents of the ``LLVMBuild.txt`` files change.
-
-Developers generally are not expected to need to be aware of the details
-of how the LLVMBuild system is integrated into their build. Ideally,
-LLVM developers who are not working on the build system would only ever
-need to modify the contents of the ``LLVMBuild.txt`` description files
-(although we have not reached this goal yet).
-
-For more information on the utility tool we provide to help interfacing
-with the build system, please see the :doc:`llvm-build
-<CommandGuide/llvm-build>` documentation.
-
-Component Overview
-==================
-
-As mentioned earlier, LLVM projects are organized into logical
-*components*. Every component is typically grouped into its own
-subdirectory. Generally, a component is organized around a coherent
-group of sources which have some kind of clear API separation from other
-parts of the code.
-
-LLVM primarily uses the following types of components:
-
-- *Libraries* - Library components define a distinct API which can be
-  independently linked into LLVM client applications. Libraries typically
-  have private and public header files, and may specify a link of required
-  libraries that they build on top of.
-- *Build Tools* - Build tools are applications which are designed to be run
-  as part of the build process (typically to generate other source files).
-  Currently, LLVM uses one main build tool called :doc:`TableGen/index`
-  to generate a variety of source files.
-- *Tools* - Command line applications which are built using the LLVM
-  component libraries. Most LLVM tools are small and are primarily
-  frontends to the library interfaces.
-
-Components are described using ``LLVMBuild.txt`` files in the directories
-that define the component. See the `LLVMBuild Format Reference`_ section
-for information on the exact format of these files.
-
-LLVMBuild Format Reference
-==========================
-
-LLVMBuild files are written in a simple variant of the INI or configuration
-file format (`Wikipedia entry`_). The format defines a list of sections
-each of which may contain some number of properties. A simple example of
-the file format is below:
-
-.. _Wikipedia entry: http://en.wikipedia.org/wiki/INI_file
-
-.. code-block:: ini
-
-   ; Comments start with a semi-colon.
-
-   ; Sections are declared using square brackets.
-   [component_0]
-
-   ; Properties are declared using '=' and are contained in the previous section.
-   ;
-   ; We support simple string and boolean scalar values and list values, where
-   ; items are separated by spaces. There is no support for quoting, and so
-   ; property values may not contain spaces.
-   property_name = property_value
-   list_property_name = value_1 value_2 ... value_n
-   boolean_property_name = 1 (or 0)
-
-LLVMBuild files are expected to define a strict set of sections and
-properties. A typical component description file for a library
-component would look like the following example:
-
-.. code-block:: ini
-
-   [component_0]
-   type = Library
-   name = Linker
-   parent = Libraries
-   required_libraries = Archive BitReader Core Support TransformUtils
-
-A full description of the exact sections and properties which are
-allowed follows.
-
-Each file may define exactly one common component, named ``common``. The
-common component may define the following properties:
-
--  ``subdirectories`` **[optional]**
-
-   If given, a list of the names of the subdirectories from the current
-   subpath to search for additional LLVMBuild files.
-
-Each file may define multiple components. Each component is described by a
-section who name starts with ``component``. The remainder of the section
-name is ignored, but each section name must be unique. Typically components
-are just number in order for files with multiple components
-(``component_0``, ``component_1``, and so on).
-
-.. warning::
-
-   Section names not matching this format (or the ``common`` section) are
-   currently unused and are disallowed.
-
-Every component is defined by the properties in the section. The exact
-list of properties that are allowed depends on the component type.
-Components **may not** define any properties other than those expected
-by the component type.
-
-Every component must define the following properties:
-
--  ``type`` **[required]**
-
-   The type of the component. Supported component types are detailed
-   below. Most components will define additional properties which may be
-   required or optional.
-
--  ``name`` **[required]**
-
-   The name of the component. Names are required to be unique across the
-   entire project.
-
--  ``parent`` **[required]**
-
-   The name of the logical parent of the component. Components are
-   organized into a logical tree to make it easier to navigate and
-   organize groups of components. The parents have no semantics as far
-   as the project build is concerned, however. Typically, the parent
-   will be the main component of the parent directory.
-
-   Components may reference the root pseudo component using ``$ROOT`` to
-   indicate they should logically be grouped at the top-level.
-
-Components may define the following properties:
-
--  ``dependencies`` **[optional]**
-
-   If specified, a list of names of components which *must* be built
-   prior to this one. This should only be exactly those components which
-   produce some tool or source code required for building the component.
-
-   .. note::
-
-      ``Group`` and ``LibraryGroup`` components have no semantics for the
-      actual build, and are not allowed to specify dependencies.
-
-The following section lists the available component types, as well as
-the properties which are associated with that component.
-
--  ``type = Group``
-
-   Group components exist purely to allow additional arbitrary structuring
-   of the logical components tree. For example, one might define a
-   ``Libraries`` group to hold all of the root library components.
-
-   ``Group`` components have no additionally properties.
-
--  ``type = Library``
-
-   Library components define an individual library which should be built
-   from the source code in the component directory.
-
-   Components with this type use the following properties:
-
-   -  ``library_name`` **[optional]**
-
-      If given, the name to use for the actual library file on disk. If
-      not given, the name is derived from the component name itself.
-
-   -  ``required_libraries`` **[optional]**
-
-      If given, a list of the names of ``Library`` or ``LibraryGroup``
-      components which must also be linked in whenever this library is
-      used. That is, the link time dependencies for this component. When
-      tools are built, the build system will include the transitive closure
-      of all ``required_libraries`` for the components the tool needs.
-
-   -  ``add_to_library_groups`` **[optional]**
-
-      If given, a list of the names of ``LibraryGroup`` components which
-      this component is also part of. This allows nesting groups of
-      components.  For example, the ``X86`` target might define a library
-      group for all of the ``X86`` components. That library group might
-      then be included in the ``all-targets`` library group.
-
-   -  ``installed`` **[optional]** **[boolean]**
-
-      Whether this library is installed. Libraries that are not installed
-      are only reported by ``llvm-config`` when it is run as part of a
-      development directory.
-
--  ``type = LibraryGroup``
-
-   ``LibraryGroup`` components are a mechanism to allow easy definition of
-   useful sets of related components. In particular, we use them to easily
-   specify things like "all targets", or "all assembly printers".
-
-   Components with this type use the following properties:
-
-   -  ``required_libraries`` **[optional]**
-
-      See the ``Library`` type for a description of this property.
-
-   -  ``add_to_library_groups`` **[optional]**
-
-      See the ``Library`` type for a description of this property.
-
--  ``type = TargetGroup``
-
-   ``TargetGroup`` components are an extension of ``LibraryGroup``\s,
-   specifically for defining LLVM targets (which are handled specially in a
-   few places).
-
-   The name of the component should always be the name of the target.
-
-   Components with this type use the ``LibraryGroup`` properties in
-   addition to:
-
-   -  ``has_asmparser`` **[optional]** **[boolean]**
-
-      Whether this target defines an assembly parser.
-
-   -  ``has_asmprinter`` **[optional]** **[boolean]**
-
-      Whether this target defines an assembly printer.
-
-   -  ``has_disassembler`` **[optional]** **[boolean]**
-
-      Whether this target defines a disassembler.
-
-   -  ``has_jit`` **[optional]** **[boolean]**
-
-      Whether this target supports JIT compilation.
-
--  ``type = Tool``
-
-   ``Tool`` components define standalone command line tools which should be
-   built from the source code in the component directory and linked.
-
-   Components with this type use the following properties:
-
-   -  ``required_libraries`` **[optional]**
-
-      If given, a list of the names of ``Library`` or ``LibraryGroup``
-      components which this tool is required to be linked with.
-
-      .. note::
-
-         The values should be the component names, which may not always
-         match up with the actual library names on disk.
-
-      Build systems are expected to properly include all of the libraries
-      required by the linked components (i.e., the transitive closure of
-      ``required_libraries``).
-
-      Build systems are also expected to understand that those library
-      components must be built prior to linking -- they do not also need
-      to be listed under ``dependencies``.
-
--  ``type = BuildTool``
-
-   ``BuildTool`` components are like ``Tool`` components, except that the
-   tool is supposed to be built for the platform where the build is running
-   (instead of that platform being targeted). Build systems are expected
-   to handle the fact that required libraries may need to be built for
-   multiple platforms in order to be able to link this tool.
-
-   ``BuildTool`` components currently use the exact same properties as
-   ``Tool`` components, the type distinction is only used to 
diff erentiate
-   what the tool is built for.

diff  --git a/llvm/docs/LLVMBuild.txt b/llvm/docs/LLVMBuild.txt
deleted file mode 100644
index 74422db0494f..000000000000
--- a/llvm/docs/LLVMBuild.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-;===- ./docs/LLVMBuild.txt -------------------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   https://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Group
-name = Docs
-parent = $ROOT

diff  --git a/llvm/docs/WritingAnLLVMNewPMPass.rst b/llvm/docs/WritingAnLLVMNewPMPass.rst
index f992c850c193..ad8a9d5a1926 100644
--- a/llvm/docs/WritingAnLLVMNewPMPass.rst
+++ b/llvm/docs/WritingAnLLVMNewPMPass.rst
@@ -48,7 +48,7 @@ Setting up the build
 First, configure and build LLVM as described in :doc:`GettingStarted`.
 
 Next, we will reuse an existing directory (creating a new directory involves
-modifying more ``CMakeLists.txt``s and ``LLVMBuild.txt``s than we want). For
+modifying more ``CMakeLists.txt``s than we want). For
 this example, we'll use ``llvm/lib/Transforms/HelloNew/HelloWorld.cpp``,
 which has already been created. If you'd like to create your own pass, add a
 new source file into ``llvm/lib/Transforms/HelloNew/CMakeLists.txt`` under

diff  --git a/llvm/examples/LLVMBuild.txt b/llvm/examples/LLVMBuild.txt
deleted file mode 100644
index 582ccb0c1e3e..000000000000
--- a/llvm/examples/LLVMBuild.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-;===- ./examples/LLVMBuild.txt ---------------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Group
-name = Examples
-parent = $ROOT

diff  --git a/llvm/lib/Analysis/CMakeLists.txt b/llvm/lib/Analysis/CMakeLists.txt
index 4bd45ead30d3..c7e20b2e90dd 100644
--- a/llvm/lib/Analysis/CMakeLists.txt
+++ b/llvm/lib/Analysis/CMakeLists.txt
@@ -135,4 +135,11 @@ add_llvm_component_library(LLVMAnalysis
 
   LINK_LIBS
   ${MLLinkDeps}
+
+  LINK_COMPONENTS
+  BinaryFormat
+  Core
+  Object
+  ProfileData
+  Support
   )

diff  --git a/llvm/lib/Analysis/LLVMBuild.txt b/llvm/lib/Analysis/LLVMBuild.txt
deleted file mode 100644
index d73b55f037fa..000000000000
--- a/llvm/lib/Analysis/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/Analysis/LLVMBuild.txt -----------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = Analysis
-parent = Libraries
-required_libraries = BinaryFormat Core Object ProfileData Support

diff  --git a/llvm/lib/AsmParser/CMakeLists.txt b/llvm/lib/AsmParser/CMakeLists.txt
index 2056a77fd76e..b0ed82729c7a 100644
--- a/llvm/lib/AsmParser/CMakeLists.txt
+++ b/llvm/lib/AsmParser/CMakeLists.txt
@@ -9,4 +9,9 @@ add_llvm_component_library(LLVMAsmParser
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  BinaryFormat
+  Core
+  Support
   )

diff  --git a/llvm/lib/AsmParser/LLVMBuild.txt b/llvm/lib/AsmParser/LLVMBuild.txt
deleted file mode 100644
index cacb753f6a9d..000000000000
--- a/llvm/lib/AsmParser/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/AsmParser/LLVMBuild.txt ----------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = AsmParser
-parent = Libraries
-required_libraries = BinaryFormat Core Support

diff  --git a/llvm/lib/BinaryFormat/CMakeLists.txt b/llvm/lib/BinaryFormat/CMakeLists.txt
index c17437288b36..66c890524543 100644
--- a/llvm/lib/BinaryFormat/CMakeLists.txt
+++ b/llvm/lib/BinaryFormat/CMakeLists.txt
@@ -13,5 +13,7 @@ add_llvm_component_library(LLVMBinaryFormat
 
   ADDITIONAL_HEADER_DIRS
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/BinaryFormat
+
+  LINK_COMPONENTS
+  Support
   )
-  

diff  --git a/llvm/lib/BinaryFormat/LLVMBuild.txt b/llvm/lib/BinaryFormat/LLVMBuild.txt
deleted file mode 100644
index 7e5dccde41f8..000000000000
--- a/llvm/lib/BinaryFormat/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/BinaryFormat/LLVMBuild.txt -------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = BinaryFormat
-parent = Libraries
-required_libraries = Support

diff  --git a/llvm/lib/Bitcode/LLVMBuild.txt b/llvm/lib/Bitcode/LLVMBuild.txt
deleted file mode 100644
index 3698fe6172c3..000000000000
--- a/llvm/lib/Bitcode/LLVMBuild.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-;===- ./lib/Bitcode/LLVMBuild.txt ------------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = Reader Writer
-
-[component_0]
-type = Group
-name = Bitcode
-parent = Libraries

diff  --git a/llvm/lib/Bitcode/Reader/CMakeLists.txt b/llvm/lib/Bitcode/Reader/CMakeLists.txt
index 0e328fe37f20..2d9ce849efca 100644
--- a/llvm/lib/Bitcode/Reader/CMakeLists.txt
+++ b/llvm/lib/Bitcode/Reader/CMakeLists.txt
@@ -10,4 +10,9 @@ add_llvm_component_library(LLVMBitReader
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  BitstreamReader
+  Core
+  Support
   )

diff  --git a/llvm/lib/Bitcode/Reader/LLVMBuild.txt b/llvm/lib/Bitcode/Reader/LLVMBuild.txt
deleted file mode 100644
index 2eafab53c58b..000000000000
--- a/llvm/lib/Bitcode/Reader/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/Bitcode/Reader/LLVMBuild.txt -----------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = BitReader
-parent = Bitcode
-required_libraries = BitstreamReader Core Support

diff  --git a/llvm/lib/Bitcode/Writer/CMakeLists.txt b/llvm/lib/Bitcode/Writer/CMakeLists.txt
index 6d1530e34cbe..36808c8ae28f 100644
--- a/llvm/lib/Bitcode/Writer/CMakeLists.txt
+++ b/llvm/lib/Bitcode/Writer/CMakeLists.txt
@@ -6,4 +6,11 @@ add_llvm_component_library(LLVMBitWriter
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  Analysis
+  Core
+  MC
+  Object
+  Support
   )

diff  --git a/llvm/lib/Bitcode/Writer/LLVMBuild.txt b/llvm/lib/Bitcode/Writer/LLVMBuild.txt
deleted file mode 100644
index 34c99cbb9309..000000000000
--- a/llvm/lib/Bitcode/Writer/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/Bitcode/Writer/LLVMBuild.txt -----------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = BitWriter
-parent = Bitcode
-required_libraries = Analysis Core MC Object Support

diff  --git a/llvm/lib/Bitstream/LLVMBuild.txt b/llvm/lib/Bitstream/LLVMBuild.txt
deleted file mode 100644
index 1dfb6d2ed1e8..000000000000
--- a/llvm/lib/Bitstream/LLVMBuild.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-;===- ./lib/Bitstream/LLVMBuild.txt ----------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = Reader
-
-[component_0]
-type = Group
-name = Bitstream
-parent = Libraries

diff  --git a/llvm/lib/Bitstream/Reader/CMakeLists.txt b/llvm/lib/Bitstream/Reader/CMakeLists.txt
index 3d831ecbcdac..832ccecfb7c9 100644
--- a/llvm/lib/Bitstream/Reader/CMakeLists.txt
+++ b/llvm/lib/Bitstream/Reader/CMakeLists.txt
@@ -4,4 +4,7 @@ add_llvm_component_library(LLVMBitstreamReader
   ADDITIONAL_HEADER_DIRS
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/Bitcode
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/Bitstream
+
+  LINK_COMPONENTS
+  Support
   )

diff  --git a/llvm/lib/Bitstream/Reader/LLVMBuild.txt b/llvm/lib/Bitstream/Reader/LLVMBuild.txt
deleted file mode 100644
index 8ef4276c90a4..000000000000
--- a/llvm/lib/Bitstream/Reader/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/Bitstream/Reader/LLVMBuild.txt ---------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = BitstreamReader
-parent = Bitstream
-required_libraries = Support

diff  --git a/llvm/lib/CMakeLists.txt b/llvm/lib/CMakeLists.txt
index 851b89bb95f0..9425efab94a9 100644
--- a/llvm/lib/CMakeLists.txt
+++ b/llvm/lib/CMakeLists.txt
@@ -1,3 +1,13 @@
+include(LLVM-Build)
+
+# Special components which don't have any source attached but aggregate other
+# components
+add_llvm_component_group(all-targets LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD})
+add_llvm_component_group(Engine)
+add_llvm_component_group(Native LINK_COMPONENTS ${LLVM_NATIVE_ARCH})
+add_llvm_component_group(NativeCodeGen LINK_COMPONENTS ${LLVM_NATIVE_ARCH}CodeGen)
+
+
 # `Demangle', `Support' and `TableGen' libraries are added on the top-level
 # CMakeLists.txt
 
@@ -37,3 +47,8 @@ if (LLVM_INCLUDE_TESTS)
   add_subdirectory(Testing)
 endif()
 add_subdirectory(WindowsManifest)
+
+set(LLVMCONFIGLIBRARYDEPENDENCIESINC "${LLVM_BINARY_DIR}/tools/llvm-config/LibraryDependencies.inc")
+
+LLVMBuildResolveComponentsLink()
+LLVMBuildGenerateCFragment(OUTPUT ${LLVMCONFIGLIBRARYDEPENDENCIESINC})

diff  --git a/llvm/lib/CodeGen/AsmPrinter/CMakeLists.txt b/llvm/lib/CodeGen/AsmPrinter/CMakeLists.txt
index 1445bf4fbf20..a79b846f4fc2 100644
--- a/llvm/lib/CodeGen/AsmPrinter/CMakeLists.txt
+++ b/llvm/lib/CodeGen/AsmPrinter/CMakeLists.txt
@@ -27,4 +27,18 @@ add_llvm_component_library(LLVMAsmPrinter
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  Analysis
+  BinaryFormat
+  CodeGen
+  Core
+  DebugInfoCodeView
+  DebugInfoDWARF
+  DebugInfoMSF
+  MC
+  MCParser
+  Remarks
+  Support
+  Target
   )

diff  --git a/llvm/lib/CodeGen/AsmPrinter/LLVMBuild.txt b/llvm/lib/CodeGen/AsmPrinter/LLVMBuild.txt
deleted file mode 100644
index 44595a18f1b5..000000000000
--- a/llvm/lib/CodeGen/AsmPrinter/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/CodeGen/AsmPrinter/LLVMBuild.txt -------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = AsmPrinter
-parent = Libraries
-required_libraries = Analysis BinaryFormat CodeGen Core DebugInfoCodeView DebugInfoDWARF DebugInfoMSF MC MCParser Remarks Support Target

diff  --git a/llvm/lib/CodeGen/CMakeLists.txt b/llvm/lib/CodeGen/CMakeLists.txt
index abb4808ee752..d196555ffc94 100644
--- a/llvm/lib/CodeGen/CMakeLists.txt
+++ b/llvm/lib/CodeGen/CMakeLists.txt
@@ -197,6 +197,18 @@ add_llvm_component_library(LLVMCodeGen
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  Analysis
+  BitReader
+  BitWriter
+  Core
+  MC
+  ProfileData
+  Scalar
+  Support
+  Target
+  TransformUtils
   )
 
 add_subdirectory(SelectionDAG)

diff  --git a/llvm/lib/CodeGen/GlobalISel/CMakeLists.txt b/llvm/lib/CodeGen/GlobalISel/CMakeLists.txt
index b2b0f54f2752..f97ec66c18c3 100644
--- a/llvm/lib/CodeGen/GlobalISel/CMakeLists.txt
+++ b/llvm/lib/CodeGen/GlobalISel/CMakeLists.txt
@@ -1,32 +1,42 @@
 add_llvm_component_library(LLVMGlobalISel
-        CSEInfo.cpp
-        GISelKnownBits.cpp
-        CSEMIRBuilder.cpp
-        CallLowering.cpp
-        GlobalISel.cpp
-        Combiner.cpp
-        CombinerHelper.cpp
-        GISelChangeObserver.cpp
-        IRTranslator.cpp
-        InlineAsmLowering.cpp
-        InstructionSelect.cpp
-        InstructionSelector.cpp
-        LegalityPredicates.cpp
-        LegalizeMutations.cpp
-        Legalizer.cpp
-        LegalizerHelper.cpp
-        LegalizerInfo.cpp
-        Localizer.cpp
-        LostDebugLocObserver.cpp
-        MachineIRBuilder.cpp
-        RegBankSelect.cpp
-        RegisterBank.cpp
-        RegisterBankInfo.cpp
-        Utils.cpp
+  CSEInfo.cpp
+  GISelKnownBits.cpp
+  CSEMIRBuilder.cpp
+  CallLowering.cpp
+  GlobalISel.cpp
+  Combiner.cpp
+  CombinerHelper.cpp
+  GISelChangeObserver.cpp
+  IRTranslator.cpp
+  InlineAsmLowering.cpp
+  InstructionSelect.cpp
+  InstructionSelector.cpp
+  LegalityPredicates.cpp
+  LegalizeMutations.cpp
+  Legalizer.cpp
+  LegalizerHelper.cpp
+  LegalizerInfo.cpp
+  Localizer.cpp
+  LostDebugLocObserver.cpp
+  MachineIRBuilder.cpp
+  RegBankSelect.cpp
+  RegisterBank.cpp
+  RegisterBankInfo.cpp
+  Utils.cpp
 
-        ADDITIONAL_HEADER_DIRS
-        ${LLVM_MAIN_INCLUDE_DIR}/llvm/CodeGen/GlobalISel
+  ADDITIONAL_HEADER_DIRS
+  ${LLVM_MAIN_INCLUDE_DIR}/llvm/CodeGen/GlobalISel
 
-        DEPENDS
-        intrinsics_gen
+  DEPENDS
+  intrinsics_gen
+
+  LINK_COMPONENTS
+  Analysis
+  CodeGen
+  Core
+  MC
+  SelectionDAG
+  Support
+  Target
+  TransformUtils
   )

diff  --git a/llvm/lib/CodeGen/GlobalISel/LLVMBuild.txt b/llvm/lib/CodeGen/GlobalISel/LLVMBuild.txt
deleted file mode 100644
index 3d550b5332db..000000000000
--- a/llvm/lib/CodeGen/GlobalISel/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/CodeGen/GlobalISel/LLVMBuild.txt -----------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = GlobalISel
-parent = CodeGen
-required_libraries = Analysis CodeGen Core MC SelectionDAG Support Target TransformUtils

diff  --git a/llvm/lib/CodeGen/LLVMBuild.txt b/llvm/lib/CodeGen/LLVMBuild.txt
deleted file mode 100644
index 0a766fd7aca6..000000000000
--- a/llvm/lib/CodeGen/LLVMBuild.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-;===- ./lib/CodeGen/LLVMBuild.txt ------------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = AsmPrinter SelectionDAG MIRParser GlobalISel
-
-[component_0]
-type = Library
-name = CodeGen
-parent = Libraries
-required_libraries = Analysis BitReader BitWriter Core MC ProfileData Scalar Support Target TransformUtils

diff  --git a/llvm/lib/CodeGen/MIRParser/CMakeLists.txt b/llvm/lib/CodeGen/MIRParser/CMakeLists.txt
index cc31f39e030f..eba19e237b52 100644
--- a/llvm/lib/CodeGen/MIRParser/CMakeLists.txt
+++ b/llvm/lib/CodeGen/MIRParser/CMakeLists.txt
@@ -8,4 +8,13 @@ add_llvm_component_library(LLVMMIRParser
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  AsmParser
+  BinaryFormat
+  CodeGen
+  Core
+  MC
+  Support
+  Target
   )

diff  --git a/llvm/lib/CodeGen/MIRParser/LLVMBuild.txt b/llvm/lib/CodeGen/MIRParser/LLVMBuild.txt
deleted file mode 100644
index 3c3e2f99e4f8..000000000000
--- a/llvm/lib/CodeGen/MIRParser/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/CodeGen/MIRParser/LLVMBuild.txt --------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = MIRParser
-parent = CodeGen
-required_libraries = AsmParser BinaryFormat CodeGen Core MC Support Target

diff  --git a/llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt b/llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt
index 56caffe9f8ee..4d46583ed987 100644
--- a/llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt
+++ b/llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt
@@ -27,4 +27,13 @@ add_llvm_component_library(LLVMSelectionDAG
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  Analysis
+  CodeGen
+  Core
+  MC
+  Support
+  Target
+  TransformUtils
   )

diff  --git a/llvm/lib/CodeGen/SelectionDAG/LLVMBuild.txt b/llvm/lib/CodeGen/SelectionDAG/LLVMBuild.txt
deleted file mode 100644
index 81503d5967c8..000000000000
--- a/llvm/lib/CodeGen/SelectionDAG/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/CodeGen/SelectionDAG/LLVMBuild.txt -----------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = SelectionDAG
-parent = CodeGen
-required_libraries = Analysis CodeGen Core MC Support Target TransformUtils

diff  --git a/llvm/lib/DWARFLinker/CMakeLists.txt b/llvm/lib/DWARFLinker/CMakeLists.txt
index b7ec782eb105..f9e375b09000 100644
--- a/llvm/lib/DWARFLinker/CMakeLists.txt
+++ b/llvm/lib/DWARFLinker/CMakeLists.txt
@@ -9,4 +9,12 @@ add_llvm_component_library(LLVMDWARFLinker
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  DebugInfoDWARF
+  AsmPrinter
+  CodeGen
+  MC
+  Object
+  Support
   )

diff  --git a/llvm/lib/DWARFLinker/LLVMBuild.txt b/llvm/lib/DWARFLinker/LLVMBuild.txt
deleted file mode 100644
index b32ea3d9e741..000000000000
--- a/llvm/lib/DWARFLinker/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/DWARFLinker/LLVMBuild.txt ---------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = DWARFLinker
-parent = Libraries
-required_libraries = DebugInfoDWARF AsmPrinter CodeGen MC Object Support

diff  --git a/llvm/lib/DebugInfo/CodeView/CMakeLists.txt b/llvm/lib/DebugInfo/CodeView/CMakeLists.txt
index 84d1cf94e755..13baa5f5e5e4 100644
--- a/llvm/lib/DebugInfo/CodeView/CMakeLists.txt
+++ b/llvm/lib/DebugInfo/CodeView/CMakeLists.txt
@@ -42,4 +42,8 @@ add_llvm_component_library(LLVMDebugInfoCodeView
 
   ADDITIONAL_HEADER_DIRS
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/DebugInfo/CodeView
+
+  LINK_COMPONENTS
+  Support
+  DebugInfoMSF
   )

diff  --git a/llvm/lib/DebugInfo/CodeView/LLVMBuild.txt b/llvm/lib/DebugInfo/CodeView/LLVMBuild.txt
deleted file mode 100644
index c3696fd20a4b..000000000000
--- a/llvm/lib/DebugInfo/CodeView/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/DebugInfo/CodeView/LLVMBuild.txt -------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = DebugInfoCodeView
-parent = DebugInfo
-required_libraries = Support DebugInfoMSF

diff  --git a/llvm/lib/DebugInfo/DWARF/CMakeLists.txt b/llvm/lib/DebugInfo/DWARF/CMakeLists.txt
index 3fe9904f221b..4bcc0d5ad513 100644
--- a/llvm/lib/DebugInfo/DWARF/CMakeLists.txt
+++ b/llvm/lib/DebugInfo/DWARF/CMakeLists.txt
@@ -31,4 +31,10 @@ add_llvm_component_library(LLVMDebugInfoDWARF
   ADDITIONAL_HEADER_DIRS
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/DebugInfo/DWARF
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/DebugInfo
+
+  LINK_COMPONENTS
+  BinaryFormat
+  Object
+  MC
+  Support
   )

diff  --git a/llvm/lib/DebugInfo/DWARF/LLVMBuild.txt b/llvm/lib/DebugInfo/DWARF/LLVMBuild.txt
deleted file mode 100644
index 182be10f0b4c..000000000000
--- a/llvm/lib/DebugInfo/DWARF/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/DebugInfo/DWARF/LLVMBuild.txt ----------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = DebugInfoDWARF
-parent = DebugInfo
-required_libraries = BinaryFormat Object MC Support

diff  --git a/llvm/lib/DebugInfo/GSYM/CMakeLists.txt b/llvm/lib/DebugInfo/GSYM/CMakeLists.txt
index 90e56bd6f6da..148b34172b84 100644
--- a/llvm/lib/DebugInfo/GSYM/CMakeLists.txt
+++ b/llvm/lib/DebugInfo/GSYM/CMakeLists.txt
@@ -1,7 +1,3 @@
-set(LLVM_LINK_COMPONENTS
-  DebugInfoDWARF
-  )
-
 add_llvm_component_library(LLVMDebugInfoGSYM
   DwarfTransformer.cpp
   Header.cpp
@@ -21,4 +17,10 @@ add_llvm_component_library(LLVMDebugInfoGSYM
 
   DEPENDS
   LLVMMC
+
+  LINK_COMPONENTS
+  MC
+  Object
+  Support
+  DebugInfoDWARF
   )

diff  --git a/llvm/lib/DebugInfo/GSYM/LLVMBuild.txt b/llvm/lib/DebugInfo/GSYM/LLVMBuild.txt
deleted file mode 100644
index 36ba962d502e..000000000000
--- a/llvm/lib/DebugInfo/GSYM/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/DebugInfo/GSYM/LLVMBuild.txt ----------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = DebugInfoGSYM
-parent = DebugInfo
-required_libraries = MC Object Support DebugInfoDWARF

diff  --git a/llvm/lib/DebugInfo/LLVMBuild.txt b/llvm/lib/DebugInfo/LLVMBuild.txt
deleted file mode 100644
index ce11a76db001..000000000000
--- a/llvm/lib/DebugInfo/LLVMBuild.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-;===- ./lib/DebugInfo/LLVMBuild.txt ----------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = DWARF GSYM MSF CodeView PDB Symbolize
-
-[component_0]
-type = Group
-name = DebugInfo
-parent = $ROOT

diff  --git a/llvm/lib/DebugInfo/MSF/CMakeLists.txt b/llvm/lib/DebugInfo/MSF/CMakeLists.txt
index 828e2617f658..20daa3c21e62 100644
--- a/llvm/lib/DebugInfo/MSF/CMakeLists.txt
+++ b/llvm/lib/DebugInfo/MSF/CMakeLists.txt
@@ -5,4 +5,7 @@ add_llvm_component_library(LLVMDebugInfoMSF
   MSFError.cpp
   ADDITIONAL_HEADER_DIRS
   "${LLVM_MAIN_INCLUDE_DIR}/llvm/DebugInfo/MSF"
+
+  LINK_COMPONENTS
+  Support
   )

diff  --git a/llvm/lib/DebugInfo/MSF/LLVMBuild.txt b/llvm/lib/DebugInfo/MSF/LLVMBuild.txt
deleted file mode 100644
index ca492315080a..000000000000
--- a/llvm/lib/DebugInfo/MSF/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/DebugInfo/MSF/LLVMBuild.txt -------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = DebugInfoMSF
-parent = DebugInfo
-required_libraries = Support

diff  --git a/llvm/lib/DebugInfo/PDB/CMakeLists.txt b/llvm/lib/DebugInfo/PDB/CMakeLists.txt
index 21f8fa93acd5..4a0cb406f148 100644
--- a/llvm/lib/DebugInfo/PDB/CMakeLists.txt
+++ b/llvm/lib/DebugInfo/PDB/CMakeLists.txt
@@ -139,6 +139,13 @@ add_llvm_component_library(LLVMDebugInfoPDB
 
   ADDITIONAL_HEADER_DIRS
   ${LIBPDB_ADDITIONAL_HEADER_DIRS}
+
+  LINK_COMPONENTS
+  BinaryFormat
+  Object
+  Support
+  DebugInfoCodeView
+  DebugInfoMSF
   )
 
 target_link_libraries(LLVMDebugInfoPDB INTERFACE "${LIBPDB_ADDITIONAL_LIBRARIES}")

diff  --git a/llvm/lib/DebugInfo/PDB/LLVMBuild.txt b/llvm/lib/DebugInfo/PDB/LLVMBuild.txt
deleted file mode 100644
index 6cebd787054e..000000000000
--- a/llvm/lib/DebugInfo/PDB/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/DebugInfo/PDB/LLVMBuild.txt ------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = DebugInfoPDB
-parent = DebugInfo
-required_libraries = BinaryFormat Object Support DebugInfoCodeView DebugInfoMSF
-

diff  --git a/llvm/lib/DebugInfo/Symbolize/CMakeLists.txt b/llvm/lib/DebugInfo/Symbolize/CMakeLists.txt
index 79fbb14ed74d..acfb3bd0e1ad 100644
--- a/llvm/lib/DebugInfo/Symbolize/CMakeLists.txt
+++ b/llvm/lib/DebugInfo/Symbolize/CMakeLists.txt
@@ -5,4 +5,11 @@ add_llvm_component_library(LLVMSymbolize
 
   ADDITIONAL_HEADER_DIRS
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/DebugInfo/Symbolize
+
+  LINK_COMPONENTS
+  DebugInfoDWARF
+  DebugInfoPDB
+  Object
+  Support
+  Demangle
   )

diff  --git a/llvm/lib/DebugInfo/Symbolize/LLVMBuild.txt b/llvm/lib/DebugInfo/Symbolize/LLVMBuild.txt
deleted file mode 100644
index 70972ba9a825..000000000000
--- a/llvm/lib/DebugInfo/Symbolize/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/DebugInfo/Symbolize/LLVMBuild.txt ------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = Symbolize
-parent = DebugInfo
-required_libraries = DebugInfoDWARF DebugInfoPDB Object Support Demangle

diff  --git a/llvm/lib/Demangle/CMakeLists.txt b/llvm/lib/Demangle/CMakeLists.txt
index de208cd5d002..1368d911f028 100644
--- a/llvm/lib/Demangle/CMakeLists.txt
+++ b/llvm/lib/Demangle/CMakeLists.txt
@@ -6,4 +6,5 @@ add_llvm_component_library(LLVMDemangle
 
   ADDITIONAL_HEADER_DIRS
   "${LLVM_MAIN_INCLUDE_DIR}/llvm/Demangle"
+
 )

diff  --git a/llvm/lib/Demangle/LLVMBuild.txt b/llvm/lib/Demangle/LLVMBuild.txt
deleted file mode 100644
index 6fe47a21314a..000000000000
--- a/llvm/lib/Demangle/LLVMBuild.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-;===- ./lib/Support/LLVMBuild.txt ------------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = Demangle
-parent = Libraries

diff  --git a/llvm/lib/ExecutionEngine/CMakeLists.txt b/llvm/lib/ExecutionEngine/CMakeLists.txt
index a13fcc784e4b..22203da90f7a 100644
--- a/llvm/lib/ExecutionEngine/CMakeLists.txt
+++ b/llvm/lib/ExecutionEngine/CMakeLists.txt
@@ -12,6 +12,14 @@ add_llvm_component_library(LLVMExecutionEngine
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  Core
+  MC
+  Object
+  RuntimeDyld
+  Support
+  Target
   )
 
 if(BUILD_SHARED_LIBS)

diff  --git a/llvm/lib/ExecutionEngine/IntelJITEvents/CMakeLists.txt b/llvm/lib/ExecutionEngine/IntelJITEvents/CMakeLists.txt
index 70446e32a6d5..b56ec508b5a6 100644
--- a/llvm/lib/ExecutionEngine/IntelJITEvents/CMakeLists.txt
+++ b/llvm/lib/ExecutionEngine/IntelJITEvents/CMakeLists.txt
@@ -12,6 +12,14 @@ add_llvm_component_library(LLVMIntelJITEvents
   jitprofiling.c
 
   LINK_LIBS ${LLVM_INTEL_JIT_LIBS}
+
+  LINK_COMPONENTS
+  CodeGen
+  Core
+  DebugInfoDWARF
+  Support
+  Object
+  ExecutionEngine
 )
 
 add_dependencies(LLVMIntelJITEvents LLVMCodeGen)

diff  --git a/llvm/lib/ExecutionEngine/IntelJITEvents/LLVMBuild.txt b/llvm/lib/ExecutionEngine/IntelJITEvents/LLVMBuild.txt
deleted file mode 100644
index 2b1aa1b39152..000000000000
--- a/llvm/lib/ExecutionEngine/IntelJITEvents/LLVMBuild.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-;===- ./lib/ExecutionEngine/JITProfileAmplifier/LLVMBuild.txt --*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-
-[component_0]
-type = OptionalLibrary
-name = IntelJITEvents
-parent = ExecutionEngine
-required_libraries = CodeGen Core DebugInfoDWARF Support Object ExecutionEngine

diff  --git a/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt b/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt
index b8adea5b7a90..976219830d5e 100644
--- a/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt
+++ b/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt
@@ -13,6 +13,12 @@ add_llvm_component_library(LLVMInterpreter
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  CodeGen
+  Core
+  ExecutionEngine
+  Support
   )
 
 if( LLVM_ENABLE_FFI )

diff  --git a/llvm/lib/ExecutionEngine/Interpreter/LLVMBuild.txt b/llvm/lib/ExecutionEngine/Interpreter/LLVMBuild.txt
deleted file mode 100644
index 3debc32b0313..000000000000
--- a/llvm/lib/ExecutionEngine/Interpreter/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/ExecutionEngine/Interpreter/LLVMBuild.txt ----------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = Interpreter
-parent = ExecutionEngine
-required_libraries = CodeGen Core ExecutionEngine Support

diff  --git a/llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt b/llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt
index 20c53980b512..512e3523a1ea 100644
--- a/llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt
+++ b/llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt
@@ -17,6 +17,12 @@ add_llvm_component_library(LLVMJITLink
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  BinaryFormat
+  Object
+  OrcTargetProcess
+  Support
   )
  
 target_link_libraries(LLVMJITLink

diff  --git a/llvm/lib/ExecutionEngine/JITLink/LLVMBuild.txt b/llvm/lib/ExecutionEngine/JITLink/LLVMBuild.txt
deleted file mode 100644
index f73246beb224..000000000000
--- a/llvm/lib/ExecutionEngine/JITLink/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===----- ./lib/ExecutionEngine/JTILink/LLVMBuild.txt ----------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = JITLink
-parent = ExecutionEngine
-required_libraries = BinaryFormat Object OrcTargetProcess Support

diff  --git a/llvm/lib/ExecutionEngine/LLVMBuild.txt b/llvm/lib/ExecutionEngine/LLVMBuild.txt
deleted file mode 100644
index 13872da4a564..000000000000
--- a/llvm/lib/ExecutionEngine/LLVMBuild.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-;===- ./lib/ExecutionEngine/LLVMBuild.txt ----------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = Interpreter MCJIT JITLink RuntimeDyld IntelJITEvents
-                 OProfileJIT Orc PerfJITEvents
-
-[component_0]
-type = Library
-name = ExecutionEngine
-parent = Libraries
-required_libraries = Core MC Object RuntimeDyld Support Target

diff  --git a/llvm/lib/ExecutionEngine/MCJIT/CMakeLists.txt b/llvm/lib/ExecutionEngine/MCJIT/CMakeLists.txt
index 77066cac4d85..f7a4610e0500 100644
--- a/llvm/lib/ExecutionEngine/MCJIT/CMakeLists.txt
+++ b/llvm/lib/ExecutionEngine/MCJIT/CMakeLists.txt
@@ -3,4 +3,12 @@ add_llvm_component_library(LLVMMCJIT
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  Core
+  ExecutionEngine
+  Object
+  RuntimeDyld
+  Support
+  Target
   )

diff  --git a/llvm/lib/ExecutionEngine/MCJIT/LLVMBuild.txt b/llvm/lib/ExecutionEngine/MCJIT/LLVMBuild.txt
deleted file mode 100644
index a20b6d808dfc..000000000000
--- a/llvm/lib/ExecutionEngine/MCJIT/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/ExecutionEngine/MCJIT/LLVMBuild.txt ----------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = MCJIT
-parent = ExecutionEngine
-required_libraries = Core ExecutionEngine Object RuntimeDyld Support Target

diff  --git a/llvm/lib/ExecutionEngine/OProfileJIT/CMakeLists.txt b/llvm/lib/ExecutionEngine/OProfileJIT/CMakeLists.txt
index 9bbf2d61b1c8..8d37238221f9 100644
--- a/llvm/lib/ExecutionEngine/OProfileJIT/CMakeLists.txt
+++ b/llvm/lib/ExecutionEngine/OProfileJIT/CMakeLists.txt
@@ -4,4 +4,10 @@ include_directories( ${LLVM_OPROFILE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/.. )
 add_llvm_component_library(LLVMOProfileJIT
   OProfileJITEventListener.cpp
   OProfileWrapper.cpp
+
+  LINK_COMPONENTS
+  DebugInfoDWARF
+  Support
+  Object
+  ExecutionEngine
   )

diff  --git a/llvm/lib/ExecutionEngine/OProfileJIT/LLVMBuild.txt b/llvm/lib/ExecutionEngine/OProfileJIT/LLVMBuild.txt
deleted file mode 100644
index 9084fea3635a..000000000000
--- a/llvm/lib/ExecutionEngine/OProfileJIT/LLVMBuild.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-;===- ./lib/ExecutionEngine/OProfileJIT/LLVMBuild.txt ----------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-
-[component_0]
-type = OptionalLibrary
-name = OProfileJIT
-parent = ExecutionEngine
-required_libraries = DebugInfoDWARF Support Object ExecutionEngine

diff  --git a/llvm/lib/ExecutionEngine/Orc/CMakeLists.txt b/llvm/lib/ExecutionEngine/Orc/CMakeLists.txt
index 2ab410dbf578..791b037323f2 100644
--- a/llvm/lib/ExecutionEngine/Orc/CMakeLists.txt
+++ b/llvm/lib/ExecutionEngine/Orc/CMakeLists.txt
@@ -30,6 +30,20 @@ add_llvm_component_library(LLVMOrcJIT
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  Core
+  ExecutionEngine
+  JITLink
+  Object
+  OrcShared
+  OrcTargetProcess
+  MC
+  Passes
+  RuntimeDyld
+  Support
+  Target
+  TransformUtils
   )
 
 add_subdirectory(Shared)

diff  --git a/llvm/lib/ExecutionEngine/Orc/LLVMBuild.txt b/llvm/lib/ExecutionEngine/Orc/LLVMBuild.txt
deleted file mode 100644
index d46dc3b6afff..000000000000
--- a/llvm/lib/ExecutionEngine/Orc/LLVMBuild.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-;===- ./lib/ExecutionEngine/Orc/LLVMBuild.txt ----------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = Shared TargetProcess
-
-[component_0]
-type = Library
-name = OrcJIT
-parent = ExecutionEngine
-required_libraries = Core ExecutionEngine JITLink Object OrcShared
-                     OrcTargetProcess MC Passes RuntimeDyld Support Target
-                     TransformUtils

diff  --git a/llvm/lib/ExecutionEngine/Orc/Shared/CMakeLists.txt b/llvm/lib/ExecutionEngine/Orc/Shared/CMakeLists.txt
index 57c06d739ec7..808408c0e5df 100644
--- a/llvm/lib/ExecutionEngine/Orc/Shared/CMakeLists.txt
+++ b/llvm/lib/ExecutionEngine/Orc/Shared/CMakeLists.txt
@@ -4,4 +4,7 @@ add_llvm_component_library(LLVMOrcShared
   TargetProcessControlTypes.cpp
   ADDITIONAL_HEADER_DIRS
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/ExecutionEngine/Orc
+
+  LINK_COMPONENTS
+  Support
   )

diff  --git a/llvm/lib/ExecutionEngine/Orc/Shared/LLVMBuild.txt b/llvm/lib/ExecutionEngine/Orc/Shared/LLVMBuild.txt
deleted file mode 100644
index 68f2ab08c9ca..000000000000
--- a/llvm/lib/ExecutionEngine/Orc/Shared/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/ExecutionEngine/Orc/Shared/LLVMBuild.txt ------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = OrcShared
-parent = OrcJIT
-required_libraries = Support

diff  --git a/llvm/lib/ExecutionEngine/Orc/TargetProcess/CMakeLists.txt b/llvm/lib/ExecutionEngine/Orc/TargetProcess/CMakeLists.txt
index b561ce232ce4..4eb05300bce9 100644
--- a/llvm/lib/ExecutionEngine/Orc/TargetProcess/CMakeLists.txt
+++ b/llvm/lib/ExecutionEngine/Orc/TargetProcess/CMakeLists.txt
@@ -1,6 +1,11 @@
 add_llvm_component_library(LLVMOrcTargetProcess
   RegisterEHFrames.cpp
   TargetExecutionUtils.cpp
+
   ADDITIONAL_HEADER_DIRS
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/ExecutionEngine/Orc
+
+  LINK_COMPONENTS
+  OrcShared
+  Support
   )

diff  --git a/llvm/lib/ExecutionEngine/PerfJITEvents/CMakeLists.txt b/llvm/lib/ExecutionEngine/PerfJITEvents/CMakeLists.txt
index e0b8200f1197..52793fbe7487 100644
--- a/llvm/lib/ExecutionEngine/PerfJITEvents/CMakeLists.txt
+++ b/llvm/lib/ExecutionEngine/PerfJITEvents/CMakeLists.txt
@@ -1,5 +1,13 @@
 add_llvm_component_library(LLVMPerfJITEvents
   PerfJITEventListener.cpp
+
+  LINK_COMPONENTS
+  CodeGen
+  Core
+  DebugInfoDWARF
+  ExecutionEngine
+  Object
+  Support
   )
 
 add_dependencies(LLVMPerfJITEvents LLVMCodeGen)

diff  --git a/llvm/lib/ExecutionEngine/PerfJITEvents/LLVMBuild.txt b/llvm/lib/ExecutionEngine/PerfJITEvents/LLVMBuild.txt
deleted file mode 100644
index c83bfa852dcd..000000000000
--- a/llvm/lib/ExecutionEngine/PerfJITEvents/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/ExecutionEngine/PerfJITEvents/LLVMBuild.txt ----------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = OptionalLibrary
-name = PerfJITEvents
-parent = ExecutionEngine
-required_libraries = CodeGen Core DebugInfoDWARF ExecutionEngine Object Support

diff  --git a/llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt b/llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt
index 86a6dba12e2d..187858bc7632 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt
@@ -10,4 +10,11 @@ add_llvm_component_library(LLVMRuntimeDyld
 
   DEPENDS
   intrinsics_gen
+
+
+  LINK_COMPONENTS
+  Core
+  MC
+  Object
+  Support
   )

diff  --git a/llvm/lib/ExecutionEngine/RuntimeDyld/LLVMBuild.txt b/llvm/lib/ExecutionEngine/RuntimeDyld/LLVMBuild.txt
deleted file mode 100644
index dc95110cddc7..000000000000
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/ExecutionEngine/RuntimeDyld/LLVMBuild.txt ----------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = RuntimeDyld
-parent = ExecutionEngine
-required_libraries = Core MC Object Support

diff  --git a/llvm/lib/Extensions/CMakeLists.txt b/llvm/lib/Extensions/CMakeLists.txt
index 701e9c4c0baf..c1007dfcde58 100644
--- a/llvm/lib/Extensions/CMakeLists.txt
+++ b/llvm/lib/Extensions/CMakeLists.txt
@@ -1,3 +1,6 @@
 add_llvm_component_library(LLVMExtensions
-    Extensions.cpp
+  Extensions.cpp
+
+  LINK_COMPONENTS
+  Support
 )

diff  --git a/llvm/lib/Extensions/LLVMBuild.txt b/llvm/lib/Extensions/LLVMBuild.txt
deleted file mode 100644
index 7a98c8f68051..000000000000
--- a/llvm/lib/Extensions/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/Extensions/LLVMBuild.txt -------------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = Extensions
-parent = Libraries
-required_libraries = Support

diff  --git a/llvm/lib/Frontend/LLVMBuild.txt b/llvm/lib/Frontend/LLVMBuild.txt
deleted file mode 100644
index 78ec6ae5186c..000000000000
--- a/llvm/lib/Frontend/LLVMBuild.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-;===- ./lib/Frontend/LLVMBuild.txt -----------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = OpenMP
-
-[component_0]
-type = Group
-name = Frontend
-parent = Libraries

diff  --git a/llvm/lib/Frontend/OpenMP/CMakeLists.txt b/llvm/lib/Frontend/OpenMP/CMakeLists.txt
index 068283fd82e0..cc5d3a766870 100644
--- a/llvm/lib/Frontend/OpenMP/CMakeLists.txt
+++ b/llvm/lib/Frontend/OpenMP/CMakeLists.txt
@@ -15,4 +15,9 @@ add_llvm_component_library(LLVMFrontendOpenMP
   intrinsics_gen
   omp_gen
   omp_cpp
+
+  LINK_COMPONENTS
+  Core
+  Support
+  TransformUtils
   )

diff  --git a/llvm/lib/Frontend/OpenMP/LLVMBuild.txt b/llvm/lib/Frontend/OpenMP/LLVMBuild.txt
deleted file mode 100644
index dfabe72fcd2f..000000000000
--- a/llvm/lib/Frontend/OpenMP/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/Frontend/OpenMP/LLVMBuild.txt ----------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = FrontendOpenMP
-parent = Frontend
-required_libraries = Core Support TransformUtils

diff  --git a/llvm/lib/FuzzMutate/CMakeLists.txt b/llvm/lib/FuzzMutate/CMakeLists.txt
index 356d5cef1957..47ddeb5e1d2a 100644
--- a/llvm/lib/FuzzMutate/CMakeLists.txt
+++ b/llvm/lib/FuzzMutate/CMakeLists.txt
@@ -10,4 +10,13 @@ add_llvm_component_library(LLVMFuzzMutate
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  Analysis
+  BitReader
+  BitWriter
+  Core
+  Scalar
+  Support
+  Target
   )

diff  --git a/llvm/lib/FuzzMutate/LLVMBuild.txt b/llvm/lib/FuzzMutate/LLVMBuild.txt
deleted file mode 100644
index 4430be4ee065..000000000000
--- a/llvm/lib/FuzzMutate/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/FuzzMutate/LLVMBuild.txt ---------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = FuzzMutate
-parent = Libraries
-required_libraries = Analysis BitReader BitWriter Core Scalar Support Target

diff  --git a/llvm/lib/IR/CMakeLists.txt b/llvm/lib/IR/CMakeLists.txt
index 49805d5b8c27..0bba18e90bbc 100644
--- a/llvm/lib/IR/CMakeLists.txt
+++ b/llvm/lib/IR/CMakeLists.txt
@@ -59,8 +59,14 @@ add_llvm_component_library(LLVMCore
   ADDITIONAL_HEADER_DIRS
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/IR
 
-  LINK_LIBS ${LLVM_PTHREAD_LIB}
+  LINK_LIBS
+  ${LLVM_PTHREAD_LIB}
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  BinaryFormat
+  Remarks
+  Support
   )

diff  --git a/llvm/lib/IR/LLVMBuild.txt b/llvm/lib/IR/LLVMBuild.txt
deleted file mode 100644
index 73d97108c400..000000000000
--- a/llvm/lib/IR/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/IR/LLVMBuild.txt -----------------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = Core
-parent = Libraries
-required_libraries = BinaryFormat Remarks Support

diff  --git a/llvm/lib/IRReader/CMakeLists.txt b/llvm/lib/IRReader/CMakeLists.txt
index b4ef18785c8b..256d65c9f939 100644
--- a/llvm/lib/IRReader/CMakeLists.txt
+++ b/llvm/lib/IRReader/CMakeLists.txt
@@ -6,4 +6,10 @@ add_llvm_component_library(LLVMIRReader
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  AsmParser
+  BitReader
+  Core
+  Support
   )

diff  --git a/llvm/lib/IRReader/LLVMBuild.txt b/llvm/lib/IRReader/LLVMBuild.txt
deleted file mode 100644
index 1e5fc7636396..000000000000
--- a/llvm/lib/IRReader/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/IRReader/LLVMBuild.txt -----------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = IRReader
-parent = Libraries
-required_libraries = AsmParser BitReader Core Support

diff  --git a/llvm/lib/InterfaceStub/CMakeLists.txt b/llvm/lib/InterfaceStub/CMakeLists.txt
index af702e58479a..4aacebf16cf9 100644
--- a/llvm/lib/InterfaceStub/CMakeLists.txt
+++ b/llvm/lib/InterfaceStub/CMakeLists.txt
@@ -2,4 +2,8 @@ add_llvm_component_library(LLVMInterfaceStub
   ELFObjHandler.cpp
   ELFStub.cpp
   TBEHandler.cpp
+
+  LINK_COMPONENTS
+  Object
+  Support
 )

diff  --git a/llvm/lib/InterfaceStub/LLVMBuild.txt b/llvm/lib/InterfaceStub/LLVMBuild.txt
deleted file mode 100644
index e69544d4f5f6..000000000000
--- a/llvm/lib/InterfaceStub/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/InterfaceStub/LLVMBuild.txt ------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = InterfaceStub
-parent = Libraries
-required_libraries = Object Support

diff  --git a/llvm/lib/LLVMBuild.txt b/llvm/lib/LLVMBuild.txt
deleted file mode 100644
index a81c6a1fe3fa..000000000000
--- a/llvm/lib/LLVMBuild.txt
+++ /dev/null
@@ -1,59 +0,0 @@
-;===- ./lib/LLVMBuild.txt --------------------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories =
- Analysis
- AsmParser
- Bitcode
- Bitstream
- CodeGen
- DebugInfo
- Demangle
- DWARFLinker
- ExecutionEngine
- Extensions
- Frontend
- FuzzMutate
- LineEditor
- Linker
- InterfaceStub
- IR
- IRReader
- LTO
- MC
- MCA
- Object
- BinaryFormat
- ObjectYAML
- Option
- Remarks
- Passes
- ProfileData
- Support
- TableGen
- TextAPI
- Target
- Testing
- ToolDrivers
- Transforms
- WindowsManifest
- XRay
-
-[component_0]
-type = Group
-name = Libraries
-parent = $ROOT

diff  --git a/llvm/lib/LTO/CMakeLists.txt b/llvm/lib/LTO/CMakeLists.txt
index 55f1a5a85fa5..e6adfd43e7f9 100644
--- a/llvm/lib/LTO/CMakeLists.txt
+++ b/llvm/lib/LTO/CMakeLists.txt
@@ -13,4 +13,26 @@ add_llvm_component_library(LLVMLTO
   DEPENDS
   intrinsics_gen
   llvm_vcsrevision_h
+
+  LINK_COMPONENTS
+  AggressiveInstCombine
+  Analysis
+  BinaryFormat
+  BitReader
+  BitWriter
+  CodeGen
+  Core
+  Extensions
+  IPO
+  InstCombine
+  Linker
+  MC
+  ObjCARC
+  Object
+  Passes
+  Remarks
+  Scalar
+  Support
+  Target
+  TransformUtils
 )

diff  --git a/llvm/lib/LTO/LLVMBuild.txt b/llvm/lib/LTO/LLVMBuild.txt
deleted file mode 100644
index 7c9cf16ddd0e..000000000000
--- a/llvm/lib/LTO/LLVMBuild.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-;===- ./lib/LTO/LLVMBuild.txt ----------------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = LTO
-parent = Libraries
-required_libraries =
- AggressiveInstCombine
- Analysis
- BinaryFormat
- BitReader
- BitWriter
- CodeGen
- Core
- Extensions
- IPO
- InstCombine
- Linker
- MC
- ObjCARC
- Object
- Passes
- Remarks
- Scalar
- Support
- Target
- TransformUtils

diff  --git a/llvm/lib/LineEditor/CMakeLists.txt b/llvm/lib/LineEditor/CMakeLists.txt
index 591903794063..61328f76905a 100644
--- a/llvm/lib/LineEditor/CMakeLists.txt
+++ b/llvm/lib/LineEditor/CMakeLists.txt
@@ -10,4 +10,7 @@ add_llvm_component_library(LLVMLineEditor
 
   LINK_LIBS
   ${link_libs}
+
+  LINK_COMPONENTS
+  Support
   )

diff  --git a/llvm/lib/LineEditor/LLVMBuild.txt b/llvm/lib/LineEditor/LLVMBuild.txt
deleted file mode 100644
index 55f9675efcb4..000000000000
--- a/llvm/lib/LineEditor/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/LineEditor/LLVMBuild.txt ---------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = LineEditor
-parent = Libraries
-required_libraries = Support

diff  --git a/llvm/lib/Linker/CMakeLists.txt b/llvm/lib/Linker/CMakeLists.txt
index be9d4b9774db..5abfc8c02efa 100644
--- a/llvm/lib/Linker/CMakeLists.txt
+++ b/llvm/lib/Linker/CMakeLists.txt
@@ -7,4 +7,9 @@ add_llvm_component_library(LLVMLinker
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  Core
+  Support
+  TransformUtils
   )

diff  --git a/llvm/lib/Linker/LLVMBuild.txt b/llvm/lib/Linker/LLVMBuild.txt
deleted file mode 100644
index a642af828b6e..000000000000
--- a/llvm/lib/Linker/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/Linker/LLVMBuild.txt -------------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = Linker
-parent = Libraries
-required_libraries = Core Support TransformUtils

diff  --git a/llvm/lib/MC/CMakeLists.txt b/llvm/lib/MC/CMakeLists.txt
index 9dca8d793395..38a6696d92b9 100644
--- a/llvm/lib/MC/CMakeLists.txt
+++ b/llvm/lib/MC/CMakeLists.txt
@@ -64,6 +64,11 @@ add_llvm_component_library(LLVMMC
 
   ADDITIONAL_HEADER_DIRS
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/MC
+
+  LINK_COMPONENTS
+  Support
+  BinaryFormat
+  DebugInfoCodeView
   )
 
 add_subdirectory(MCParser)

diff  --git a/llvm/lib/MC/LLVMBuild.txt b/llvm/lib/MC/LLVMBuild.txt
deleted file mode 100644
index 61911e5106c6..000000000000
--- a/llvm/lib/MC/LLVMBuild.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-;===- ./lib/MC/LLVMBuild.txt -----------------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = MCDisassembler MCParser
-
-[component_0]
-type = Library
-name = MC
-parent = Libraries
-required_libraries = Support BinaryFormat DebugInfoCodeView

diff  --git a/llvm/lib/MC/MCDisassembler/CMakeLists.txt b/llvm/lib/MC/MCDisassembler/CMakeLists.txt
index b6fd86015deb..c6fa8de00957 100644
--- a/llvm/lib/MC/MCDisassembler/CMakeLists.txt
+++ b/llvm/lib/MC/MCDisassembler/CMakeLists.txt
@@ -4,4 +4,8 @@ add_llvm_component_library(LLVMMCDisassembler
   MCExternalSymbolizer.cpp
   MCRelocationInfo.cpp
   MCSymbolizer.cpp
+
+  LINK_COMPONENTS
+  MC
+  Support
   )

diff  --git a/llvm/lib/MC/MCDisassembler/LLVMBuild.txt b/llvm/lib/MC/MCDisassembler/LLVMBuild.txt
deleted file mode 100644
index a3640c74b9e4..000000000000
--- a/llvm/lib/MC/MCDisassembler/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/MC/MCDisassembler/LLVMBuild.txt --------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = MCDisassembler
-parent = MC
-required_libraries = MC Support

diff  --git a/llvm/lib/MC/MCParser/CMakeLists.txt b/llvm/lib/MC/MCParser/CMakeLists.txt
index 9165457c69b3..6f76f368a969 100644
--- a/llvm/lib/MC/MCParser/CMakeLists.txt
+++ b/llvm/lib/MC/MCParser/CMakeLists.txt
@@ -14,4 +14,8 @@ add_llvm_component_library(LLVMMCParser
 
   ADDITIONAL_HEADER_DIRS
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/MC/MCParser
+
+  LINK_COMPONENTS
+  MC
+  Support
   )

diff  --git a/llvm/lib/MC/MCParser/LLVMBuild.txt b/llvm/lib/MC/MCParser/LLVMBuild.txt
deleted file mode 100644
index 52b0d6c4a509..000000000000
--- a/llvm/lib/MC/MCParser/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/MC/MCParser/LLVMBuild.txt --------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = MCParser
-parent = MC
-required_libraries = MC Support

diff  --git a/llvm/lib/MCA/CMakeLists.txt b/llvm/lib/MCA/CMakeLists.txt
index ed431cde6afc..c19b08ea5c74 100644
--- a/llvm/lib/MCA/CMakeLists.txt
+++ b/llvm/lib/MCA/CMakeLists.txt
@@ -22,4 +22,8 @@ add_llvm_component_library(LLVMMCA
 
   ADDITIONAL_HEADER_DIRS
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/MCA
+
+  LINK_COMPONENTS
+  MC
+  Support
   )

diff  --git a/llvm/lib/MCA/LLVMBuild.txt b/llvm/lib/MCA/LLVMBuild.txt
deleted file mode 100644
index ccbd3a2ae7c5..000000000000
--- a/llvm/lib/MCA/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-mca/lib/LLVMBuild.txt -----------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = MCA
-parent = Libraries
-required_libraries = MC Support

diff  --git a/llvm/lib/Object/CMakeLists.txt b/llvm/lib/Object/CMakeLists.txt
index 9f912ccdff1f..5b98ee4e59c8 100644
--- a/llvm/lib/Object/CMakeLists.txt
+++ b/llvm/lib/Object/CMakeLists.txt
@@ -35,4 +35,13 @@ add_llvm_component_library(LLVMObject
   DEPENDS
   intrinsics_gen
   llvm_vcsrevision_h
+
+  LINK_COMPONENTS
+  BitReader
+  Core
+  MC
+  BinaryFormat
+  MCParser
+  Support
+  TextAPI
   )

diff  --git a/llvm/lib/Object/LLVMBuild.txt b/llvm/lib/Object/LLVMBuild.txt
deleted file mode 100644
index dd30496e7fcb..000000000000
--- a/llvm/lib/Object/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/Object/LLVMBuild.txt -------------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = Object
-parent = Libraries
-required_libraries = BitReader Core MC BinaryFormat MCParser Support TextAPI

diff  --git a/llvm/lib/ObjectYAML/CMakeLists.txt b/llvm/lib/ObjectYAML/CMakeLists.txt
index a024fa96535e..ee241f86d25b 100644
--- a/llvm/lib/ObjectYAML/CMakeLists.txt
+++ b/llvm/lib/ObjectYAML/CMakeLists.txt
@@ -24,4 +24,11 @@ add_llvm_component_library(LLVMObjectYAML
 
   ADDITIONAL_HEADER_DIRS
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/ObjectYAML
+
+  LINK_COMPONENTS
+  BinaryFormat
+  Object
+  Support
+  DebugInfoCodeView
+  MC
   )

diff  --git a/llvm/lib/ObjectYAML/LLVMBuild.txt b/llvm/lib/ObjectYAML/LLVMBuild.txt
deleted file mode 100644
index 94a830b3c447..000000000000
--- a/llvm/lib/ObjectYAML/LLVMBuild.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-;===------------------------------------------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = ObjectYAML
-parent = Libraries
-required_libraries = BinaryFormat Object Support DebugInfoCodeView MC

diff  --git a/llvm/lib/Option/CMakeLists.txt b/llvm/lib/Option/CMakeLists.txt
index 258dd9a5d6fe..dc7669c52111 100644
--- a/llvm/lib/Option/CMakeLists.txt
+++ b/llvm/lib/Option/CMakeLists.txt
@@ -6,4 +6,7 @@ add_llvm_component_library(LLVMOption
 
   ADDITIONAL_HEADER_DIRS
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/Option
+
+  LINK_COMPONENTS
+  Support
   )

diff  --git a/llvm/lib/Option/LLVMBuild.txt b/llvm/lib/Option/LLVMBuild.txt
deleted file mode 100644
index 3443492e661b..000000000000
--- a/llvm/lib/Option/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/Option/LLVMBuild.txt -------------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = Option
-parent = Libraries
-required_libraries = Support

diff  --git a/llvm/lib/Passes/CMakeLists.txt b/llvm/lib/Passes/CMakeLists.txt
index 35fde7ba4e28..d834c0db4b45 100644
--- a/llvm/lib/Passes/CMakeLists.txt
+++ b/llvm/lib/Passes/CMakeLists.txt
@@ -9,4 +9,20 @@ add_llvm_component_library(LLVMPasses
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  AggressiveInstCombine
+  Analysis
+  Core
+  Coroutines
+  HelloNew
+  IPO
+  InstCombine
+  ObjCARC
+  Scalar
+  Support
+  Target
+  TransformUtils
+  Vectorize
+  Instrumentation
   )

diff  --git a/llvm/lib/Passes/LLVMBuild.txt b/llvm/lib/Passes/LLVMBuild.txt
deleted file mode 100644
index f49f7828d2b9..000000000000
--- a/llvm/lib/Passes/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/Passes/LLVMBuild.txt -------------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = Passes
-parent = Libraries
-required_libraries = AggressiveInstCombine Analysis Core Coroutines HelloNew IPO InstCombine ObjCARC Scalar Support Target TransformUtils Vectorize Instrumentation

diff  --git a/llvm/lib/ProfileData/CMakeLists.txt b/llvm/lib/ProfileData/CMakeLists.txt
index 93eff295f337..2a377e4d74d3 100644
--- a/llvm/lib/ProfileData/CMakeLists.txt
+++ b/llvm/lib/ProfileData/CMakeLists.txt
@@ -13,6 +13,11 @@ add_llvm_component_library(LLVMProfileData
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  Core
+  Support
+  Demangle
   )
 
 add_subdirectory(Coverage)

diff  --git a/llvm/lib/ProfileData/Coverage/CMakeLists.txt b/llvm/lib/ProfileData/Coverage/CMakeLists.txt
index db2f87c886b5..701b96378667 100644
--- a/llvm/lib/ProfileData/Coverage/CMakeLists.txt
+++ b/llvm/lib/ProfileData/Coverage/CMakeLists.txt
@@ -8,4 +8,10 @@ add_llvm_component_library(LLVMCoverage
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  Core
+  Object
+  ProfileData
+  Support
   )

diff  --git a/llvm/lib/ProfileData/Coverage/LLVMBuild.txt b/llvm/lib/ProfileData/Coverage/LLVMBuild.txt
deleted file mode 100644
index 21a9bf0b8737..000000000000
--- a/llvm/lib/ProfileData/Coverage/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/ProfileData/Coverage/LLVMBuild.txt -----------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = Coverage
-parent = ProfileData
-required_libraries = Core Object ProfileData Support
-

diff  --git a/llvm/lib/ProfileData/LLVMBuild.txt b/llvm/lib/ProfileData/LLVMBuild.txt
deleted file mode 100644
index 2fffab24579b..000000000000
--- a/llvm/lib/ProfileData/LLVMBuild.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-;===- ./lib/ProfileData/LLVMBuild.txt --------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = Coverage
-
-[component_0]
-type = Library
-name = ProfileData
-parent = Libraries
-required_libraries = Core Support Demangle

diff  --git a/llvm/lib/Remarks/CMakeLists.txt b/llvm/lib/Remarks/CMakeLists.txt
index ec49e77a5268..dd317ee08323 100644
--- a/llvm/lib/Remarks/CMakeLists.txt
+++ b/llvm/lib/Remarks/CMakeLists.txt
@@ -13,4 +13,8 @@ add_llvm_component_library(LLVMRemarks
 
   ADDITIONAL_HEADER_DIRS
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/Remarks
+
+  LINK_COMPONENTS
+  BitstreamReader
+  Support
 )

diff  --git a/llvm/lib/Remarks/LLVMBuild.txt b/llvm/lib/Remarks/LLVMBuild.txt
deleted file mode 100644
index 2df709b428db..000000000000
--- a/llvm/lib/Remarks/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/Remarks/LLVMBuild.txt ------------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = Remarks
-parent = Libraries
-required_libraries = BitstreamReader Support

diff  --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt
index 24b0fc715cd9..337d07d0a9dc 100644
--- a/llvm/lib/Support/CMakeLists.txt
+++ b/llvm/lib/Support/CMakeLists.txt
@@ -222,7 +222,12 @@ add_llvm_component_library(LLVMSupport
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/ADT
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/Support
   ${Backtrace_INCLUDE_DIRS}
-  LINK_LIBS ${system_libs} ${imported_libs} ${delayload_flags}
+
+  LINK_LIBS
+  ${system_libs} ${imported_libs} ${delayload_flags}
+
+  LINK_COMPONENTS
+  Demangle
   )
 
 set(llvm_system_libs ${system_libs})

diff  --git a/llvm/lib/Support/LLVMBuild.txt b/llvm/lib/Support/LLVMBuild.txt
deleted file mode 100644
index 0fa389be0707..000000000000
--- a/llvm/lib/Support/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/Support/LLVMBuild.txt ------------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = Support
-parent = Libraries
-required_libraries = Demangle

diff  --git a/llvm/lib/TableGen/CMakeLists.txt b/llvm/lib/TableGen/CMakeLists.txt
index c8ccbe85e36c..a73e6aec0165 100644
--- a/llvm/lib/TableGen/CMakeLists.txt
+++ b/llvm/lib/TableGen/CMakeLists.txt
@@ -13,4 +13,7 @@ add_llvm_component_library(LLVMTableGen
 
   ADDITIONAL_HEADER_DIRS
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/TableGen
+
+  LINK_COMPONENTS
+  Support
   )

diff  --git a/llvm/lib/TableGen/LLVMBuild.txt b/llvm/lib/TableGen/LLVMBuild.txt
deleted file mode 100644
index 99a8b8349f3c..000000000000
--- a/llvm/lib/TableGen/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/TableGen/LLVMBuild.txt -----------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = TableGen
-parent = Libraries
-required_libraries = Support

diff  --git a/llvm/lib/Target/AArch64/AsmParser/CMakeLists.txt b/llvm/lib/Target/AArch64/AsmParser/CMakeLists.txt
index d4e9d89449f6..14e0c22c45b9 100644
--- a/llvm/lib/Target/AArch64/AsmParser/CMakeLists.txt
+++ b/llvm/lib/Target/AArch64/AsmParser/CMakeLists.txt
@@ -2,5 +2,16 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/
 
 add_llvm_component_library(LLVMAArch64AsmParser
   AArch64AsmParser.cpp
+
+  LINK_COMPONENTS
+  AArch64Desc
+  AArch64Info
+  AArch64Utils
+  MC
+  MCParser
+  Support
+
+  ADD_TO_COMPONENT
+  AArch64
   )
 

diff  --git a/llvm/lib/Target/AArch64/AsmParser/LLVMBuild.txt b/llvm/lib/Target/AArch64/AsmParser/LLVMBuild.txt
deleted file mode 100644
index d98c05c959bd..000000000000
--- a/llvm/lib/Target/AArch64/AsmParser/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/AArch64/AsmParser/LLVMBuild.txt ---------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = AArch64AsmParser
-parent = AArch64
-required_libraries = AArch64Desc AArch64Info AArch64Utils MC MCParser Support
-add_to_library_groups = AArch64

diff  --git a/llvm/lib/Target/AArch64/CMakeLists.txt b/llvm/lib/Target/AArch64/CMakeLists.txt
index ce3cadc7cba1..0e9503baf180 100644
--- a/llvm/lib/Target/AArch64/CMakeLists.txt
+++ b/llvm/lib/Target/AArch64/CMakeLists.txt
@@ -1,3 +1,5 @@
+add_llvm_component_group(AArch64 HAS_JIT)
+
 set(LLVM_TARGET_DEFINITIONS AArch64.td)
 
 tablegen(LLVM AArch64GenAsmMatcher.inc -gen-asm-matcher)
@@ -78,6 +80,26 @@ add_llvm_target(AArch64CodeGen
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  AArch64Desc
+  AArch64Info
+  AArch64Utils
+  Analysis
+  AsmPrinter
+  CodeGen
+  Core
+  MC
+  Scalar
+  SelectionDAG
+  Support
+  Target
+  TransformUtils
+  GlobalISel
+  CFGuard
+
+  ADD_TO_COMPONENT
+  AArch64
 )
 
 add_subdirectory(AsmParser)

diff  --git a/llvm/lib/Target/AArch64/Disassembler/CMakeLists.txt b/llvm/lib/Target/AArch64/Disassembler/CMakeLists.txt
index 3a307f989ddc..62ea7264610a 100644
--- a/llvm/lib/Target/AArch64/Disassembler/CMakeLists.txt
+++ b/llvm/lib/Target/AArch64/Disassembler/CMakeLists.txt
@@ -3,6 +3,17 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/
 add_llvm_component_library(LLVMAArch64Disassembler
   AArch64Disassembler.cpp
   AArch64ExternalSymbolizer.cpp
+
+  LINK_COMPONENTS
+  AArch64Desc
+  AArch64Info
+  AArch64Utils
+  MC
+  MCDisassembler
+  Support
+
+  ADD_TO_COMPONENT
+  AArch64
   )
 
 add_dependencies(LLVMAArch64Disassembler AArch64CommonTableGen)

diff  --git a/llvm/lib/Target/AArch64/Disassembler/LLVMBuild.txt b/llvm/lib/Target/AArch64/Disassembler/LLVMBuild.txt
deleted file mode 100644
index aefa0aa728e0..000000000000
--- a/llvm/lib/Target/AArch64/Disassembler/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/AArch64/Disassembler/LLVMBuild.txt ------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = AArch64Disassembler
-parent = AArch64
-required_libraries = AArch64Desc AArch64Info AArch64Utils MC MCDisassembler Support
-add_to_library_groups = AArch64

diff  --git a/llvm/lib/Target/AArch64/LLVMBuild.txt b/llvm/lib/Target/AArch64/LLVMBuild.txt
deleted file mode 100644
index 08ff46454519..000000000000
--- a/llvm/lib/Target/AArch64/LLVMBuild.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-;===- ./lib/Target/AArch64/LLVMBuild.txt -------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = AsmParser Disassembler MCTargetDesc TargetInfo Utils
-
-[component_0]
-type = TargetGroup
-name = AArch64
-parent = Target
-has_asmparser = 1
-has_asmprinter = 1
-has_disassembler = 1
-has_jit = 1
-
-[component_1]
-type = Library
-name = AArch64CodeGen
-parent = AArch64
-required_libraries = AArch64Desc AArch64Info AArch64Utils Analysis AsmPrinter CodeGen Core MC Scalar SelectionDAG Support Target TransformUtils GlobalISel CFGuard
-add_to_library_groups = AArch64

diff  --git a/llvm/lib/Target/AArch64/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/AArch64/MCTargetDesc/CMakeLists.txt
index 099e69469c5c..1e97e6da7de9 100644
--- a/llvm/lib/Target/AArch64/MCTargetDesc/CMakeLists.txt
+++ b/llvm/lib/Target/AArch64/MCTargetDesc/CMakeLists.txt
@@ -11,6 +11,16 @@ add_llvm_component_library(LLVMAArch64Desc
   AArch64TargetStreamer.cpp
   AArch64WinCOFFObjectWriter.cpp
   AArch64WinCOFFStreamer.cpp
+
+  LINK_COMPONENTS
+  AArch64Info
+  AArch64Utils
+  MC
+  BinaryFormat
+  Support
+
+  ADD_TO_COMPONENT
+  AArch64
 )
 add_dependencies(LLVMAArch64Desc AArch64CommonTableGen)
 

diff  --git a/llvm/lib/Target/AArch64/MCTargetDesc/LLVMBuild.txt b/llvm/lib/Target/AArch64/MCTargetDesc/LLVMBuild.txt
deleted file mode 100644
index 81eb8be87b4e..000000000000
--- a/llvm/lib/Target/AArch64/MCTargetDesc/LLVMBuild.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-;===- ./lib/Target/AArch64/MCTargetDesc/LLVMBuild.txt ------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = AArch64Desc
-parent = AArch64
-required_libraries = AArch64Info AArch64Utils MC BinaryFormat Support
-add_to_library_groups = AArch64
-

diff  --git a/llvm/lib/Target/AArch64/TargetInfo/CMakeLists.txt b/llvm/lib/Target/AArch64/TargetInfo/CMakeLists.txt
index e1c23987f7f2..8adf3ef5d27f 100644
--- a/llvm/lib/Target/AArch64/TargetInfo/CMakeLists.txt
+++ b/llvm/lib/Target/AArch64/TargetInfo/CMakeLists.txt
@@ -2,6 +2,12 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/
 
 add_llvm_component_library(LLVMAArch64Info
   AArch64TargetInfo.cpp
+
+  LINK_COMPONENTS
+  Support
+
+  ADD_TO_COMPONENT
+  AArch64
   )
 
 add_dependencies(LLVMAArch64Info AArch64CommonTableGen)

diff  --git a/llvm/lib/Target/AArch64/TargetInfo/LLVMBuild.txt b/llvm/lib/Target/AArch64/TargetInfo/LLVMBuild.txt
deleted file mode 100644
index 31114a136a9a..000000000000
--- a/llvm/lib/Target/AArch64/TargetInfo/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/AArch64/TargetInfo/LLVMBuild.txt --------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = AArch64Info
-parent = AArch64
-required_libraries = Support
-add_to_library_groups = AArch64

diff  --git a/llvm/lib/Target/AArch64/Utils/CMakeLists.txt b/llvm/lib/Target/AArch64/Utils/CMakeLists.txt
index 5897f9da367d..33b15cc55884 100644
--- a/llvm/lib/Target/AArch64/Utils/CMakeLists.txt
+++ b/llvm/lib/Target/AArch64/Utils/CMakeLists.txt
@@ -1,3 +1,9 @@
 add_llvm_component_library(LLVMAArch64Utils
   AArch64BaseInfo.cpp
+
+  LINK_COMPONENTS
+  Support
+
+  ADD_TO_COMPONENT
+  AArch64
   )

diff  --git a/llvm/lib/Target/AArch64/Utils/LLVMBuild.txt b/llvm/lib/Target/AArch64/Utils/LLVMBuild.txt
deleted file mode 100644
index 4a994a739732..000000000000
--- a/llvm/lib/Target/AArch64/Utils/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/AArch64/Utils/LLVMBuild.txt ----------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = AArch64Utils
-parent = AArch64
-required_libraries = Support
-add_to_library_groups = AArch64

diff  --git a/llvm/lib/Target/AMDGPU/AsmParser/CMakeLists.txt b/llvm/lib/Target/AMDGPU/AsmParser/CMakeLists.txt
index e33b4b1b9043..c2ad24da0db1 100644
--- a/llvm/lib/Target/AMDGPU/AsmParser/CMakeLists.txt
+++ b/llvm/lib/Target/AMDGPU/AsmParser/CMakeLists.txt
@@ -1,5 +1,16 @@
 add_llvm_component_library(LLVMAMDGPUAsmParser
   AMDGPUAsmParser.cpp
+
+  LINK_COMPONENTS
+  MC
+  MCParser
+  AMDGPUDesc
+  AMDGPUInfo
+  AMDGPUUtils
+  Support
+
+  ADD_TO_COMPONENT
+  AMDGPU
   )
 
 add_dependencies(LLVMAMDGPUAsmParser LLVMAMDGPUUtils)

diff  --git a/llvm/lib/Target/AMDGPU/AsmParser/LLVMBuild.txt b/llvm/lib/Target/AMDGPU/AsmParser/LLVMBuild.txt
deleted file mode 100644
index adc5fd426307..000000000000
--- a/llvm/lib/Target/AMDGPU/AsmParser/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/AMDGPU/AsmParser/LLVMBuild.txt -------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = AMDGPUAsmParser
-parent = AMDGPU
-required_libraries = MC MCParser AMDGPUDesc AMDGPUInfo AMDGPUUtils Support
-add_to_library_groups = AMDGPU

diff  --git a/llvm/lib/Target/AMDGPU/CMakeLists.txt b/llvm/lib/Target/AMDGPU/CMakeLists.txt
index a1b80b69b734..48846c82e7f7 100644
--- a/llvm/lib/Target/AMDGPU/CMakeLists.txt
+++ b/llvm/lib/Target/AMDGPU/CMakeLists.txt
@@ -1,3 +1,5 @@
+add_llvm_component_group(AMDGPU)
+
 set(LLVM_TARGET_DEFINITIONS AMDGPU.td)
 
 tablegen(LLVM AMDGPUGenAsmMatcher.inc -gen-asm-matcher)
@@ -142,6 +144,29 @@ add_llvm_target(AMDGPUCodeGen
   GCNNSAReassign.cpp
   GCNDPPCombine.cpp
   SIModeRegister.cpp
+
+  LINK_COMPONENTS
+  Analysis
+  AsmPrinter
+  CodeGen
+  Core
+  IPO
+  MC
+  AMDGPUDesc
+  AMDGPUInfo
+  AMDGPUUtils
+  Scalar
+  SelectionDAG
+  Support
+  Target
+  TransformUtils
+  Vectorize
+  GlobalISel
+  BinaryFormat
+  MIRParser
+
+  ADD_TO_COMPONENT
+  AMDGPU
   )
 
 add_subdirectory(AsmParser)

diff  --git a/llvm/lib/Target/AMDGPU/Disassembler/CMakeLists.txt b/llvm/lib/Target/AMDGPU/Disassembler/CMakeLists.txt
index 21e2dd67c928..33591ec211fe 100644
--- a/llvm/lib/Target/AMDGPU/Disassembler/CMakeLists.txt
+++ b/llvm/lib/Target/AMDGPU/Disassembler/CMakeLists.txt
@@ -2,6 +2,17 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/
 
 add_llvm_component_library(LLVMAMDGPUDisassembler
   AMDGPUDisassembler.cpp
+
+  LINK_COMPONENTS
+  AMDGPUDesc
+  AMDGPUInfo
+  AMDGPUUtils
+  MC
+  MCDisassembler
+  Support
+
+  ADD_TO_COMPONENT
+  AMDGPU
   )
 
 add_dependencies(LLVMAMDGPUDisassembler AMDGPUCommonTableGen LLVMAMDGPUUtils)

diff  --git a/llvm/lib/Target/AMDGPU/Disassembler/LLVMBuild.txt b/llvm/lib/Target/AMDGPU/Disassembler/LLVMBuild.txt
deleted file mode 100644
index 4163e3800297..000000000000
--- a/llvm/lib/Target/AMDGPU/Disassembler/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/AMDGPU/Disassembler/LLVMBuild.txt ------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = AMDGPUDisassembler
-parent = AMDGPU
-required_libraries = AMDGPUDesc AMDGPUInfo AMDGPUUtils MC MCDisassembler Support
-add_to_library_groups = AMDGPU

diff  --git a/llvm/lib/Target/AMDGPU/LLVMBuild.txt b/llvm/lib/Target/AMDGPU/LLVMBuild.txt
deleted file mode 100644
index 9261db73425f..000000000000
--- a/llvm/lib/Target/AMDGPU/LLVMBuild.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-;===- ./lib/Target/AMDGPU/LLVMBuild.txt ------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = AsmParser Disassembler MCTargetDesc TargetInfo Utils
-
-[component_0]
-type = TargetGroup
-name = AMDGPU
-parent = Target
-has_asmparser = 1
-has_asmprinter = 1
-has_disassembler = 1
-
-[component_1]
-type = Library
-name = AMDGPUCodeGen
-parent = AMDGPU
-required_libraries = Analysis AsmPrinter CodeGen Core IPO MC AMDGPUDesc AMDGPUInfo AMDGPUUtils Scalar SelectionDAG Support Target TransformUtils Vectorize GlobalISel BinaryFormat MIRParser
-add_to_library_groups = AMDGPU

diff  --git a/llvm/lib/Target/AMDGPU/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/AMDGPU/MCTargetDesc/CMakeLists.txt
index 6e01150ee6f3..c89955244c13 100644
--- a/llvm/lib/Target/AMDGPU/MCTargetDesc/CMakeLists.txt
+++ b/llvm/lib/Target/AMDGPU/MCTargetDesc/CMakeLists.txt
@@ -10,6 +10,17 @@ add_llvm_component_library(LLVMAMDGPUDesc
   R600MCCodeEmitter.cpp
   R600MCTargetDesc.cpp
   SIMCCodeEmitter.cpp
+
+  LINK_COMPONENTS
+  Core
+  MC
+  AMDGPUInfo
+  AMDGPUUtils
+  Support
+  BinaryFormat
+
+  ADD_TO_COMPONENT
+  AMDGPU
 )
 
 add_dependencies(LLVMAMDGPUDesc LLVMAMDGPUUtils)

diff  --git a/llvm/lib/Target/AMDGPU/MCTargetDesc/LLVMBuild.txt b/llvm/lib/Target/AMDGPU/MCTargetDesc/LLVMBuild.txt
deleted file mode 100644
index 55d9a49db06b..000000000000
--- a/llvm/lib/Target/AMDGPU/MCTargetDesc/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/AMDGPU/MCTargetDesc/LLVMBuild.txt -------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = AMDGPUDesc
-parent = AMDGPU
-required_libraries = Core MC AMDGPUInfo AMDGPUUtils Support BinaryFormat
-add_to_library_groups = AMDGPU

diff  --git a/llvm/lib/Target/AMDGPU/TargetInfo/CMakeLists.txt b/llvm/lib/Target/AMDGPU/TargetInfo/CMakeLists.txt
index 6003acccc015..f9cb5df80a39 100644
--- a/llvm/lib/Target/AMDGPU/TargetInfo/CMakeLists.txt
+++ b/llvm/lib/Target/AMDGPU/TargetInfo/CMakeLists.txt
@@ -1,3 +1,9 @@
 add_llvm_component_library(LLVMAMDGPUInfo
   AMDGPUTargetInfo.cpp
+
+  LINK_COMPONENTS
+  Support
+
+  ADD_TO_COMPONENT
+  AMDGPU
   )

diff  --git a/llvm/lib/Target/AMDGPU/TargetInfo/LLVMBuild.txt b/llvm/lib/Target/AMDGPU/TargetInfo/LLVMBuild.txt
deleted file mode 100644
index 1b1848c5c447..000000000000
--- a/llvm/lib/Target/AMDGPU/TargetInfo/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/AMDGPU/TargetInfo/LLVMBuild.txt --------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = AMDGPUInfo
-parent = AMDGPU
-required_libraries = Support
-add_to_library_groups = AMDGPU

diff  --git a/llvm/lib/Target/AMDGPU/Utils/CMakeLists.txt b/llvm/lib/Target/AMDGPU/Utils/CMakeLists.txt
index 9a5bbd89938a..fdb6e2eaa8e9 100644
--- a/llvm/lib/Target/AMDGPU/Utils/CMakeLists.txt
+++ b/llvm/lib/Target/AMDGPU/Utils/CMakeLists.txt
@@ -3,4 +3,13 @@ add_llvm_component_library(LLVMAMDGPUUtils
   AMDKernelCodeTUtils.cpp
   AMDGPUAsmUtils.cpp
   AMDGPUPALMetadata.cpp
+
+  LINK_COMPONENTS
+  Core
+  MC
+  BinaryFormat
+  Support
+
+  ADD_TO_COMPONENT
+  AMDGPU
   )

diff  --git a/llvm/lib/Target/AMDGPU/Utils/LLVMBuild.txt b/llvm/lib/Target/AMDGPU/Utils/LLVMBuild.txt
deleted file mode 100644
index fb84b3bbeedb..000000000000
--- a/llvm/lib/Target/AMDGPU/Utils/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/AMDGPU/Utils/LLVMBuild.txt ------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = AMDGPUUtils
-parent = AMDGPU
-required_libraries = Core MC BinaryFormat Support
-add_to_library_groups = AMDGPU

diff  --git a/llvm/lib/Target/ARC/CMakeLists.txt b/llvm/lib/Target/ARC/CMakeLists.txt
index a1604792f6ec..96a42d0165aa 100644
--- a/llvm/lib/Target/ARC/CMakeLists.txt
+++ b/llvm/lib/Target/ARC/CMakeLists.txt
@@ -1,3 +1,5 @@
+add_llvm_component_group(ARC)
+
 set(LLVM_TARGET_DEFINITIONS ARC.td)
 
 tablegen(LLVM ARCGenAsmWriter.inc -gen-asm-writer)
@@ -24,7 +26,23 @@ add_llvm_target(ARCCodeGen
   ARCRegisterInfo.cpp
   ARCSubtarget.cpp
   ARCTargetMachine.cpp
-  )
+
+  LINK_COMPONENTS
+  Analysis
+  AsmPrinter
+  CodeGen
+  Core
+  MC
+  SelectionDAG
+  Support
+  Target
+  TransformUtils
+  ARCDesc
+  ARCInfo
+
+  ADD_TO_COMPONENT
+  ARC
+)
 
 add_subdirectory(Disassembler)
 add_subdirectory(MCTargetDesc)

diff  --git a/llvm/lib/Target/ARC/Disassembler/CMakeLists.txt b/llvm/lib/Target/ARC/Disassembler/CMakeLists.txt
index 970ccc7d4b68..4cdeca5d5a9e 100644
--- a/llvm/lib/Target/ARC/Disassembler/CMakeLists.txt
+++ b/llvm/lib/Target/ARC/Disassembler/CMakeLists.txt
@@ -1,3 +1,11 @@
 add_llvm_component_library(LLVMARCDisassembler
   ARCDisassembler.cpp
+
+  LINK_COMPONENTS
+  MCDisassembler
+  Support
+  ARCInfo
+
+  ADD_TO_COMPONENT
+  ARC
   )

diff  --git a/llvm/lib/Target/ARC/Disassembler/LLVMBuild.txt b/llvm/lib/Target/ARC/Disassembler/LLVMBuild.txt
deleted file mode 100644
index 9fb3c5a15db1..000000000000
--- a/llvm/lib/Target/ARC/Disassembler/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/ARC/Disassembler/LLVMBuild.txt ------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = ARCDisassembler
-parent = ARC
-required_libraries = MCDisassembler Support ARCInfo
-add_to_library_groups = ARC

diff  --git a/llvm/lib/Target/ARC/LLVMBuild.txt b/llvm/lib/Target/ARC/LLVMBuild.txt
deleted file mode 100644
index 365805a0d79d..000000000000
--- a/llvm/lib/Target/ARC/LLVMBuild.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-;===- ./lib/Target/ARC/LLVMBuild.txt -------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = Disassembler MCTargetDesc TargetInfo
-
-[component_0]
-type = TargetGroup
-name = ARC
-parent = Target
-has_asmprinter = 1
-has_disassembler = 1
-
-[component_1]
-type = Library
-name = ARCCodeGen
-parent = ARC
-required_libraries =
- Analysis
- AsmPrinter
- CodeGen
- Core
- MC
- SelectionDAG
- Support
- Target
- TransformUtils
- ARCDesc
- ARCInfo
-add_to_library_groups = ARC

diff  --git a/llvm/lib/Target/ARC/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/ARC/MCTargetDesc/CMakeLists.txt
index c356da9533f0..1b5f89719f85 100644
--- a/llvm/lib/Target/ARC/MCTargetDesc/CMakeLists.txt
+++ b/llvm/lib/Target/ARC/MCTargetDesc/CMakeLists.txt
@@ -2,4 +2,12 @@ add_llvm_component_library(LLVMARCDesc
   ARCInstPrinter.cpp
   ARCMCTargetDesc.cpp
   ARCMCAsmInfo.cpp
+
+  LINK_COMPONENTS
+  MC
+  Support
+  ARCInfo
+
+  ADD_TO_COMPONENT
+  ARC
   )

diff  --git a/llvm/lib/Target/ARC/MCTargetDesc/LLVMBuild.txt b/llvm/lib/Target/ARC/MCTargetDesc/LLVMBuild.txt
deleted file mode 100644
index 5d2e0e6facea..000000000000
--- a/llvm/lib/Target/ARC/MCTargetDesc/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/ARC/MCTargetDesc/LLVMBuild.txt ------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = ARCDesc
-parent = ARC
-required_libraries = MC Support ARCInfo
-add_to_library_groups = ARC

diff  --git a/llvm/lib/Target/ARC/TargetInfo/CMakeLists.txt b/llvm/lib/Target/ARC/TargetInfo/CMakeLists.txt
index 59018be7f194..3524a09695e3 100644
--- a/llvm/lib/Target/ARC/TargetInfo/CMakeLists.txt
+++ b/llvm/lib/Target/ARC/TargetInfo/CMakeLists.txt
@@ -1,3 +1,9 @@
 add_llvm_component_library(LLVMARCInfo
   ARCTargetInfo.cpp
+
+  LINK_COMPONENTS
+  Support
+
+  ADD_TO_COMPONENT
+  ARC
   )

diff  --git a/llvm/lib/Target/ARC/TargetInfo/LLVMBuild.txt b/llvm/lib/Target/ARC/TargetInfo/LLVMBuild.txt
deleted file mode 100644
index d2543e524585..000000000000
--- a/llvm/lib/Target/ARC/TargetInfo/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/ARC/TargetInfo/LLVMBuild.txt --------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = ARCInfo
-parent = ARC
-required_libraries = Support
-add_to_library_groups = ARC

diff  --git a/llvm/lib/Target/ARM/AsmParser/CMakeLists.txt b/llvm/lib/Target/ARM/AsmParser/CMakeLists.txt
index 3777bccee369..fd6ea65f80e4 100644
--- a/llvm/lib/Target/ARM/AsmParser/CMakeLists.txt
+++ b/llvm/lib/Target/ARM/AsmParser/CMakeLists.txt
@@ -1,3 +1,14 @@
 add_llvm_component_library(LLVMARMAsmParser
   ARMAsmParser.cpp
+
+  LINK_COMPONENTS
+  ARMDesc
+  ARMInfo
+  MC
+  MCParser
+  Support
+  ARMUtils
+
+  ADD_TO_COMPONENT
+  ARM
   )

diff  --git a/llvm/lib/Target/ARM/AsmParser/LLVMBuild.txt b/llvm/lib/Target/ARM/AsmParser/LLVMBuild.txt
deleted file mode 100644
index 24bc22ab19cc..000000000000
--- a/llvm/lib/Target/ARM/AsmParser/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/ARM/AsmParser/LLVMBuild.txt -----------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = ARMAsmParser
-parent = ARM
-required_libraries = ARMDesc ARMInfo MC MCParser Support ARMUtils
-add_to_library_groups = ARM

diff  --git a/llvm/lib/Target/ARM/CMakeLists.txt b/llvm/lib/Target/ARM/CMakeLists.txt
index dcc3a7d4c6b6..6a2ffdaef126 100644
--- a/llvm/lib/Target/ARM/CMakeLists.txt
+++ b/llvm/lib/Target/ARM/CMakeLists.txt
@@ -1,3 +1,5 @@
+add_llvm_component_group(ARM HAS_JIT)
+
 set(LLVM_TARGET_DEFINITIONS ARM.td)
 
 tablegen(LLVM ARMGenAsmMatcher.inc -gen-asm-matcher)
@@ -61,6 +63,26 @@ add_llvm_target(ARMCodeGen
   Thumb2ITBlockPass.cpp
   Thumb2InstrInfo.cpp
   Thumb2SizeReduction.cpp
+
+  LINK_COMPONENTS
+  ARMDesc
+  ARMInfo
+  Analysis
+  AsmPrinter
+  CodeGen
+  Core
+  MC
+  Scalar
+  SelectionDAG
+  Support
+  Target
+  GlobalISel
+  ARMUtils
+  TransformUtils
+  CFGuard
+
+  ADD_TO_COMPONENT
+  ARM
   )
 
 add_subdirectory(AsmParser)

diff  --git a/llvm/lib/Target/ARM/Disassembler/CMakeLists.txt b/llvm/lib/Target/ARM/Disassembler/CMakeLists.txt
index dc2b130aa0ab..ad7022fd6ff0 100644
--- a/llvm/lib/Target/ARM/Disassembler/CMakeLists.txt
+++ b/llvm/lib/Target/ARM/Disassembler/CMakeLists.txt
@@ -1,3 +1,13 @@
 add_llvm_component_library(LLVMARMDisassembler
   ARMDisassembler.cpp
+
+  LINK_COMPONENTS
+  ARMDesc
+  ARMInfo
+  MCDisassembler
+  Support
+  ARMUtils
+
+  ADD_TO_COMPONENT
+  ARM
   )

diff  --git a/llvm/lib/Target/ARM/Disassembler/LLVMBuild.txt b/llvm/lib/Target/ARM/Disassembler/LLVMBuild.txt
deleted file mode 100644
index 9a5c3a8a195c..000000000000
--- a/llvm/lib/Target/ARM/Disassembler/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/ARM/Disassembler/LLVMBuild.txt --------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = ARMDisassembler
-parent = ARM
-required_libraries = ARMDesc ARMInfo MCDisassembler Support ARMUtils
-add_to_library_groups = ARM

diff  --git a/llvm/lib/Target/ARM/LLVMBuild.txt b/llvm/lib/Target/ARM/LLVMBuild.txt
deleted file mode 100644
index 40f8c2c93b07..000000000000
--- a/llvm/lib/Target/ARM/LLVMBuild.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-;===- ./lib/Target/ARM/LLVMBuild.txt ---------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = AsmParser Disassembler MCTargetDesc TargetInfo Utils
-
-[component_0]
-type = TargetGroup
-name = ARM
-parent = Target
-has_asmparser = 1
-has_asmprinter = 1
-has_disassembler = 1
-has_jit = 1
-
-[component_1]
-type = Library
-name = ARMCodeGen
-parent = ARM
-required_libraries = ARMDesc ARMInfo Analysis AsmPrinter CodeGen Core MC Scalar SelectionDAG Support Target GlobalISel ARMUtils TransformUtils CFGuard
-add_to_library_groups = ARM

diff  --git a/llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt
index ca482173a12c..20fd6b208d23 100644
--- a/llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt
+++ b/llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt
@@ -13,4 +13,15 @@ add_llvm_component_library(LLVMARMDesc
   ARMUnwindOpAsm.cpp
   ARMWinCOFFObjectWriter.cpp
   ARMWinCOFFStreamer.cpp
+
+  LINK_COMPONENTS
+  ARMInfo
+  ARMUtils
+  MC
+  MCDisassembler
+  Support
+  BinaryFormat
+
+  ADD_TO_COMPONENT
+  ARM
   )

diff  --git a/llvm/lib/Target/ARM/MCTargetDesc/LLVMBuild.txt b/llvm/lib/Target/ARM/MCTargetDesc/LLVMBuild.txt
deleted file mode 100644
index 438fa6c1dc4a..000000000000
--- a/llvm/lib/Target/ARM/MCTargetDesc/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/ARM/MCTargetDesc/LLVMBuild.txt --------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = ARMDesc
-parent = ARM
-required_libraries = ARMInfo ARMUtils MC MCDisassembler Support BinaryFormat
-add_to_library_groups = ARM

diff  --git a/llvm/lib/Target/ARM/TargetInfo/CMakeLists.txt b/llvm/lib/Target/ARM/TargetInfo/CMakeLists.txt
index 8492e60f03c0..bdc2ee5e4d38 100644
--- a/llvm/lib/Target/ARM/TargetInfo/CMakeLists.txt
+++ b/llvm/lib/Target/ARM/TargetInfo/CMakeLists.txt
@@ -1,3 +1,9 @@
 add_llvm_component_library(LLVMARMInfo
   ARMTargetInfo.cpp
+
+  LINK_COMPONENTS
+  Support
+
+  ADD_TO_COMPONENT
+  ARM
   )

diff  --git a/llvm/lib/Target/ARM/TargetInfo/LLVMBuild.txt b/llvm/lib/Target/ARM/TargetInfo/LLVMBuild.txt
deleted file mode 100644
index e635aee253ed..000000000000
--- a/llvm/lib/Target/ARM/TargetInfo/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/ARM/TargetInfo/LLVMBuild.txt ----------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = ARMInfo
-parent = ARM
-required_libraries = Support
-add_to_library_groups = ARM

diff  --git a/llvm/lib/Target/ARM/Utils/CMakeLists.txt b/llvm/lib/Target/ARM/Utils/CMakeLists.txt
index d5b71dc6989c..13af170a56f5 100644
--- a/llvm/lib/Target/ARM/Utils/CMakeLists.txt
+++ b/llvm/lib/Target/ARM/Utils/CMakeLists.txt
@@ -1,3 +1,9 @@
 add_llvm_component_library(LLVMARMUtils
   ARMBaseInfo.cpp
+
+  LINK_COMPONENTS
+  Support
+
+  ADD_TO_COMPONENT
+  ARM
   )

diff  --git a/llvm/lib/Target/ARM/Utils/LLVMBuild.txt b/llvm/lib/Target/ARM/Utils/LLVMBuild.txt
deleted file mode 100644
index 004f7768d4df..000000000000
--- a/llvm/lib/Target/ARM/Utils/LLVMBuild.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-;===- ./lib/Target/ARM/Utils/LLVMBuild.txt ----------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = ARMUtils
-parent = ARM
-required_libraries = Support
-add_to_library_groups = ARM
-

diff  --git a/llvm/lib/Target/AVR/AsmParser/CMakeLists.txt b/llvm/lib/Target/AVR/AsmParser/CMakeLists.txt
index 9ffba49073dd..2de6ba9372e3 100644
--- a/llvm/lib/Target/AVR/AsmParser/CMakeLists.txt
+++ b/llvm/lib/Target/AVR/AsmParser/CMakeLists.txt
@@ -1,3 +1,13 @@
 add_llvm_component_library(LLVMAVRAsmParser
   AVRAsmParser.cpp
+
+  LINK_COMPONENTS
+  MC
+  MCParser
+  AVRDesc
+  AVRInfo
+  Support
+
+  ADD_TO_COMPONENT
+  AVR
 )

diff  --git a/llvm/lib/Target/AVR/AsmParser/LLVMBuild.txt b/llvm/lib/Target/AVR/AsmParser/LLVMBuild.txt
deleted file mode 100644
index 0eb4eeb85d40..000000000000
--- a/llvm/lib/Target/AVR/AsmParser/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/AVR/AsmParser/LLVMBuild.txt -----------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = AVRAsmParser
-parent = AVR
-required_libraries = MC MCParser AVRDesc AVRInfo Support
-add_to_library_groups = AVR

diff  --git a/llvm/lib/Target/AVR/CMakeLists.txt b/llvm/lib/Target/AVR/CMakeLists.txt
index e7a44acdaac3..f24bbd32562c 100644
--- a/llvm/lib/Target/AVR/CMakeLists.txt
+++ b/llvm/lib/Target/AVR/CMakeLists.txt
@@ -1,3 +1,5 @@
+add_llvm_component_group(AVR)
+
 set(LLVM_TARGET_DEFINITIONS AVR.td)
 
 tablegen(LLVM AVRGenAsmMatcher.inc -gen-asm-matcher)
@@ -28,6 +30,20 @@ add_llvm_target(AVRCodeGen
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  AsmPrinter
+  CodeGen
+  Core
+  MC
+  AVRDesc
+  AVRInfo
+  SelectionDAG
+  Support
+  Target
+
+  ADD_TO_COMPONENT
+  AVR
 )
 
 add_subdirectory(AsmParser)

diff  --git a/llvm/lib/Target/AVR/Disassembler/CMakeLists.txt b/llvm/lib/Target/AVR/Disassembler/CMakeLists.txt
index cbf4537ca33d..35a22cccfe14 100644
--- a/llvm/lib/Target/AVR/Disassembler/CMakeLists.txt
+++ b/llvm/lib/Target/AVR/Disassembler/CMakeLists.txt
@@ -1,4 +1,12 @@
 add_llvm_component_library(LLVMAVRDisassembler
   AVRDisassembler.cpp
+
+  LINK_COMPONENTS
+  MCDisassembler
+  AVRInfo
+  Support
+
+  ADD_TO_COMPONENT
+  AVR
 )
 

diff  --git a/llvm/lib/Target/AVR/Disassembler/LLVMBuild.txt b/llvm/lib/Target/AVR/Disassembler/LLVMBuild.txt
deleted file mode 100644
index 86b5e0b7816c..000000000000
--- a/llvm/lib/Target/AVR/Disassembler/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/AVR/Disassembler/LLVMBuild.txt --------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = AVRDisassembler
-parent = AVR
-required_libraries = MCDisassembler AVRInfo Support
-add_to_library_groups = AVR

diff  --git a/llvm/lib/Target/AVR/LLVMBuild.txt b/llvm/lib/Target/AVR/LLVMBuild.txt
deleted file mode 100644
index d488c9ea94bc..000000000000
--- a/llvm/lib/Target/AVR/LLVMBuild.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-;===- ./lib/Target/AVR/LLVMBuild.txt ---------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = AsmParser Disassembler MCTargetDesc TargetInfo
-
-[component_0]
-type = TargetGroup
-name = AVR
-parent = Target
-has_asmprinter = 1
-has_asmparser = 1
-has_disassembler = 1
-
-[component_1]
-type = Library
-name = AVRCodeGen
-parent = AVR
-required_libraries = AsmPrinter CodeGen Core MC AVRDesc AVRInfo SelectionDAG Support Target
-add_to_library_groups = AVR
-

diff  --git a/llvm/lib/Target/AVR/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/AVR/MCTargetDesc/CMakeLists.txt
index 417ff67c6aec..4ad97d320e60 100644
--- a/llvm/lib/Target/AVR/MCTargetDesc/CMakeLists.txt
+++ b/llvm/lib/Target/AVR/MCTargetDesc/CMakeLists.txt
@@ -9,6 +9,14 @@ add_llvm_component_library(LLVMAVRDesc
   AVRMCExpr.cpp
   AVRMCTargetDesc.cpp
   AVRTargetStreamer.cpp
+
+  LINK_COMPONENTS
+  MC
+  AVRInfo
+  Support
+
+  ADD_TO_COMPONENT
+  AVR
 )
 
 add_dependencies(LLVMAVRDesc AVRCommonTableGen)

diff  --git a/llvm/lib/Target/AVR/MCTargetDesc/LLVMBuild.txt b/llvm/lib/Target/AVR/MCTargetDesc/LLVMBuild.txt
deleted file mode 100644
index 45460e5f2408..000000000000
--- a/llvm/lib/Target/AVR/MCTargetDesc/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/AVR/MCTargetDesc/LLVMBuild.txt --------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = AVRDesc
-parent = AVR
-required_libraries = MC AVRInfo Support
-add_to_library_groups = AVR

diff  --git a/llvm/lib/Target/AVR/TargetInfo/CMakeLists.txt b/llvm/lib/Target/AVR/TargetInfo/CMakeLists.txt
index 75fb77cf341a..97c118a7d6b9 100644
--- a/llvm/lib/Target/AVR/TargetInfo/CMakeLists.txt
+++ b/llvm/lib/Target/AVR/TargetInfo/CMakeLists.txt
@@ -3,6 +3,12 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR}/..
 
 add_llvm_component_library(LLVMAVRInfo
   AVRTargetInfo.cpp
+
+  LINK_COMPONENTS
+  Support
+
+  ADD_TO_COMPONENT
+  AVR
 )
 
 add_dependencies(LLVMAVRInfo AVRCommonTableGen)

diff  --git a/llvm/lib/Target/AVR/TargetInfo/LLVMBuild.txt b/llvm/lib/Target/AVR/TargetInfo/LLVMBuild.txt
deleted file mode 100644
index 7b112a2f00c6..000000000000
--- a/llvm/lib/Target/AVR/TargetInfo/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/AVR/TargetInfo/LLVMBuild.txt ----------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = AVRInfo
-parent = AVR
-required_libraries = Support
-add_to_library_groups = AVR

diff  --git a/llvm/lib/Target/BPF/AsmParser/CMakeLists.txt b/llvm/lib/Target/BPF/AsmParser/CMakeLists.txt
index e34fe084c6aa..484d3fa24c8b 100644
--- a/llvm/lib/Target/BPF/AsmParser/CMakeLists.txt
+++ b/llvm/lib/Target/BPF/AsmParser/CMakeLists.txt
@@ -1,3 +1,13 @@
 add_llvm_component_library(LLVMBPFAsmParser
   BPFAsmParser.cpp
+
+  LINK_COMPONENTS
+  MC
+  MCParser
+  BPFDesc
+  BPFInfo
+  Support
+
+  ADD_TO_COMPONENT
+  BPF
   )

diff  --git a/llvm/lib/Target/BPF/AsmParser/LLVMBuild.txt b/llvm/lib/Target/BPF/AsmParser/LLVMBuild.txt
deleted file mode 100644
index cd01fb625fd4..000000000000
--- a/llvm/lib/Target/BPF/AsmParser/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/BPF/AsmParser/LLVMBuild.txt ---------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = BPFAsmParser
-parent = BPF
-required_libraries = MC MCParser BPFDesc BPFInfo Support
-add_to_library_groups = BPF

diff  --git a/llvm/lib/Target/BPF/CMakeLists.txt b/llvm/lib/Target/BPF/CMakeLists.txt
index a17d7173816a..24c6c5e1255e 100644
--- a/llvm/lib/Target/BPF/CMakeLists.txt
+++ b/llvm/lib/Target/BPF/CMakeLists.txt
@@ -1,3 +1,5 @@
+add_llvm_component_group(BPF)
+
 set(LLVM_TARGET_DEFINITIONS BPF.td)
 
 tablegen(LLVM BPFGenAsmMatcher.inc -gen-asm-matcher)
@@ -31,6 +33,22 @@ add_llvm_target(BPFCodeGen
   BPFMIChecking.cpp
   BPFMISimplifyPatchable.cpp
   BTFDebug.cpp
+
+  LINK_COMPONENTS
+  AsmPrinter
+  CodeGen
+  Core
+  MC
+  BPFDesc
+  BPFInfo
+  IPO
+  Scalar
+  SelectionDAG
+  Support
+  Target
+
+  ADD_TO_COMPONENT
+  BPF
   )
 
 add_subdirectory(AsmParser)

diff  --git a/llvm/lib/Target/BPF/Disassembler/CMakeLists.txt b/llvm/lib/Target/BPF/Disassembler/CMakeLists.txt
index e8f8f0dd2a98..10db730e26ce 100644
--- a/llvm/lib/Target/BPF/Disassembler/CMakeLists.txt
+++ b/llvm/lib/Target/BPF/Disassembler/CMakeLists.txt
@@ -1,4 +1,12 @@
 add_llvm_component_library(LLVMBPFDisassembler
   BPFDisassembler.cpp
+
+  LINK_COMPONENTS
+  MCDisassembler
+  BPFInfo
+  Support
+
+  ADD_TO_COMPONENT
+  BPF
 )
 

diff  --git a/llvm/lib/Target/BPF/Disassembler/LLVMBuild.txt b/llvm/lib/Target/BPF/Disassembler/LLVMBuild.txt
deleted file mode 100644
index ad1adca5d8bb..000000000000
--- a/llvm/lib/Target/BPF/Disassembler/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/BPF/Disassembler/LLVMBuild.txt --------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = BPFDisassembler
-parent = BPF
-required_libraries = MCDisassembler BPFInfo Support
-add_to_library_groups = BPF

diff  --git a/llvm/lib/Target/BPF/LLVMBuild.txt b/llvm/lib/Target/BPF/LLVMBuild.txt
deleted file mode 100644
index 3bac1f081c0d..000000000000
--- a/llvm/lib/Target/BPF/LLVMBuild.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-;===- ./lib/Target/BPF/LLVMBuild.txt ---------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = AsmParser Disassembler MCTargetDesc TargetInfo
-
-[component_0]
-type = TargetGroup
-name = BPF
-parent = Target
-has_asmprinter = 1
-has_disassembler = 1
-
-[component_1]
-type = Library
-name = BPFCodeGen
-parent = BPF
-required_libraries =
- AsmPrinter
- CodeGen
- Core
- MC
- BPFDesc
- BPFInfo
- IPO
- Scalar
- SelectionDAG
- Support
- Target
-add_to_library_groups = BPF

diff  --git a/llvm/lib/Target/BPF/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/BPF/MCTargetDesc/CMakeLists.txt
index a306247569e4..ac89dcc69228 100644
--- a/llvm/lib/Target/BPF/MCTargetDesc/CMakeLists.txt
+++ b/llvm/lib/Target/BPF/MCTargetDesc/CMakeLists.txt
@@ -4,4 +4,12 @@ add_llvm_component_library(LLVMBPFDesc
   BPFInstPrinter.cpp
   BPFMCCodeEmitter.cpp
   BPFELFObjectWriter.cpp
+
+  LINK_COMPONENTS
+  MC
+  BPFInfo
+  Support
+
+  ADD_TO_COMPONENT
+  BPF
   )

diff  --git a/llvm/lib/Target/BPF/MCTargetDesc/LLVMBuild.txt b/llvm/lib/Target/BPF/MCTargetDesc/LLVMBuild.txt
deleted file mode 100644
index 7c9d9c71ba75..000000000000
--- a/llvm/lib/Target/BPF/MCTargetDesc/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/BPF/MCTargetDesc/LLVMBuild.txt --------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = BPFDesc
-parent = BPF
-required_libraries = MC BPFInfo Support
-add_to_library_groups = BPF

diff  --git a/llvm/lib/Target/BPF/TargetInfo/CMakeLists.txt b/llvm/lib/Target/BPF/TargetInfo/CMakeLists.txt
index d955f31a00bc..809b564601d4 100644
--- a/llvm/lib/Target/BPF/TargetInfo/CMakeLists.txt
+++ b/llvm/lib/Target/BPF/TargetInfo/CMakeLists.txt
@@ -1,3 +1,9 @@
 add_llvm_component_library(LLVMBPFInfo
   BPFTargetInfo.cpp
+
+  LINK_COMPONENTS
+  Support
+
+  ADD_TO_COMPONENT
+  BPF
   )

diff  --git a/llvm/lib/Target/BPF/TargetInfo/LLVMBuild.txt b/llvm/lib/Target/BPF/TargetInfo/LLVMBuild.txt
deleted file mode 100644
index e9e14ad1c435..000000000000
--- a/llvm/lib/Target/BPF/TargetInfo/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/BPF/TargetInfo/LLVMBuild.txt ----------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = BPFInfo
-parent = BPF
-required_libraries = Support
-add_to_library_groups = BPF

diff  --git a/llvm/lib/Target/CMakeLists.txt b/llvm/lib/Target/CMakeLists.txt
index bd51278a24f7..e87ccde22c12 100644
--- a/llvm/lib/Target/CMakeLists.txt
+++ b/llvm/lib/Target/CMakeLists.txt
@@ -11,6 +11,12 @@ add_llvm_component_library(LLVMTarget
 
   ADDITIONAL_HEADER_DIRS
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/Target
+
+  LINK_COMPONENTS
+  Analysis
+  Core
+  MC
+  Support
   )
 
 # When building shared objects for each target there are some internal APIs

diff  --git a/llvm/lib/Target/CSKY/CMakeLists.txt b/llvm/lib/Target/CSKY/CMakeLists.txt
index a8ab01d25b89..51b7b02e727b 100644
--- a/llvm/lib/Target/CSKY/CMakeLists.txt
+++ b/llvm/lib/Target/CSKY/CMakeLists.txt
@@ -1,5 +1,17 @@
+add_llvm_component_group(CSKY)
+
 add_llvm_target(CSKYCodeGen
   CSKYTargetMachine.cpp
+
+  LINK_COMPONENTS
+  Core
+  CodeGen
+  CSKYInfo
+  Support
+  Target
+
+  ADD_TO_COMPONENT
+  CSKY
   )
 
 add_subdirectory(TargetInfo)

diff  --git a/llvm/lib/Target/CSKY/LLVMBuild.txt b/llvm/lib/Target/CSKY/LLVMBuild.txt
deleted file mode 100644
index 97f09b6ec288..000000000000
--- a/llvm/lib/Target/CSKY/LLVMBuild.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-;===----- ./lib/Target/CSKY/LLVMBuild.txt ----------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = TargetInfo
-
-[component_0]
-type = TargetGroup
-name = CSKY
-parent = Target
-
-[component_1]
-type = Library
-name = CSKYCodeGen
-parent = CSKY
-required_libraries = Core CodeGen CSKYInfo Support Target
-add_to_library_groups = CSKY

diff  --git a/llvm/lib/Target/CSKY/TargetInfo/CMakeLists.txt b/llvm/lib/Target/CSKY/TargetInfo/CMakeLists.txt
index 712021d31ab9..11e4e179b4e1 100644
--- a/llvm/lib/Target/CSKY/TargetInfo/CMakeLists.txt
+++ b/llvm/lib/Target/CSKY/TargetInfo/CMakeLists.txt
@@ -1,3 +1,9 @@
-add_llvm_library(LLVMCSKYInfo
+add_llvm_component_library(LLVMCSKYInfo
   CSKYTargetInfo.cpp
-  )
+
+  LINK_COMPONENTS
+  Support
+
+  ADD_TO_COMPONENT
+  CSKY
+)

diff  --git a/llvm/lib/Target/CSKY/TargetInfo/LLVMBuild.txt b/llvm/lib/Target/CSKY/TargetInfo/LLVMBuild.txt
deleted file mode 100644
index 2634816b9cfb..000000000000
--- a/llvm/lib/Target/CSKY/TargetInfo/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===-- ./lib/Target/CSKY/TargetInfo/LLVMBuild.txt --------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = CSKYInfo
-parent = CSKY
-required_libraries = Support
-add_to_library_groups = CSKY

diff  --git a/llvm/lib/Target/Hexagon/AsmParser/CMakeLists.txt b/llvm/lib/Target/Hexagon/AsmParser/CMakeLists.txt
index fa3cb2dd1ad9..abc25aa34feb 100644
--- a/llvm/lib/Target/Hexagon/AsmParser/CMakeLists.txt
+++ b/llvm/lib/Target/Hexagon/AsmParser/CMakeLists.txt
@@ -2,6 +2,16 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/
 
 add_llvm_component_library(LLVMHexagonAsmParser
   HexagonAsmParser.cpp
+
+  LINK_COMPONENTS
+  MC
+  MCParser
+  Support
+  HexagonDesc
+  HexagonInfo
+
+  ADD_TO_COMPONENT
+  Hexagon
   )
 
 add_dependencies( LLVMHexagonAsmParser HexagonCommonTableGen )

diff  --git a/llvm/lib/Target/Hexagon/AsmParser/LLVMBuild.txt b/llvm/lib/Target/Hexagon/AsmParser/LLVMBuild.txt
deleted file mode 100644
index 94f19b1b576d..000000000000
--- a/llvm/lib/Target/Hexagon/AsmParser/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/Hexagon/AsmParser/LLVMBuild.txt --------------*- Conf -*-===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = HexagonAsmParser
-parent = Hexagon
-required_libraries = MC MCParser Support HexagonDesc HexagonInfo
-add_to_library_groups = Hexagon

diff  --git a/llvm/lib/Target/Hexagon/CMakeLists.txt b/llvm/lib/Target/Hexagon/CMakeLists.txt
index 747f14e0ceca..f99692b0f84e 100644
--- a/llvm/lib/Target/Hexagon/CMakeLists.txt
+++ b/llvm/lib/Target/Hexagon/CMakeLists.txt
@@ -1,3 +1,5 @@
+add_llvm_component_group(Hexagon)
+
 set(LLVM_TARGET_DEFINITIONS Hexagon.td)
 
 tablegen(LLVM HexagonGenAsmMatcher.inc -gen-asm-matcher)
@@ -64,6 +66,25 @@ add_llvm_target(HexagonCodeGen
   HexagonVLIWPacketizer.cpp
   RDFCopy.cpp
   RDFDeadCode.cpp
+
+  LINK_COMPONENTS
+   Analysis
+  AsmPrinter
+  CodeGen
+  Core
+  HexagonAsmParser
+  HexagonDesc
+  HexagonInfo
+  IPO
+  MC
+  Scalar
+  SelectionDAG
+  Support
+  Target
+  TransformUtils
+
+  ADD_TO_COMPONENT
+  Hexagon
 )
 
 add_subdirectory(AsmParser)

diff  --git a/llvm/lib/Target/Hexagon/Disassembler/CMakeLists.txt b/llvm/lib/Target/Hexagon/Disassembler/CMakeLists.txt
index 0f2e0bccdbe6..78a450ed1db7 100644
--- a/llvm/lib/Target/Hexagon/Disassembler/CMakeLists.txt
+++ b/llvm/lib/Target/Hexagon/Disassembler/CMakeLists.txt
@@ -1,3 +1,13 @@
 add_llvm_component_library(LLVMHexagonDisassembler
   HexagonDisassembler.cpp
+
+  LINK_COMPONENTS
+  HexagonDesc
+  HexagonInfo
+  MC
+  MCDisassembler
+  Support
+
+  ADD_TO_COMPONENT
+  Hexagon
   )

diff  --git a/llvm/lib/Target/Hexagon/Disassembler/LLVMBuild.txt b/llvm/lib/Target/Hexagon/Disassembler/LLVMBuild.txt
deleted file mode 100644
index a26001add427..000000000000
--- a/llvm/lib/Target/Hexagon/Disassembler/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===-- ./lib/Target/Hexagon/Disassembler/LLVMBuild.txt ---------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = HexagonDisassembler
-parent = Hexagon
-required_libraries = HexagonDesc HexagonInfo MC MCDisassembler Support
-add_to_library_groups = Hexagon

diff  --git a/llvm/lib/Target/Hexagon/LLVMBuild.txt b/llvm/lib/Target/Hexagon/LLVMBuild.txt
deleted file mode 100644
index 3688231b7e05..000000000000
--- a/llvm/lib/Target/Hexagon/LLVMBuild.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-;===- ./lib/Target/Hexagon/LLVMBuild.txt -----------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = AsmParser Disassembler MCTargetDesc TargetInfo
-
-[component_0]
-type = TargetGroup
-name = Hexagon
-parent = Target
-has_asmprinter = 1
-
-[component_1]
-type = Library
-name = HexagonCodeGen
-parent = Hexagon
-required_libraries =
-  Analysis
-  AsmPrinter
-  CodeGen
-  Core
-  HexagonAsmParser
-  HexagonDesc
-  HexagonInfo
-  IPO
-  MC
-  Scalar
-  SelectionDAG
-  Support
-  Target
-  TransformUtils
-add_to_library_groups = Hexagon

diff  --git a/llvm/lib/Target/Hexagon/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/Hexagon/MCTargetDesc/CMakeLists.txt
index a6a12edd5ca5..c80d13dc70bc 100644
--- a/llvm/lib/Target/Hexagon/MCTargetDesc/CMakeLists.txt
+++ b/llvm/lib/Target/Hexagon/MCTargetDesc/CMakeLists.txt
@@ -13,6 +13,14 @@ add_llvm_component_library(LLVMHexagonDesc
   HexagonMCShuffler.cpp
   HexagonMCTargetDesc.cpp
   HexagonShuffler.cpp
+
+  LINK_COMPONENTS
+  HexagonInfo
+  MC
+  Support
+
+  ADD_TO_COMPONENT
+  Hexagon
   )
 
 add_dependencies(LLVMHexagonDesc HexagonCommonTableGen)

diff  --git a/llvm/lib/Target/Hexagon/MCTargetDesc/LLVMBuild.txt b/llvm/lib/Target/Hexagon/MCTargetDesc/LLVMBuild.txt
deleted file mode 100644
index 2e00d013706c..000000000000
--- a/llvm/lib/Target/Hexagon/MCTargetDesc/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/Hexagon/MCTargetDesc/LLVMBuild.txt ----------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = HexagonDesc
-parent = Hexagon
-required_libraries = HexagonInfo MC Support
-add_to_library_groups = Hexagon

diff  --git a/llvm/lib/Target/Hexagon/TargetInfo/CMakeLists.txt b/llvm/lib/Target/Hexagon/TargetInfo/CMakeLists.txt
index 14d5eb495a3c..fc96a618de27 100644
--- a/llvm/lib/Target/Hexagon/TargetInfo/CMakeLists.txt
+++ b/llvm/lib/Target/Hexagon/TargetInfo/CMakeLists.txt
@@ -1,3 +1,9 @@
 add_llvm_component_library(LLVMHexagonInfo
   HexagonTargetInfo.cpp
+
+  LINK_COMPONENTS
+  Support
+
+  ADD_TO_COMPONENT
+  Hexagon
   )

diff  --git a/llvm/lib/Target/Hexagon/TargetInfo/LLVMBuild.txt b/llvm/lib/Target/Hexagon/TargetInfo/LLVMBuild.txt
deleted file mode 100644
index 6d53a72e40cb..000000000000
--- a/llvm/lib/Target/Hexagon/TargetInfo/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/Hexagon/TargetInfo/LLVMBuild.txt ------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = HexagonInfo
-parent = Hexagon
-required_libraries = Support
-add_to_library_groups = Hexagon

diff  --git a/llvm/lib/Target/LLVMBuild.txt b/llvm/lib/Target/LLVMBuild.txt
deleted file mode 100644
index d7570a18986b..000000000000
--- a/llvm/lib/Target/LLVMBuild.txt
+++ /dev/null
@@ -1,77 +0,0 @@
-;===- ./lib/Target/LLVMBuild.txt -------------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-; Please keep these as one per line so that out-of-tree merges
-; will typically require only insertion of a line.
-[common]
-subdirectories =
- AArch64
- AMDGPU
- ARC
- ARM
- AVR
- BPF
- CSKY
- Hexagon
- Lanai
- MSP430
- Mips
- NVPTX
- PowerPC
- RISCV
- Sparc
- SystemZ
- VE
- WebAssembly
- 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).
-[component_0]
-type = LibraryGroup
-name = Engine
-parent = Libraries
-
-; This is a special group whose required libraries are extended (by llvm-build)
-; with the configured native target, if any.
-[component_1]
-type = LibraryGroup
-name = Native
-parent = Libraries
-
-; This is a special group whose required libraries are extended (by llvm-build)
-; with the configured native code generator, if any.
-[component_2]
-type = LibraryGroup
-name = NativeCodeGen
-parent = Libraries
-
-; The component for the actual target library itself.
-[component_3]
-type = Library
-name = Target
-parent = Libraries
-required_libraries = Analysis Core MC Support
-
-; This is a special group whose required libraries are extended (by llvm-build)
-; with every built target, which makes it easy for tools to include every
-; target.
-[component_4]
-type = LibraryGroup
-name = all-targets
-parent = Libraries

diff  --git a/llvm/lib/Target/Lanai/AsmParser/CMakeLists.txt b/llvm/lib/Target/Lanai/AsmParser/CMakeLists.txt
index 9c3b17d427ab..234ef9e94e92 100644
--- a/llvm/lib/Target/Lanai/AsmParser/CMakeLists.txt
+++ b/llvm/lib/Target/Lanai/AsmParser/CMakeLists.txt
@@ -2,6 +2,16 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/
 
 add_llvm_component_library(LLVMLanaiAsmParser
   LanaiAsmParser.cpp
+
+  LINK_COMPONENTS
+  MC
+  MCParser
+  Support
+  LanaiDesc
+  LanaiInfo
+
+  ADD_TO_COMPONENT
+  Lanai
   )
 
 add_dependencies( LLVMLanaiAsmParser LanaiCommonTableGen )

diff  --git a/llvm/lib/Target/Lanai/AsmParser/LLVMBuild.txt b/llvm/lib/Target/Lanai/AsmParser/LLVMBuild.txt
deleted file mode 100644
index 6be970109299..000000000000
--- a/llvm/lib/Target/Lanai/AsmParser/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/Lanai/AsmParser/LLVMBuild.txt ----------------*- Conf -*-===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = LanaiAsmParser
-parent = Lanai
-required_libraries = MC MCParser Support LanaiDesc LanaiInfo
-add_to_library_groups = Lanai

diff  --git a/llvm/lib/Target/Lanai/CMakeLists.txt b/llvm/lib/Target/Lanai/CMakeLists.txt
index 09347e16034d..4a0062ec20e1 100644
--- a/llvm/lib/Target/Lanai/CMakeLists.txt
+++ b/llvm/lib/Target/Lanai/CMakeLists.txt
@@ -1,3 +1,5 @@
+add_llvm_component_group(Lanai)
+
 set(LLVM_TARGET_DEFINITIONS Lanai.td)
 
 tablegen(LLVM LanaiGenAsmMatcher.inc -gen-asm-matcher)
@@ -27,6 +29,23 @@ add_llvm_target(LanaiCodeGen
   LanaiSubtarget.cpp
   LanaiTargetMachine.cpp
   LanaiTargetObjectFile.cpp
+
+  LINK_COMPONENTS
+  Analysis
+  AsmPrinter
+  CodeGen
+  Core
+  LanaiAsmParser
+  LanaiDesc
+  LanaiInfo
+  MC
+  SelectionDAG
+  Support
+  Target
+  TransformUtils
+
+  ADD_TO_COMPONENT
+  Lanai
 )
 
 add_subdirectory(AsmParser)

diff  --git a/llvm/lib/Target/Lanai/Disassembler/CMakeLists.txt b/llvm/lib/Target/Lanai/Disassembler/CMakeLists.txt
index 3be5d4df7f80..cc5af1466ba4 100644
--- a/llvm/lib/Target/Lanai/Disassembler/CMakeLists.txt
+++ b/llvm/lib/Target/Lanai/Disassembler/CMakeLists.txt
@@ -1,3 +1,13 @@
 add_llvm_component_library(LLVMLanaiDisassembler
   LanaiDisassembler.cpp
+
+  LINK_COMPONENTS
+  LanaiDesc
+  LanaiInfo
+  MC
+  MCDisassembler
+  Support
+
+  ADD_TO_COMPONENT
+  Lanai
   )

diff  --git a/llvm/lib/Target/Lanai/Disassembler/LLVMBuild.txt b/llvm/lib/Target/Lanai/Disassembler/LLVMBuild.txt
deleted file mode 100644
index 8bf3384df520..000000000000
--- a/llvm/lib/Target/Lanai/Disassembler/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===-- ./lib/Target/Lanai/Disassembler/LLVMBuild.txt -----------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = LanaiDisassembler
-parent = Lanai
-required_libraries = LanaiDesc LanaiInfo MC MCDisassembler Support
-add_to_library_groups = Lanai

diff  --git a/llvm/lib/Target/Lanai/LLVMBuild.txt b/llvm/lib/Target/Lanai/LLVMBuild.txt
deleted file mode 100644
index 242dc1439b38..000000000000
--- a/llvm/lib/Target/Lanai/LLVMBuild.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-;===- ./lib/Target/Lanai/LLVMBuild.txt -------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = AsmParser Disassembler MCTargetDesc TargetInfo
-
-[component_0]
-type = TargetGroup
-name = Lanai
-parent = Target
-has_asmprinter = 1
-
-[component_1]
-type = Library
-name = LanaiCodeGen
-parent = Lanai
-required_libraries =
- Analysis
- AsmPrinter
- CodeGen
- Core
- LanaiAsmParser
- LanaiDesc
- LanaiInfo
- MC
- SelectionDAG
- Support
- Target
- TransformUtils
-add_to_library_groups = Lanai

diff  --git a/llvm/lib/Target/Lanai/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/Lanai/MCTargetDesc/CMakeLists.txt
index 64a362348a31..2e47710537a3 100644
--- a/llvm/lib/Target/Lanai/MCTargetDesc/CMakeLists.txt
+++ b/llvm/lib/Target/Lanai/MCTargetDesc/CMakeLists.txt
@@ -6,4 +6,13 @@ add_llvm_component_library(LLVMLanaiDesc
   LanaiMCCodeEmitter.cpp
   LanaiMCExpr.cpp
   LanaiMCTargetDesc.cpp
+
+  LINK_COMPONENTS
+  LanaiInfo
+  MC
+  MCDisassembler
+  Support
+
+  ADD_TO_COMPONENT
+  Lanai
 )

diff  --git a/llvm/lib/Target/Lanai/MCTargetDesc/LLVMBuild.txt b/llvm/lib/Target/Lanai/MCTargetDesc/LLVMBuild.txt
deleted file mode 100644
index 948d293f7778..000000000000
--- a/llvm/lib/Target/Lanai/MCTargetDesc/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===-- ./lib/Target/Lanai/MCTargetDesc/LLVMBuild.txt -----------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = LanaiDesc
-parent = Lanai
-required_libraries = LanaiInfo MC MCDisassembler Support
-add_to_library_groups = Lanai

diff  --git a/llvm/lib/Target/Lanai/TargetInfo/CMakeLists.txt b/llvm/lib/Target/Lanai/TargetInfo/CMakeLists.txt
index 26bd58514c3f..96b2329ca4aa 100644
--- a/llvm/lib/Target/Lanai/TargetInfo/CMakeLists.txt
+++ b/llvm/lib/Target/Lanai/TargetInfo/CMakeLists.txt
@@ -1,3 +1,9 @@
 add_llvm_component_library(LLVMLanaiInfo
   LanaiTargetInfo.cpp
+
+  LINK_COMPONENTS
+  Support
+
+  ADD_TO_COMPONENT
+  Lanai
   )

diff  --git a/llvm/lib/Target/Lanai/TargetInfo/LLVMBuild.txt b/llvm/lib/Target/Lanai/TargetInfo/LLVMBuild.txt
deleted file mode 100644
index 312e09a88695..000000000000
--- a/llvm/lib/Target/Lanai/TargetInfo/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/Lanai/TargetInfo/LLVMBuild.txt --------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = LanaiInfo
-parent = Lanai
-required_libraries = Support
-add_to_library_groups = Lanai

diff  --git a/llvm/lib/Target/MSP430/AsmParser/CMakeLists.txt b/llvm/lib/Target/MSP430/AsmParser/CMakeLists.txt
index f87e76cee995..7472f4553ab6 100644
--- a/llvm/lib/Target/MSP430/AsmParser/CMakeLists.txt
+++ b/llvm/lib/Target/MSP430/AsmParser/CMakeLists.txt
@@ -1,3 +1,13 @@
 add_llvm_component_library(LLVMMSP430AsmParser
   MSP430AsmParser.cpp
+
+  LINK_COMPONENTS
+  MC
+  MCParser
+  MSP430Desc
+  MSP430Info
+  Support
+
+  ADD_TO_COMPONENT
+  MSP430
 )

diff  --git a/llvm/lib/Target/MSP430/AsmParser/LLVMBuild.txt b/llvm/lib/Target/MSP430/AsmParser/LLVMBuild.txt
deleted file mode 100644
index fd0e0a1e2867..000000000000
--- a/llvm/lib/Target/MSP430/AsmParser/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- lib/Target/MSP430/AsmParser/LLVMBuild.txt ----------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = MSP430AsmParser
-parent = MSP430
-required_libraries = MC MCParser MSP430Desc MSP430Info Support
-add_to_library_groups = MSP430

diff  --git a/llvm/lib/Target/MSP430/CMakeLists.txt b/llvm/lib/Target/MSP430/CMakeLists.txt
index 4902cee5de28..5583482296f4 100644
--- a/llvm/lib/Target/MSP430/CMakeLists.txt
+++ b/llvm/lib/Target/MSP430/CMakeLists.txt
@@ -1,3 +1,5 @@
+add_llvm_component_group(MSP430)
+
 set(LLVM_TARGET_DEFINITIONS MSP430.td)
 
 tablegen(LLVM MSP430GenAsmMatcher.inc -gen-asm-matcher)
@@ -24,6 +26,20 @@ add_llvm_target(MSP430CodeGen
   MSP430TargetMachine.cpp
   MSP430AsmPrinter.cpp
   MSP430MCInstLower.cpp
+
+  LINK_COMPONENTS
+  AsmPrinter
+  CodeGen
+  Core
+  MC
+  MSP430Desc
+  MSP430Info
+  SelectionDAG
+  Support
+  Target
+
+  ADD_TO_COMPONENT
+  MSP430
   )
 
 add_subdirectory(MCTargetDesc)

diff  --git a/llvm/lib/Target/MSP430/Disassembler/CMakeLists.txt b/llvm/lib/Target/MSP430/Disassembler/CMakeLists.txt
index 42dea5ddeba4..9c99b1902eac 100644
--- a/llvm/lib/Target/MSP430/Disassembler/CMakeLists.txt
+++ b/llvm/lib/Target/MSP430/Disassembler/CMakeLists.txt
@@ -1,3 +1,11 @@
 add_llvm_component_library(LLVMMSP430Disassembler
   MSP430Disassembler.cpp
+
+  LINK_COMPONENTS
+  MCDisassembler
+  MSP430Info
+  Support
+
+  ADD_TO_COMPONENT
+  MSP430
   )

diff  --git a/llvm/lib/Target/MSP430/Disassembler/LLVMBuild.txt b/llvm/lib/Target/MSP430/Disassembler/LLVMBuild.txt
deleted file mode 100644
index e93f288e787b..000000000000
--- a/llvm/lib/Target/MSP430/Disassembler/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;====- lib/Target/MSP430/Disassembler/LLVMBuild.txt ------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = MSP430Disassembler
-parent = MSP430
-required_libraries = MCDisassembler MSP430Info Support
-add_to_library_groups = MSP430

diff  --git a/llvm/lib/Target/MSP430/LLVMBuild.txt b/llvm/lib/Target/MSP430/LLVMBuild.txt
deleted file mode 100644
index 046301f90e3a..000000000000
--- a/llvm/lib/Target/MSP430/LLVMBuild.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-;===- ./lib/Target/MSP430/LLVMBuild.txt ------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = AsmParser Disassembler MCTargetDesc TargetInfo
-
-[component_0]
-type = TargetGroup
-name = MSP430
-parent = Target
-has_asmparser = 1
-has_asmprinter = 1
-has_disassembler = 1
-
-[component_1]
-type = Library
-name = MSP430CodeGen
-parent = MSP430
-required_libraries = AsmPrinter CodeGen Core MC MSP430Desc MSP430Info SelectionDAG Support Target
-add_to_library_groups = MSP430

diff  --git a/llvm/lib/Target/MSP430/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/MSP430/MCTargetDesc/CMakeLists.txt
index 22b6ec6d8a9f..a19b1058fd1e 100644
--- a/llvm/lib/Target/MSP430/MCTargetDesc/CMakeLists.txt
+++ b/llvm/lib/Target/MSP430/MCTargetDesc/CMakeLists.txt
@@ -6,4 +6,12 @@ add_llvm_component_library(LLVMMSP430Desc
   MSP430MCAsmInfo.cpp
   MSP430MCCodeEmitter.cpp
   MSP430MCTargetDesc.cpp
+
+  LINK_COMPONENTS
+  MC
+  MSP430Info
+  Support
+
+  ADD_TO_COMPONENT
+  MSP430
   )

diff  --git a/llvm/lib/Target/MSP430/MCTargetDesc/LLVMBuild.txt b/llvm/lib/Target/MSP430/MCTargetDesc/LLVMBuild.txt
deleted file mode 100644
index a2a0dd268d12..000000000000
--- a/llvm/lib/Target/MSP430/MCTargetDesc/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/MSP430/MCTargetDesc/LLVMBuild.txt -----------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = MSP430Desc
-parent = MSP430
-required_libraries = MC MSP430Info Support
-add_to_library_groups = MSP430

diff  --git a/llvm/lib/Target/MSP430/TargetInfo/CMakeLists.txt b/llvm/lib/Target/MSP430/TargetInfo/CMakeLists.txt
index 369ca8dbf3d2..40899ed2e5a5 100644
--- a/llvm/lib/Target/MSP430/TargetInfo/CMakeLists.txt
+++ b/llvm/lib/Target/MSP430/TargetInfo/CMakeLists.txt
@@ -1,3 +1,9 @@
 add_llvm_component_library(LLVMMSP430Info
   MSP430TargetInfo.cpp
+
+  LINK_COMPONENTS
+  Support
+
+  ADD_TO_COMPONENT
+  MSP430
   )

diff  --git a/llvm/lib/Target/MSP430/TargetInfo/LLVMBuild.txt b/llvm/lib/Target/MSP430/TargetInfo/LLVMBuild.txt
deleted file mode 100644
index ef994470860a..000000000000
--- a/llvm/lib/Target/MSP430/TargetInfo/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/MSP430/TargetInfo/LLVMBuild.txt -------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = MSP430Info
-parent = MSP430
-required_libraries = Support
-add_to_library_groups = MSP430

diff  --git a/llvm/lib/Target/Mips/AsmParser/CMakeLists.txt b/llvm/lib/Target/Mips/AsmParser/CMakeLists.txt
index e21bd7bfbbb5..b8088468fa98 100644
--- a/llvm/lib/Target/Mips/AsmParser/CMakeLists.txt
+++ b/llvm/lib/Target/Mips/AsmParser/CMakeLists.txt
@@ -1,3 +1,13 @@
 add_llvm_component_library(LLVMMipsAsmParser
   MipsAsmParser.cpp
+
+  LINK_COMPONENTS
+  MC
+  MCParser
+  MipsDesc
+  MipsInfo
+  Support
+
+  ADD_TO_COMPONENT
+  Mips
   )

diff  --git a/llvm/lib/Target/Mips/AsmParser/LLVMBuild.txt b/llvm/lib/Target/Mips/AsmParser/LLVMBuild.txt
deleted file mode 100644
index 99703a5a7c85..000000000000
--- a/llvm/lib/Target/Mips/AsmParser/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/Mips/AsmParser/LLVMBuild.txt ----------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = MipsAsmParser
-parent = Mips
-required_libraries = MC MCParser MipsDesc MipsInfo Support
-add_to_library_groups = Mips

diff  --git a/llvm/lib/Target/Mips/CMakeLists.txt b/llvm/lib/Target/Mips/CMakeLists.txt
index 0ac2d8a687d0..cbfd187fdfa2 100644
--- a/llvm/lib/Target/Mips/CMakeLists.txt
+++ b/llvm/lib/Target/Mips/CMakeLists.txt
@@ -1,3 +1,5 @@
+add_llvm_component_group(Mips HAS_JIT)
+
 set(LLVM_TARGET_DEFINITIONS Mips.td)
 
 tablegen(LLVM MipsGenAsmMatcher.inc -gen-asm-matcher)
@@ -57,6 +59,22 @@ add_llvm_target(MipsCodeGen
   MipsTargetMachine.cpp
   MipsTargetObjectFile.cpp
   MicroMipsSizeReduction.cpp
+
+  LINK_COMPONENTS
+  Analysis
+  AsmPrinter
+  CodeGen
+  Core
+  MC
+  MipsDesc
+  MipsInfo
+  SelectionDAG
+  Support
+  Target
+  GlobalISel
+
+  ADD_TO_COMPONENT
+  Mips
   )
 
 add_subdirectory(AsmParser)

diff  --git a/llvm/lib/Target/Mips/Disassembler/CMakeLists.txt b/llvm/lib/Target/Mips/Disassembler/CMakeLists.txt
index 7de3f263a371..eaeb9d4cc790 100644
--- a/llvm/lib/Target/Mips/Disassembler/CMakeLists.txt
+++ b/llvm/lib/Target/Mips/Disassembler/CMakeLists.txt
@@ -1,3 +1,11 @@
 add_llvm_component_library(LLVMMipsDisassembler
   MipsDisassembler.cpp
+
+  LINK_COMPONENTS
+  MCDisassembler
+  MipsInfo
+  Support
+
+  ADD_TO_COMPONENT
+  Mips
   )

diff  --git a/llvm/lib/Target/Mips/Disassembler/LLVMBuild.txt b/llvm/lib/Target/Mips/Disassembler/LLVMBuild.txt
deleted file mode 100644
index 611bdac35aaf..000000000000
--- a/llvm/lib/Target/Mips/Disassembler/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/Mips/Disassembler/LLVMBuild.txt -------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = MipsDisassembler
-parent = Mips
-required_libraries = MCDisassembler MipsInfo Support
-add_to_library_groups = Mips

diff  --git a/llvm/lib/Target/Mips/LLVMBuild.txt b/llvm/lib/Target/Mips/LLVMBuild.txt
deleted file mode 100644
index 133fb377bb2b..000000000000
--- a/llvm/lib/Target/Mips/LLVMBuild.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-;===- ./lib/Target/Mips/LLVMBuild.txt --------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = AsmParser Disassembler MCTargetDesc TargetInfo
-
-[component_0]
-type = TargetGroup
-name = Mips
-parent = Target
-has_asmparser = 1
-has_asmprinter = 1
-has_disassembler = 1
-has_jit = 1
-
-[component_1]
-type = Library
-name = MipsCodeGen
-parent = Mips
-required_libraries =
- Analysis
- AsmPrinter
- CodeGen
- Core
- MC
- MipsDesc
- MipsInfo
- SelectionDAG
- Support
- Target
- GlobalISel
-add_to_library_groups = Mips

diff  --git a/llvm/lib/Target/Mips/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/Mips/MCTargetDesc/CMakeLists.txt
index 10e2e93af6fd..38be3add8ecb 100644
--- a/llvm/lib/Target/Mips/MCTargetDesc/CMakeLists.txt
+++ b/llvm/lib/Target/Mips/MCTargetDesc/CMakeLists.txt
@@ -12,4 +12,12 @@ add_llvm_component_library(LLVMMipsDesc
   MipsNaClELFStreamer.cpp
   MipsOptionRecord.cpp
   MipsTargetStreamer.cpp
+
+  LINK_COMPONENTS
+  MC
+  MipsInfo
+  Support
+
+  ADD_TO_COMPONENT
+  Mips
   )

diff  --git a/llvm/lib/Target/Mips/MCTargetDesc/LLVMBuild.txt b/llvm/lib/Target/Mips/MCTargetDesc/LLVMBuild.txt
deleted file mode 100644
index 048b1fe1cf8a..000000000000
--- a/llvm/lib/Target/Mips/MCTargetDesc/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/Mips/MCTargetDesc/LLVMBuild.txt -------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = MipsDesc
-parent = Mips
-required_libraries = MC MipsInfo Support
-add_to_library_groups = Mips

diff  --git a/llvm/lib/Target/Mips/TargetInfo/CMakeLists.txt b/llvm/lib/Target/Mips/TargetInfo/CMakeLists.txt
index 93565ea186c8..9d8f0b532704 100644
--- a/llvm/lib/Target/Mips/TargetInfo/CMakeLists.txt
+++ b/llvm/lib/Target/Mips/TargetInfo/CMakeLists.txt
@@ -1,3 +1,9 @@
 add_llvm_component_library(LLVMMipsInfo
   MipsTargetInfo.cpp
+
+  LINK_COMPONENTS
+  Support
+
+  ADD_TO_COMPONENT
+  Mips
   )

diff  --git a/llvm/lib/Target/Mips/TargetInfo/LLVMBuild.txt b/llvm/lib/Target/Mips/TargetInfo/LLVMBuild.txt
deleted file mode 100644
index 38ab068612b4..000000000000
--- a/llvm/lib/Target/Mips/TargetInfo/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/Mips/TargetInfo/LLVMBuild.txt ---------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = MipsInfo
-parent = Mips
-required_libraries = Support
-add_to_library_groups = Mips

diff  --git a/llvm/lib/Target/NVPTX/CMakeLists.txt b/llvm/lib/Target/NVPTX/CMakeLists.txt
index 03d6201c9c60..6a678ec57066 100644
--- a/llvm/lib/Target/NVPTX/CMakeLists.txt
+++ b/llvm/lib/Target/NVPTX/CMakeLists.txt
@@ -1,3 +1,5 @@
+add_llvm_component_group(NVPTX)
+
 set(LLVM_TARGET_DEFINITIONS NVPTX.td)
 
 tablegen(LLVM NVPTXGenAsmWriter.inc -gen-asm-writer)
@@ -35,7 +37,28 @@ set(NVPTXCodeGen_sources
   NVPTXProxyRegErasure.cpp
   )
 
-add_llvm_target(NVPTXCodeGen ${NVPTXCodeGen_sources})
+add_llvm_target(NVPTXCodeGen
+  ${NVPTXCodeGen_sources}
+
+  LINK_COMPONENTS
+  Analysis
+  AsmPrinter
+  CodeGen
+  Core
+  IPO
+  MC
+  NVPTXDesc
+  NVPTXInfo
+  Scalar
+  SelectionDAG
+  Support
+  Target
+  TransformUtils
+  Vectorize
+
+  ADD_TO_COMPONENT
+  NVPTX
+)
 
 add_subdirectory(MCTargetDesc)
 add_subdirectory(TargetInfo)

diff  --git a/llvm/lib/Target/NVPTX/LLVMBuild.txt b/llvm/lib/Target/NVPTX/LLVMBuild.txt
deleted file mode 100644
index 56aaebddab58..000000000000
--- a/llvm/lib/Target/NVPTX/LLVMBuild.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-;===- ./lib/Target/NVPTX/LLVMBuild.txt -------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = MCTargetDesc TargetInfo
-
-[component_0]
-type = TargetGroup
-name = NVPTX
-parent = Target
-has_asmprinter = 1
-
-[component_1]
-type = Library
-name = NVPTXCodeGen
-parent = NVPTX
-required_libraries = Analysis AsmPrinter CodeGen Core IPO MC NVPTXDesc NVPTXInfo Scalar SelectionDAG Support Target TransformUtils Vectorize
-add_to_library_groups = NVPTX

diff  --git a/llvm/lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt
index c80e7acbf9f9..ab6c04c099c5 100644
--- a/llvm/lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt
+++ b/llvm/lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt
@@ -3,4 +3,12 @@ add_llvm_component_library(LLVMNVPTXDesc
   NVPTXMCAsmInfo.cpp
   NVPTXMCTargetDesc.cpp
   NVPTXTargetStreamer.cpp
+
+  LINK_COMPONENTS
+  MC
+  NVPTXInfo
+  Support
+
+  ADD_TO_COMPONENT
+  NVPTX
   )

diff  --git a/llvm/lib/Target/NVPTX/MCTargetDesc/LLVMBuild.txt b/llvm/lib/Target/NVPTX/MCTargetDesc/LLVMBuild.txt
deleted file mode 100644
index 538b675e1657..000000000000
--- a/llvm/lib/Target/NVPTX/MCTargetDesc/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/NVPTX/MCTargetDesc/LLVMBuild.txt ------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = NVPTXDesc
-parent = NVPTX
-required_libraries = MC NVPTXInfo Support
-add_to_library_groups = NVPTX

diff  --git a/llvm/lib/Target/NVPTX/TargetInfo/CMakeLists.txt b/llvm/lib/Target/NVPTX/TargetInfo/CMakeLists.txt
index f9bfd970076b..b35676032c02 100644
--- a/llvm/lib/Target/NVPTX/TargetInfo/CMakeLists.txt
+++ b/llvm/lib/Target/NVPTX/TargetInfo/CMakeLists.txt
@@ -1,3 +1,9 @@
 add_llvm_component_library(LLVMNVPTXInfo
   NVPTXTargetInfo.cpp
+
+  LINK_COMPONENTS
+  Support
+
+  ADD_TO_COMPONENT
+  NVPTX
   )

diff  --git a/llvm/lib/Target/NVPTX/TargetInfo/LLVMBuild.txt b/llvm/lib/Target/NVPTX/TargetInfo/LLVMBuild.txt
deleted file mode 100644
index fa5ac6901390..000000000000
--- a/llvm/lib/Target/NVPTX/TargetInfo/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/NVPTX/TargetInfo/LLVMBuild.txt --------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = NVPTXInfo
-parent = NVPTX
-required_libraries = Support
-add_to_library_groups = NVPTX

diff  --git a/llvm/lib/Target/PowerPC/AsmParser/CMakeLists.txt b/llvm/lib/Target/PowerPC/AsmParser/CMakeLists.txt
index 6328c4cc3e76..4c1f081d712e 100644
--- a/llvm/lib/Target/PowerPC/AsmParser/CMakeLists.txt
+++ b/llvm/lib/Target/PowerPC/AsmParser/CMakeLists.txt
@@ -1,3 +1,13 @@
 add_llvm_component_library(LLVMPowerPCAsmParser
   PPCAsmParser.cpp
+
+  LINK_COMPONENTS
+  MC
+  MCParser
+  PowerPCDesc
+  PowerPCInfo
+  Support
+
+  ADD_TO_COMPONENT
+  PowerPC
   )

diff  --git a/llvm/lib/Target/PowerPC/AsmParser/LLVMBuild.txt b/llvm/lib/Target/PowerPC/AsmParser/LLVMBuild.txt
deleted file mode 100644
index 20ea0ef2ae48..000000000000
--- a/llvm/lib/Target/PowerPC/AsmParser/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/PowerPC/AsmParser/LLVMBuild.txt -------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = PowerPCAsmParser
-parent = PowerPC
-required_libraries = MC MCParser PowerPCDesc PowerPCInfo Support
-add_to_library_groups = PowerPC

diff  --git a/llvm/lib/Target/PowerPC/CMakeLists.txt b/llvm/lib/Target/PowerPC/CMakeLists.txt
index 882fb0a5b7e2..eb2aa3929fd7 100644
--- a/llvm/lib/Target/PowerPC/CMakeLists.txt
+++ b/llvm/lib/Target/PowerPC/CMakeLists.txt
@@ -1,3 +1,5 @@
+add_llvm_component_group(PowerPC HAS_JIT)
+
 set(LLVM_TARGET_DEFINITIONS PPC.td)
 
 tablegen(LLVM PPCGenAsmMatcher.inc -gen-asm-matcher)
@@ -55,6 +57,24 @@ add_llvm_target(PowerPCCodeGen
   GISel/PPCCallLowering.cpp
   GISel/PPCRegisterBankInfo.cpp
   GISel/PPCLegalizerInfo.cpp
+
+  LINK_COMPONENTS
+  Analysis
+  AsmPrinter
+  CodeGen
+  Core
+  MC
+  PowerPCDesc
+  PowerPCInfo
+  Scalar
+  SelectionDAG
+  Support
+  Target
+  TransformUtils
+  GlobalISel
+
+  ADD_TO_COMPONENT
+  PowerPC
   )
 
 add_subdirectory(AsmParser)

diff  --git a/llvm/lib/Target/PowerPC/Disassembler/CMakeLists.txt b/llvm/lib/Target/PowerPC/Disassembler/CMakeLists.txt
index 37e5a5516295..60ce3a0005d9 100644
--- a/llvm/lib/Target/PowerPC/Disassembler/CMakeLists.txt
+++ b/llvm/lib/Target/PowerPC/Disassembler/CMakeLists.txt
@@ -1,3 +1,11 @@
 add_llvm_component_library(LLVMPowerPCDisassembler
   PPCDisassembler.cpp
+
+  LINK_COMPONENTS
+  MCDisassembler
+  PowerPCInfo
+  Support
+
+  ADD_TO_COMPONENT
+  PowerPC
   )

diff  --git a/llvm/lib/Target/PowerPC/Disassembler/LLVMBuild.txt b/llvm/lib/Target/PowerPC/Disassembler/LLVMBuild.txt
deleted file mode 100644
index 5d9de6d16c20..000000000000
--- a/llvm/lib/Target/PowerPC/Disassembler/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===-- ./lib/Target/PowerPC/Disassembler/LLVMBuild.txt ---------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = PowerPCDisassembler
-parent = PowerPC
-required_libraries = MCDisassembler PowerPCInfo Support
-add_to_library_groups = PowerPC

diff  --git a/llvm/lib/Target/PowerPC/LLVMBuild.txt b/llvm/lib/Target/PowerPC/LLVMBuild.txt
deleted file mode 100644
index ed38d2a40214..000000000000
--- a/llvm/lib/Target/PowerPC/LLVMBuild.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-;===- ./lib/Target/PowerPC/LLVMBuild.txt -----------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = AsmParser Disassembler MCTargetDesc TargetInfo
-
-[component_0]
-type = TargetGroup
-name = PowerPC
-parent = Target
-has_asmparser = 1
-has_asmprinter = 1
-has_disassembler = 1
-has_jit = 1
-
-[component_1]
-type = Library
-name = PowerPCCodeGen
-parent = PowerPC
-required_libraries = Analysis AsmPrinter CodeGen Core MC PowerPCDesc PowerPCInfo Scalar SelectionDAG Support Target TransformUtils GlobalISel
-add_to_library_groups = PowerPC

diff  --git a/llvm/lib/Target/PowerPC/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/PowerPC/MCTargetDesc/CMakeLists.txt
index be138c53095f..75c81e512362 100644
--- a/llvm/lib/Target/PowerPC/MCTargetDesc/CMakeLists.txt
+++ b/llvm/lib/Target/PowerPC/MCTargetDesc/CMakeLists.txt
@@ -9,4 +9,13 @@ add_llvm_component_library(LLVMPowerPCDesc
   PPCELFObjectWriter.cpp
   PPCXCOFFObjectWriter.cpp
   PPCELFStreamer.cpp
+
+  LINK_COMPONENTS
+  MC
+  PowerPCInfo
+  Support
+  BinaryFormat
+
+  ADD_TO_COMPONENT
+  PowerPC
   )

diff  --git a/llvm/lib/Target/PowerPC/MCTargetDesc/LLVMBuild.txt b/llvm/lib/Target/PowerPC/MCTargetDesc/LLVMBuild.txt
deleted file mode 100644
index f214f722afdb..000000000000
--- a/llvm/lib/Target/PowerPC/MCTargetDesc/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/PowerPC/MCTargetDesc/LLVMBuild.txt ----------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = PowerPCDesc
-parent = PowerPC
-required_libraries = MC PowerPCInfo Support BinaryFormat
-add_to_library_groups = PowerPC

diff  --git a/llvm/lib/Target/PowerPC/TargetInfo/CMakeLists.txt b/llvm/lib/Target/PowerPC/TargetInfo/CMakeLists.txt
index 3200a75b32a8..c182f8913812 100644
--- a/llvm/lib/Target/PowerPC/TargetInfo/CMakeLists.txt
+++ b/llvm/lib/Target/PowerPC/TargetInfo/CMakeLists.txt
@@ -1,3 +1,9 @@
 add_llvm_component_library(LLVMPowerPCInfo
   PowerPCTargetInfo.cpp
+
+  LINK_COMPONENTS
+  Support
+
+  ADD_TO_COMPONENT
+  PowerPC
   )

diff  --git a/llvm/lib/Target/PowerPC/TargetInfo/LLVMBuild.txt b/llvm/lib/Target/PowerPC/TargetInfo/LLVMBuild.txt
deleted file mode 100644
index dc7439901321..000000000000
--- a/llvm/lib/Target/PowerPC/TargetInfo/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/PowerPC/TargetInfo/LLVMBuild.txt ------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = PowerPCInfo
-parent = PowerPC
-required_libraries = Support
-add_to_library_groups = PowerPC

diff  --git a/llvm/lib/Target/RISCV/AsmParser/CMakeLists.txt b/llvm/lib/Target/RISCV/AsmParser/CMakeLists.txt
index a0f54d10fd1c..ca1b0b6f6016 100644
--- a/llvm/lib/Target/RISCV/AsmParser/CMakeLists.txt
+++ b/llvm/lib/Target/RISCV/AsmParser/CMakeLists.txt
@@ -1,3 +1,14 @@
 add_llvm_component_library(LLVMRISCVAsmParser
   RISCVAsmParser.cpp
+
+  LINK_COMPONENTS
+  MC
+  MCParser
+  RISCVDesc
+  RISCVInfo
+  RISCVUtils
+  Support
+
+  ADD_TO_COMPONENT
+  RISCV
   )

diff  --git a/llvm/lib/Target/RISCV/AsmParser/LLVMBuild.txt b/llvm/lib/Target/RISCV/AsmParser/LLVMBuild.txt
deleted file mode 100644
index 64f2a20cb1cc..000000000000
--- a/llvm/lib/Target/RISCV/AsmParser/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/RISCV/AsmParser/LLVMBuild.txt ---------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = RISCVAsmParser
-parent = RISCV
-required_libraries = MC MCParser RISCVDesc RISCVInfo RISCVUtils Support
-add_to_library_groups = RISCV

diff  --git a/llvm/lib/Target/RISCV/CMakeLists.txt b/llvm/lib/Target/RISCV/CMakeLists.txt
index 9a0c2209c885..f0dce3bc8d85 100644
--- a/llvm/lib/Target/RISCV/CMakeLists.txt
+++ b/llvm/lib/Target/RISCV/CMakeLists.txt
@@ -1,3 +1,5 @@
+add_llvm_component_group(RISCV)
+
 set(LLVM_TARGET_DEFINITIONS RISCV.td)
 
 tablegen(LLVM RISCVGenAsmMatcher.inc -gen-asm-matcher)
@@ -35,6 +37,23 @@ add_llvm_target(RISCVCodeGen
   RISCVTargetMachine.cpp
   RISCVTargetObjectFile.cpp
   RISCVTargetTransformInfo.cpp
+
+  LINK_COMPONENTS
+  Analysis
+  AsmPrinter
+  Core
+  CodeGen
+  MC
+  RISCVDesc
+  RISCVInfo
+  RISCVUtils
+  SelectionDAG
+  Support
+  Target
+  GlobalISel
+
+  ADD_TO_COMPONENT
+  RISCV
   )
 
 add_subdirectory(AsmParser)

diff  --git a/llvm/lib/Target/RISCV/Disassembler/CMakeLists.txt b/llvm/lib/Target/RISCV/Disassembler/CMakeLists.txt
index df2fce65b839..b0aae875f994 100644
--- a/llvm/lib/Target/RISCV/Disassembler/CMakeLists.txt
+++ b/llvm/lib/Target/RISCV/Disassembler/CMakeLists.txt
@@ -1,3 +1,11 @@
 add_llvm_component_library(LLVMRISCVDisassembler
   RISCVDisassembler.cpp
+
+  LINK_COMPONENTS
+  MCDisassembler
+  RISCVInfo
+  Support
+
+  ADD_TO_COMPONENT
+  RISCV
   )

diff  --git a/llvm/lib/Target/RISCV/Disassembler/LLVMBuild.txt b/llvm/lib/Target/RISCV/Disassembler/LLVMBuild.txt
deleted file mode 100644
index e69a640cf7e7..000000000000
--- a/llvm/lib/Target/RISCV/Disassembler/LLVMBuild.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-;===- ./lib/Target/RISCV/Disassembler/LLVMBuild.txt ------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = RISCVDisassembler
-parent = RISCV
-required_libraries = MCDisassembler RISCVInfo Support
-add_to_library_groups = RISCV
-

diff  --git a/llvm/lib/Target/RISCV/LLVMBuild.txt b/llvm/lib/Target/RISCV/LLVMBuild.txt
deleted file mode 100644
index 38012b2f27f7..000000000000
--- a/llvm/lib/Target/RISCV/LLVMBuild.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-;===- ./lib/Target/RISCV/LLVMBuild.txt -------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = AsmParser Disassembler TargetInfo MCTargetDesc Utils
-
-[component_0]
-type = TargetGroup
-name = RISCV
-parent = Target
-has_asmparser = 1
-has_asmprinter = 1
-has_disassembler = 1
-
-[component_1]
-type = Library
-name = RISCVCodeGen
-parent = RISCV
-required_libraries = Analysis AsmPrinter Core CodeGen MC RISCVDesc
-  RISCVInfo RISCVUtils SelectionDAG Support Target GlobalISel
-add_to_library_groups = RISCV

diff  --git a/llvm/lib/Target/RISCV/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/RISCV/MCTargetDesc/CMakeLists.txt
index df2d15dc7983..d17457ff4c5a 100644
--- a/llvm/lib/Target/RISCV/MCTargetDesc/CMakeLists.txt
+++ b/llvm/lib/Target/RISCV/MCTargetDesc/CMakeLists.txt
@@ -8,4 +8,13 @@ add_llvm_component_library(LLVMRISCVDesc
   RISCVMCTargetDesc.cpp
   RISCVTargetStreamer.cpp
   RISCVELFStreamer.cpp
+
+  LINK_COMPONENTS
+  MC
+  RISCVInfo
+  RISCVUtils
+  Support
+
+  ADD_TO_COMPONENT
+  RISCV
 )

diff  --git a/llvm/lib/Target/RISCV/MCTargetDesc/LLVMBuild.txt b/llvm/lib/Target/RISCV/MCTargetDesc/LLVMBuild.txt
deleted file mode 100644
index eeb1c45a3ecd..000000000000
--- a/llvm/lib/Target/RISCV/MCTargetDesc/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/RISCV/MCTargetDesc/LLVMBuild.txt ------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = RISCVDesc
-parent = RISCV
-required_libraries = MC RISCVInfo RISCVUtils Support
-add_to_library_groups = RISCV

diff  --git a/llvm/lib/Target/RISCV/TargetInfo/CMakeLists.txt b/llvm/lib/Target/RISCV/TargetInfo/CMakeLists.txt
index 7768678c9484..f760c639d54d 100644
--- a/llvm/lib/Target/RISCV/TargetInfo/CMakeLists.txt
+++ b/llvm/lib/Target/RISCV/TargetInfo/CMakeLists.txt
@@ -1,3 +1,9 @@
 add_llvm_component_library(LLVMRISCVInfo
   RISCVTargetInfo.cpp
+
+  LINK_COMPONENTS
+  Support
+
+  ADD_TO_COMPONENT
+  RISCV
   )

diff  --git a/llvm/lib/Target/RISCV/TargetInfo/LLVMBuild.txt b/llvm/lib/Target/RISCV/TargetInfo/LLVMBuild.txt
deleted file mode 100644
index 632cfcf24332..000000000000
--- a/llvm/lib/Target/RISCV/TargetInfo/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/RISCV/TargetInfo/LLVMBuild.txt --------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = RISCVInfo
-parent = RISCV
-required_libraries = Support
-add_to_library_groups = RISCV

diff  --git a/llvm/lib/Target/RISCV/Utils/CMakeLists.txt b/llvm/lib/Target/RISCV/Utils/CMakeLists.txt
index b1f73ab30342..f3c83bfce70d 100644
--- a/llvm/lib/Target/RISCV/Utils/CMakeLists.txt
+++ b/llvm/lib/Target/RISCV/Utils/CMakeLists.txt
@@ -1,4 +1,10 @@
 add_llvm_component_library(LLVMRISCVUtils
   RISCVBaseInfo.cpp
   RISCVMatInt.cpp
+
+  LINK_COMPONENTS
+  Support
+
+  ADD_TO_COMPONENT
+  RISCV
   )

diff  --git a/llvm/lib/Target/RISCV/Utils/LLVMBuild.txt b/llvm/lib/Target/RISCV/Utils/LLVMBuild.txt
deleted file mode 100644
index 4803c939fa7a..000000000000
--- a/llvm/lib/Target/RISCV/Utils/LLVMBuild.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-;===- ./lib/Target/RISCV/Utils/LLVMBuild.txt ----------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = RISCVUtils
-parent = RISCV
-required_libraries = Support
-add_to_library_groups = RISCV
-

diff  --git a/llvm/lib/Target/Sparc/AsmParser/CMakeLists.txt b/llvm/lib/Target/Sparc/AsmParser/CMakeLists.txt
index cf8f96bcbb0d..c04c25f457b1 100644
--- a/llvm/lib/Target/Sparc/AsmParser/CMakeLists.txt
+++ b/llvm/lib/Target/Sparc/AsmParser/CMakeLists.txt
@@ -1,3 +1,13 @@
 add_llvm_component_library(LLVMSparcAsmParser
   SparcAsmParser.cpp
+
+  LINK_COMPONENTS
+  MC
+  MCParser
+  SparcDesc
+  SparcInfo
+  Support
+
+  ADD_TO_COMPONENT
+  Sparc
   )

diff  --git a/llvm/lib/Target/Sparc/AsmParser/LLVMBuild.txt b/llvm/lib/Target/Sparc/AsmParser/LLVMBuild.txt
deleted file mode 100644
index 43efc2371922..000000000000
--- a/llvm/lib/Target/Sparc/AsmParser/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/Sparc/AsmParser/LLVMBuild.txt ---------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = SparcAsmParser
-parent = Sparc
-required_libraries = MC MCParser SparcDesc SparcInfo Support
-add_to_library_groups = Sparc

diff  --git a/llvm/lib/Target/Sparc/CMakeLists.txt b/llvm/lib/Target/Sparc/CMakeLists.txt
index e94dc5b03f84..5ad871be8771 100644
--- a/llvm/lib/Target/Sparc/CMakeLists.txt
+++ b/llvm/lib/Target/Sparc/CMakeLists.txt
@@ -1,3 +1,5 @@
+add_llvm_component_group(Sparc HAS_JIT)
+
 set(LLVM_TARGET_DEFINITIONS Sparc.td)
 
 tablegen(LLVM SparcGenAsmMatcher.inc -gen-asm-matcher)
@@ -26,6 +28,20 @@ add_llvm_target(SparcCodeGen
   SparcTargetMachine.cpp
   SparcMCInstLower.cpp
   SparcTargetObjectFile.cpp
+
+  LINK_COMPONENTS
+  AsmPrinter
+  CodeGen
+  Core
+  MC
+  SelectionDAG
+  SparcDesc
+  SparcInfo
+  Support
+  Target
+
+  ADD_TO_COMPONENT
+  Sparc
   )
 
 add_subdirectory(AsmParser)

diff  --git a/llvm/lib/Target/Sparc/Disassembler/CMakeLists.txt b/llvm/lib/Target/Sparc/Disassembler/CMakeLists.txt
index b891334d6799..287e81329928 100644
--- a/llvm/lib/Target/Sparc/Disassembler/CMakeLists.txt
+++ b/llvm/lib/Target/Sparc/Disassembler/CMakeLists.txt
@@ -1,3 +1,11 @@
 add_llvm_component_library(LLVMSparcDisassembler
   SparcDisassembler.cpp
+
+  LINK_COMPONENTS
+  MCDisassembler
+  SparcInfo
+  Support
+
+  ADD_TO_COMPONENT
+  Sparc
   )

diff  --git a/llvm/lib/Target/Sparc/Disassembler/LLVMBuild.txt b/llvm/lib/Target/Sparc/Disassembler/LLVMBuild.txt
deleted file mode 100644
index 8a9a205dfb25..000000000000
--- a/llvm/lib/Target/Sparc/Disassembler/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/Sparc/Disassembler/LLVMBuild.txt ------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = SparcDisassembler
-parent = Sparc
-required_libraries = MCDisassembler SparcInfo Support
-add_to_library_groups = Sparc

diff  --git a/llvm/lib/Target/Sparc/LLVMBuild.txt b/llvm/lib/Target/Sparc/LLVMBuild.txt
deleted file mode 100644
index b9db8e66d120..000000000000
--- a/llvm/lib/Target/Sparc/LLVMBuild.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-;===- ./lib/Target/Sparc/LLVMBuild.txt -------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = AsmParser Disassembler MCTargetDesc TargetInfo
-
-[component_0]
-type = TargetGroup
-name = Sparc
-parent = Target
-has_asmparser = 1
-has_asmprinter = 1
-has_disassembler = 1
-has_jit = 1
-
-[component_1]
-type = Library
-name = SparcCodeGen
-parent = Sparc
-required_libraries = AsmPrinter CodeGen Core MC SelectionDAG
-                     SparcDesc SparcInfo Support Target
-add_to_library_groups = Sparc

diff  --git a/llvm/lib/Target/Sparc/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/Sparc/MCTargetDesc/CMakeLists.txt
index 311f374a1c11..99c21c16dddc 100644
--- a/llvm/lib/Target/Sparc/MCTargetDesc/CMakeLists.txt
+++ b/llvm/lib/Target/Sparc/MCTargetDesc/CMakeLists.txt
@@ -7,4 +7,12 @@ add_llvm_component_library(LLVMSparcDesc
   SparcMCTargetDesc.cpp
   SparcMCExpr.cpp
   SparcTargetStreamer.cpp
+
+  LINK_COMPONENTS
+  MC
+  SparcInfo
+  Support
+
+  ADD_TO_COMPONENT
+  Sparc
   )

diff  --git a/llvm/lib/Target/Sparc/MCTargetDesc/LLVMBuild.txt b/llvm/lib/Target/Sparc/MCTargetDesc/LLVMBuild.txt
deleted file mode 100644
index 1bb88127eb32..000000000000
--- a/llvm/lib/Target/Sparc/MCTargetDesc/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/Sparc/MCTargetDesc/LLVMBuild.txt ------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = SparcDesc
-parent = Sparc
-required_libraries = MC SparcInfo Support
-add_to_library_groups = Sparc

diff  --git a/llvm/lib/Target/Sparc/TargetInfo/CMakeLists.txt b/llvm/lib/Target/Sparc/TargetInfo/CMakeLists.txt
index 42cbe008018f..39d2974c4ef1 100644
--- a/llvm/lib/Target/Sparc/TargetInfo/CMakeLists.txt
+++ b/llvm/lib/Target/Sparc/TargetInfo/CMakeLists.txt
@@ -1,3 +1,9 @@
 add_llvm_component_library(LLVMSparcInfo
   SparcTargetInfo.cpp
+
+  LINK_COMPONENTS
+  Support
+
+  ADD_TO_COMPONENT
+  Sparc
   )

diff  --git a/llvm/lib/Target/Sparc/TargetInfo/LLVMBuild.txt b/llvm/lib/Target/Sparc/TargetInfo/LLVMBuild.txt
deleted file mode 100644
index e355080d3780..000000000000
--- a/llvm/lib/Target/Sparc/TargetInfo/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/Sparc/TargetInfo/LLVMBuild.txt --------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = SparcInfo
-parent = Sparc
-required_libraries = Support
-add_to_library_groups = Sparc

diff  --git a/llvm/lib/Target/SystemZ/AsmParser/CMakeLists.txt b/llvm/lib/Target/SystemZ/AsmParser/CMakeLists.txt
index 39e3d7291575..20879feb3550 100644
--- a/llvm/lib/Target/SystemZ/AsmParser/CMakeLists.txt
+++ b/llvm/lib/Target/SystemZ/AsmParser/CMakeLists.txt
@@ -1,3 +1,13 @@
 add_llvm_component_library(LLVMSystemZAsmParser
   SystemZAsmParser.cpp
+
+  LINK_COMPONENTS
+  MC
+  MCParser
+  Support
+  SystemZDesc
+  SystemZInfo
+
+  ADD_TO_COMPONENT
+  SystemZ
   )

diff  --git a/llvm/lib/Target/SystemZ/AsmParser/LLVMBuild.txt b/llvm/lib/Target/SystemZ/AsmParser/LLVMBuild.txt
deleted file mode 100644
index 14d7ad48d5b5..000000000000
--- a/llvm/lib/Target/SystemZ/AsmParser/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/SystemZ/AsmParser/LLVMBuild.txt -------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = SystemZAsmParser
-parent = SystemZ
-required_libraries = MC MCParser Support SystemZDesc SystemZInfo
-add_to_library_groups = SystemZ

diff  --git a/llvm/lib/Target/SystemZ/CMakeLists.txt b/llvm/lib/Target/SystemZ/CMakeLists.txt
index 6922b1ca2c36..fdc61ab584b2 100644
--- a/llvm/lib/Target/SystemZ/CMakeLists.txt
+++ b/llvm/lib/Target/SystemZ/CMakeLists.txt
@@ -1,3 +1,5 @@
+add_llvm_component_group(SystemZ HAS_JIT)
+
 set(LLVM_TARGET_DEFINITIONS SystemZ.td)
 
 tablegen(LLVM SystemZGenAsmMatcher.inc -gen-asm-matcher)
@@ -36,6 +38,22 @@ add_llvm_target(SystemZCodeGen
   SystemZTargetMachine.cpp
   SystemZTargetTransformInfo.cpp
   SystemZTDC.cpp
+
+  LINK_COMPONENTS
+  Analysis
+  AsmPrinter
+  CodeGen
+  Core
+  MC
+  Scalar
+  SelectionDAG
+  Support
+  SystemZDesc
+  SystemZInfo
+  Target
+
+  ADD_TO_COMPONENT
+  SystemZ
   )
 
 add_subdirectory(AsmParser)

diff  --git a/llvm/lib/Target/SystemZ/Disassembler/CMakeLists.txt b/llvm/lib/Target/SystemZ/Disassembler/CMakeLists.txt
index 102b53dc041f..607434dd950a 100644
--- a/llvm/lib/Target/SystemZ/Disassembler/CMakeLists.txt
+++ b/llvm/lib/Target/SystemZ/Disassembler/CMakeLists.txt
@@ -1,3 +1,13 @@
 add_llvm_component_library(LLVMSystemZDisassembler
   SystemZDisassembler.cpp
+
+  LINK_COMPONENTS
+  MC
+  MCDisassembler
+  Support
+  SystemZDesc
+  SystemZInfo
+
+  ADD_TO_COMPONENT
+  SystemZ
   )

diff  --git a/llvm/lib/Target/SystemZ/Disassembler/LLVMBuild.txt b/llvm/lib/Target/SystemZ/Disassembler/LLVMBuild.txt
deleted file mode 100644
index b326216f370d..000000000000
--- a/llvm/lib/Target/SystemZ/Disassembler/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===-- ./lib/Target/SystemZ/Disassembler/LLVMBuild.txt ---------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = SystemZDisassembler
-parent = SystemZ
-required_libraries = MC MCDisassembler Support SystemZDesc SystemZInfo
-add_to_library_groups = SystemZ

diff  --git a/llvm/lib/Target/SystemZ/LLVMBuild.txt b/llvm/lib/Target/SystemZ/LLVMBuild.txt
deleted file mode 100644
index 8048101ecb5c..000000000000
--- a/llvm/lib/Target/SystemZ/LLVMBuild.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-;===- ./lib/Target/SystemZ/LLVMBuild.txt -----------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = AsmParser Disassembler MCTargetDesc TargetInfo
-
-[component_0]
-type = TargetGroup
-name = SystemZ
-parent = Target
-has_asmparser = 1
-has_asmprinter = 1
-has_disassembler = 1
-has_jit = 1
-
-[component_1]
-type = Library
-name = SystemZCodeGen
-parent = SystemZ
-required_libraries = Analysis AsmPrinter CodeGen Core MC Scalar SelectionDAG Support SystemZDesc SystemZInfo Target
-add_to_library_groups = SystemZ

diff  --git a/llvm/lib/Target/SystemZ/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/SystemZ/MCTargetDesc/CMakeLists.txt
index 74ede98de4e3..ea6f5b7cb27d 100644
--- a/llvm/lib/Target/SystemZ/MCTargetDesc/CMakeLists.txt
+++ b/llvm/lib/Target/SystemZ/MCTargetDesc/CMakeLists.txt
@@ -5,4 +5,12 @@ add_llvm_component_library(LLVMSystemZDesc
   SystemZMCCodeEmitter.cpp
   SystemZMCObjectWriter.cpp
   SystemZMCTargetDesc.cpp
+
+  LINK_COMPONENTS
+  MC
+  Support
+  SystemZInfo
+
+  ADD_TO_COMPONENT
+  SystemZ
   )

diff  --git a/llvm/lib/Target/SystemZ/MCTargetDesc/LLVMBuild.txt b/llvm/lib/Target/SystemZ/MCTargetDesc/LLVMBuild.txt
deleted file mode 100644
index 748fda4d39fe..000000000000
--- a/llvm/lib/Target/SystemZ/MCTargetDesc/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/SystemZ/MCTargetDesc/LLVMBuild.txt ----------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = SystemZDesc
-parent = SystemZ
-required_libraries = MC Support SystemZInfo
-add_to_library_groups = SystemZ

diff  --git a/llvm/lib/Target/SystemZ/TargetInfo/CMakeLists.txt b/llvm/lib/Target/SystemZ/TargetInfo/CMakeLists.txt
index a3e4042fca08..615f84f48917 100644
--- a/llvm/lib/Target/SystemZ/TargetInfo/CMakeLists.txt
+++ b/llvm/lib/Target/SystemZ/TargetInfo/CMakeLists.txt
@@ -1,3 +1,9 @@
 add_llvm_component_library(LLVMSystemZInfo
   SystemZTargetInfo.cpp
+
+  LINK_COMPONENTS
+  Support
+
+  ADD_TO_COMPONENT
+  SystemZ
   )

diff  --git a/llvm/lib/Target/SystemZ/TargetInfo/LLVMBuild.txt b/llvm/lib/Target/SystemZ/TargetInfo/LLVMBuild.txt
deleted file mode 100644
index f4bed28b4fad..000000000000
--- a/llvm/lib/Target/SystemZ/TargetInfo/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/SystemZ/TargetInfo/LLVMBuild.txt ------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = SystemZInfo
-parent = SystemZ
-required_libraries = Support
-add_to_library_groups = SystemZ

diff  --git a/llvm/lib/Target/VE/AsmParser/CMakeLists.txt b/llvm/lib/Target/VE/AsmParser/CMakeLists.txt
index 1dc76426de67..00b26b617fad 100644
--- a/llvm/lib/Target/VE/AsmParser/CMakeLists.txt
+++ b/llvm/lib/Target/VE/AsmParser/CMakeLists.txt
@@ -1,3 +1,13 @@
 add_llvm_component_library(LLVMVEAsmParser
   VEAsmParser.cpp
+
+  LINK_COMPONENTS
+  MC
+  MCParser
+  VEDesc
+  VEInfo
+  Support
+
+  ADD_TO_COMPONENT
+  VE
   )

diff  --git a/llvm/lib/Target/VE/AsmParser/LLVMBuild.txt b/llvm/lib/Target/VE/AsmParser/LLVMBuild.txt
deleted file mode 100644
index b55015219bf3..000000000000
--- a/llvm/lib/Target/VE/AsmParser/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/VE/AsmParser/LLVMBuild.txt ------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = VEAsmParser
-parent = VE
-required_libraries = MC MCParser VEDesc VEInfo Support
-add_to_library_groups = VE

diff  --git a/llvm/lib/Target/VE/CMakeLists.txt b/llvm/lib/Target/VE/CMakeLists.txt
index b37d00929cf4..dec4a6b1d8b1 100644
--- a/llvm/lib/Target/VE/CMakeLists.txt
+++ b/llvm/lib/Target/VE/CMakeLists.txt
@@ -1,3 +1,5 @@
+add_llvm_component_group(VE)
+
 set(LLVM_TARGET_DEFINITIONS VE.td)
 
 tablegen(LLVM VEGenRegisterInfo.inc -gen-register-info)
@@ -22,6 +24,21 @@ add_llvm_target(VECodeGen
   VERegisterInfo.cpp
   VESubtarget.cpp
   VETargetMachine.cpp
+
+  LINK_COMPONENTS
+  Analysis
+  AsmPrinter
+  CodeGen
+  Core
+  MC
+  SelectionDAG
+  VEDesc
+  VEInfo
+  Support
+  Target
+
+  ADD_TO_COMPONENT
+  VE
   )
 
 add_subdirectory(AsmParser)

diff  --git a/llvm/lib/Target/VE/Disassembler/CMakeLists.txt b/llvm/lib/Target/VE/Disassembler/CMakeLists.txt
index af1097d7912b..896f023e94cd 100644
--- a/llvm/lib/Target/VE/Disassembler/CMakeLists.txt
+++ b/llvm/lib/Target/VE/Disassembler/CMakeLists.txt
@@ -1,3 +1,11 @@
 add_llvm_component_library(LLVMVEDisassembler
   VEDisassembler.cpp
+
+  LINK_COMPONENTS
+  MCDisassembler
+  VEInfo
+  Support
+
+  ADD_TO_COMPONENT
+  VE
   )

diff  --git a/llvm/lib/Target/VE/Disassembler/LLVMBuild.txt b/llvm/lib/Target/VE/Disassembler/LLVMBuild.txt
deleted file mode 100644
index d1b581bb8931..000000000000
--- a/llvm/lib/Target/VE/Disassembler/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/VE/Disassembler/LLVMBuild.txt ---------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = VEDisassembler
-parent = VE
-required_libraries = MCDisassembler VEInfo Support
-add_to_library_groups = VE

diff  --git a/llvm/lib/Target/VE/LLVMBuild.txt b/llvm/lib/Target/VE/LLVMBuild.txt
deleted file mode 100644
index 768caf0a2a17..000000000000
--- a/llvm/lib/Target/VE/LLVMBuild.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-;===- ./lib/Target/VE/LLVMBuild.txt ----------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = AsmParser Disassembler MCTargetDesc TargetInfo
-
-[component_0]
-type = TargetGroup
-name = VE
-parent = Target
-has_asmparser = 1
-has_asmprinter = 1
-has_disassembler = 1
-
-[component_1]
-type = Library
-name = VECodeGen
-parent = VE
-required_libraries = Analysis AsmPrinter CodeGen Core
-                     MC SelectionDAG VEDesc VEInfo Support Target
-add_to_library_groups = VE

diff  --git a/llvm/lib/Target/VE/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/VE/MCTargetDesc/CMakeLists.txt
index 4d8787ff8609..46b11d7e82a4 100644
--- a/llvm/lib/Target/VE/MCTargetDesc/CMakeLists.txt
+++ b/llvm/lib/Target/VE/MCTargetDesc/CMakeLists.txt
@@ -7,4 +7,12 @@ add_llvm_component_library(LLVMVEDesc
   VEMCExpr.cpp
   VEMCTargetDesc.cpp
   VETargetStreamer.cpp
+
+  LINK_COMPONENTS
+  MC
+  VEInfo
+  Support
+
+  ADD_TO_COMPONENT
+  VE
   )

diff  --git a/llvm/lib/Target/VE/MCTargetDesc/LLVMBuild.txt b/llvm/lib/Target/VE/MCTargetDesc/LLVMBuild.txt
deleted file mode 100644
index e585042e60bb..000000000000
--- a/llvm/lib/Target/VE/MCTargetDesc/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/VE/MCTargetDesc/LLVMBuild.txt ---------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = VEDesc
-parent = VE
-required_libraries = MC VEInfo Support
-add_to_library_groups = VE

diff  --git a/llvm/lib/Target/VE/TargetInfo/CMakeLists.txt b/llvm/lib/Target/VE/TargetInfo/CMakeLists.txt
index 0850b0f27bf2..3e5a027a6cec 100644
--- a/llvm/lib/Target/VE/TargetInfo/CMakeLists.txt
+++ b/llvm/lib/Target/VE/TargetInfo/CMakeLists.txt
@@ -1,3 +1,9 @@
 add_llvm_component_library(LLVMVEInfo
   VETargetInfo.cpp
+
+  LINK_COMPONENTS
+  Support
+
+  ADD_TO_COMPONENT
+  VE
   )

diff  --git a/llvm/lib/Target/VE/TargetInfo/LLVMBuild.txt b/llvm/lib/Target/VE/TargetInfo/LLVMBuild.txt
deleted file mode 100644
index c440132476a4..000000000000
--- a/llvm/lib/Target/VE/TargetInfo/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/VE/TargetInfo/LLVMBuild.txt -----------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = VEInfo
-parent = VE
-required_libraries = Support
-add_to_library_groups = VE

diff  --git a/llvm/lib/Target/WebAssembly/AsmParser/CMakeLists.txt b/llvm/lib/Target/WebAssembly/AsmParser/CMakeLists.txt
index 53cdfebba152..7f66fb348adb 100644
--- a/llvm/lib/Target/WebAssembly/AsmParser/CMakeLists.txt
+++ b/llvm/lib/Target/WebAssembly/AsmParser/CMakeLists.txt
@@ -1,3 +1,12 @@
 add_llvm_component_library(LLVMWebAssemblyAsmParser
   WebAssemblyAsmParser.cpp
+
+  LINK_COMPONENTS
+  MC
+  MCParser
+  WebAssemblyInfo
+  Support
+
+  ADD_TO_COMPONENT
+  WebAssembly
   )

diff  --git a/llvm/lib/Target/WebAssembly/AsmParser/LLVMBuild.txt b/llvm/lib/Target/WebAssembly/AsmParser/LLVMBuild.txt
deleted file mode 100644
index 5521f8237c34..000000000000
--- a/llvm/lib/Target/WebAssembly/AsmParser/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===-- ./lib/Target/WebAssembly/Disassembler/LLVMBuild.txt -----*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = WebAssemblyAsmParser
-parent = WebAssembly
-required_libraries = MC MCParser WebAssemblyInfo Support
-add_to_library_groups = WebAssembly

diff  --git a/llvm/lib/Target/WebAssembly/CMakeLists.txt b/llvm/lib/Target/WebAssembly/CMakeLists.txt
index 3cbc21c4cbe2..87920e7a950b 100644
--- a/llvm/lib/Target/WebAssembly/CMakeLists.txt
+++ b/llvm/lib/Target/WebAssembly/CMakeLists.txt
@@ -1,3 +1,5 @@
+add_llvm_component_group(WebAssembly)
+
 set(LLVM_TARGET_DEFINITIONS WebAssembly.td)
 
 tablegen(LLVM WebAssemblyGenAsmMatcher.inc -gen-asm-matcher)
@@ -58,6 +60,24 @@ add_llvm_target(WebAssemblyCodeGen
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  Analysis
+  AsmPrinter
+  BinaryFormat
+  CodeGen
+  Core
+  MC
+  Scalar
+  SelectionDAG
+  Support
+  Target
+  TransformUtils
+  WebAssemblyDesc
+  WebAssemblyInfo
+
+  ADD_TO_COMPONENT
+  WebAssembly
 )
 
 add_subdirectory(AsmParser)

diff  --git a/llvm/lib/Target/WebAssembly/Disassembler/CMakeLists.txt b/llvm/lib/Target/WebAssembly/Disassembler/CMakeLists.txt
index 9b71c103de2b..1782f576f3a6 100644
--- a/llvm/lib/Target/WebAssembly/Disassembler/CMakeLists.txt
+++ b/llvm/lib/Target/WebAssembly/Disassembler/CMakeLists.txt
@@ -1,3 +1,13 @@
 add_llvm_component_library(LLVMWebAssemblyDisassembler
   WebAssemblyDisassembler.cpp
+
+  LINK_COMPONENTS
+  WebAssemblyDesc
+  MCDisassembler
+  WebAssemblyInfo
+  Support
+  MC
+
+  ADD_TO_COMPONENT
+  WebAssembly
   )

diff  --git a/llvm/lib/Target/WebAssembly/Disassembler/LLVMBuild.txt b/llvm/lib/Target/WebAssembly/Disassembler/LLVMBuild.txt
deleted file mode 100644
index ffa5baa8de4f..000000000000
--- a/llvm/lib/Target/WebAssembly/Disassembler/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===-- ./lib/Target/WebAssembly/Disassembler/LLVMBuild.txt -----*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = WebAssemblyDisassembler
-parent = WebAssembly
-required_libraries = WebAssemblyDesc MCDisassembler WebAssemblyInfo Support MC
-add_to_library_groups = WebAssembly

diff  --git a/llvm/lib/Target/WebAssembly/LLVMBuild.txt b/llvm/lib/Target/WebAssembly/LLVMBuild.txt
deleted file mode 100644
index 65ce30eda12f..000000000000
--- a/llvm/lib/Target/WebAssembly/LLVMBuild.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-;===- ./lib/Target/WebAssembly/LLVMBuild.txt -------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = AsmParser Disassembler MCTargetDesc TargetInfo
-
-[component_0]
-type = TargetGroup
-name = WebAssembly
-parent = Target
-has_asmparser = 1
-has_asmprinter = 1
-has_disassembler = 1
-
-[component_1]
-type = Library
-name = WebAssemblyCodeGen
-parent = WebAssembly
-required_libraries = Analysis AsmPrinter BinaryFormat CodeGen Core MC Scalar SelectionDAG Support Target TransformUtils WebAssemblyDesc WebAssemblyInfo
-add_to_library_groups = WebAssembly

diff  --git a/llvm/lib/Target/WebAssembly/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/WebAssembly/MCTargetDesc/CMakeLists.txt
index 2e39e473fb8f..6a68e7dbf084 100644
--- a/llvm/lib/Target/WebAssembly/MCTargetDesc/CMakeLists.txt
+++ b/llvm/lib/Target/WebAssembly/MCTargetDesc/CMakeLists.txt
@@ -6,4 +6,12 @@ add_llvm_component_library(LLVMWebAssemblyDesc
   WebAssemblyMCTargetDesc.cpp
   WebAssemblyTargetStreamer.cpp
   WebAssemblyWasmObjectWriter.cpp
+
+  LINK_COMPONENTS
+  MC
+  Support
+  WebAssemblyInfo
+
+  ADD_TO_COMPONENT
+  WebAssembly
 )

diff  --git a/llvm/lib/Target/WebAssembly/MCTargetDesc/LLVMBuild.txt b/llvm/lib/Target/WebAssembly/MCTargetDesc/LLVMBuild.txt
deleted file mode 100644
index 26e18794b9fa..000000000000
--- a/llvm/lib/Target/WebAssembly/MCTargetDesc/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/WebAssembly/MCTargetDesc/LLVMBuild.txt ------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = WebAssemblyDesc
-parent = WebAssembly
-required_libraries = MC Support WebAssemblyInfo
-add_to_library_groups = WebAssembly

diff  --git a/llvm/lib/Target/WebAssembly/TargetInfo/CMakeLists.txt b/llvm/lib/Target/WebAssembly/TargetInfo/CMakeLists.txt
index 1a13e2ed0d7e..f9f5f2f9a617 100644
--- a/llvm/lib/Target/WebAssembly/TargetInfo/CMakeLists.txt
+++ b/llvm/lib/Target/WebAssembly/TargetInfo/CMakeLists.txt
@@ -2,6 +2,12 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/
 
 add_llvm_component_library(LLVMWebAssemblyInfo
   WebAssemblyTargetInfo.cpp
+
+  LINK_COMPONENTS
+  Support
+
+  ADD_TO_COMPONENT
+  WebAssembly
   )
 
 add_dependencies(LLVMWebAssemblyInfo WebAssemblyCommonTableGen)

diff  --git a/llvm/lib/Target/WebAssembly/TargetInfo/LLVMBuild.txt b/llvm/lib/Target/WebAssembly/TargetInfo/LLVMBuild.txt
deleted file mode 100644
index ff520740ce26..000000000000
--- a/llvm/lib/Target/WebAssembly/TargetInfo/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/WebAssembly/TargetInfo/LLVMBuild.txt --------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = WebAssemblyInfo
-parent = WebAssembly
-required_libraries = Support
-add_to_library_groups = WebAssembly

diff  --git a/llvm/lib/Target/X86/AsmParser/CMakeLists.txt b/llvm/lib/Target/X86/AsmParser/CMakeLists.txt
index e5cd6ac4497c..ad7e14ccaaec 100644
--- a/llvm/lib/Target/X86/AsmParser/CMakeLists.txt
+++ b/llvm/lib/Target/X86/AsmParser/CMakeLists.txt
@@ -1,3 +1,13 @@
 add_llvm_component_library(LLVMX86AsmParser
   X86AsmParser.cpp
+
+  LINK_COMPONENTS
+  MC
+  MCParser
+  Support
+  X86Desc
+  X86Info
+
+  ADD_TO_COMPONENT
+  X86
   )

diff  --git a/llvm/lib/Target/X86/AsmParser/LLVMBuild.txt b/llvm/lib/Target/X86/AsmParser/LLVMBuild.txt
deleted file mode 100644
index 8a7fb5b717be..000000000000
--- a/llvm/lib/Target/X86/AsmParser/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/X86/AsmParser/LLVMBuild.txt -----------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = X86AsmParser
-parent = X86
-required_libraries = MC MCParser Support X86Desc X86Info
-add_to_library_groups = X86

diff  --git a/llvm/lib/Target/X86/CMakeLists.txt b/llvm/lib/Target/X86/CMakeLists.txt
index 677d0a55336a..8c7fee59789a 100644
--- a/llvm/lib/Target/X86/CMakeLists.txt
+++ b/llvm/lib/Target/X86/CMakeLists.txt
@@ -1,3 +1,5 @@
+add_llvm_component_group(X86 HAS_JIT)
+
 set(LLVM_TARGET_DEFINITIONS X86.td)
 
 tablegen(LLVM X86GenAsmMatcher.inc -gen-asm-matcher)
@@ -76,7 +78,25 @@ set(sources
   X86InsertWait.cpp
   )
 
-add_llvm_target(X86CodeGen ${sources})
+add_llvm_target(X86CodeGen ${sources}
+  LINK_COMPONENTS
+  Analysis
+  AsmPrinter
+  CodeGen
+  Core
+  MC
+  SelectionDAG
+  Support
+  Target
+  X86Desc
+  X86Info
+  GlobalISel
+  ProfileData
+  CFGuard
+
+  ADD_TO_COMPONENT
+  X86
+)
 
 add_subdirectory(AsmParser)
 add_subdirectory(Disassembler)

diff  --git a/llvm/lib/Target/X86/Disassembler/CMakeLists.txt b/llvm/lib/Target/X86/Disassembler/CMakeLists.txt
index aa9adb4e4e69..b5e4c709f1fd 100644
--- a/llvm/lib/Target/X86/Disassembler/CMakeLists.txt
+++ b/llvm/lib/Target/X86/Disassembler/CMakeLists.txt
@@ -1,3 +1,11 @@
 add_llvm_component_library(LLVMX86Disassembler
   X86Disassembler.cpp
+
+  LINK_COMPONENTS
+  MCDisassembler
+  Support
+  X86Info
+
+  ADD_TO_COMPONENT
+  X86
   )

diff  --git a/llvm/lib/Target/X86/Disassembler/LLVMBuild.txt b/llvm/lib/Target/X86/Disassembler/LLVMBuild.txt
deleted file mode 100644
index c250c5ec4755..000000000000
--- a/llvm/lib/Target/X86/Disassembler/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/X86/Disassembler/LLVMBuild.txt --------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = X86Disassembler
-parent = X86
-required_libraries = MCDisassembler Support X86Info
-add_to_library_groups = X86

diff  --git a/llvm/lib/Target/X86/LLVMBuild.txt b/llvm/lib/Target/X86/LLVMBuild.txt
deleted file mode 100644
index 6a9d772ee760..000000000000
--- a/llvm/lib/Target/X86/LLVMBuild.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-;===- ./lib/Target/X86/LLVMBuild.txt ---------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = AsmParser Disassembler MCTargetDesc TargetInfo
-
-[component_0]
-type = TargetGroup
-name = X86
-parent = Target
-has_asmparser = 1
-has_asmprinter = 1
-has_disassembler = 1
-has_jit = 1
-
-[component_1]
-type = Library
-name = X86CodeGen
-parent = X86
-required_libraries = Analysis AsmPrinter CodeGen Core MC SelectionDAG Support Target X86Desc X86Info GlobalISel ProfileData CFGuard
-add_to_library_groups = X86

diff  --git a/llvm/lib/Target/X86/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/X86/MCTargetDesc/CMakeLists.txt
index 08e0299ec872..0f5030e52904 100644
--- a/llvm/lib/Target/X86/MCTargetDesc/CMakeLists.txt
+++ b/llvm/lib/Target/X86/MCTargetDesc/CMakeLists.txt
@@ -13,4 +13,14 @@ add_llvm_component_library(LLVMX86Desc
   X86WinCOFFObjectWriter.cpp
   X86WinCOFFStreamer.cpp
   X86WinCOFFTargetStreamer.cpp
+
+  LINK_COMPONENTS
+  MC
+  MCDisassembler
+  Support
+  X86Info
+  BinaryFormat
+
+  ADD_TO_COMPONENT
+  X86
   )

diff  --git a/llvm/lib/Target/X86/MCTargetDesc/LLVMBuild.txt b/llvm/lib/Target/X86/MCTargetDesc/LLVMBuild.txt
deleted file mode 100644
index 7f4861c03cb8..000000000000
--- a/llvm/lib/Target/X86/MCTargetDesc/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/X86/MCTargetDesc/LLVMBuild.txt --------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = X86Desc
-parent = X86
-required_libraries = MC MCDisassembler Support X86Info BinaryFormat
-add_to_library_groups = X86

diff  --git a/llvm/lib/Target/X86/TargetInfo/CMakeLists.txt b/llvm/lib/Target/X86/TargetInfo/CMakeLists.txt
index e51facd0f62e..6a7b67118e83 100644
--- a/llvm/lib/Target/X86/TargetInfo/CMakeLists.txt
+++ b/llvm/lib/Target/X86/TargetInfo/CMakeLists.txt
@@ -1,3 +1,9 @@
 add_llvm_component_library(LLVMX86Info
   X86TargetInfo.cpp
+
+  LINK_COMPONENTS
+  Support
+
+  ADD_TO_COMPONENT
+  X86
   )

diff  --git a/llvm/lib/Target/X86/TargetInfo/LLVMBuild.txt b/llvm/lib/Target/X86/TargetInfo/LLVMBuild.txt
deleted file mode 100644
index 89e6dd338874..000000000000
--- a/llvm/lib/Target/X86/TargetInfo/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/X86/TargetInfo/LLVMBuild.txt ----------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = X86Info
-parent = X86
-required_libraries = Support
-add_to_library_groups = X86

diff  --git a/llvm/lib/Target/XCore/CMakeLists.txt b/llvm/lib/Target/XCore/CMakeLists.txt
index a0ac3858b77f..d8cf06fc136e 100644
--- a/llvm/lib/Target/XCore/CMakeLists.txt
+++ b/llvm/lib/Target/XCore/CMakeLists.txt
@@ -1,3 +1,5 @@
+add_llvm_component_group(XCore)
+
 set(LLVM_TARGET_DEFINITIONS XCore.td)
 
 tablegen(LLVM XCoreGenAsmWriter.inc -gen-asm-writer)
@@ -25,6 +27,22 @@ add_llvm_target(XCoreCodeGen
   XCoreTargetObjectFile.cpp
   XCoreSelectionDAGInfo.cpp
   XCoreFrameToArgsOffsetElim.cpp
+
+  LINK_COMPONENTS
+  Analysis
+  AsmPrinter
+  CodeGen
+  Core
+  MC
+  SelectionDAG
+  Support
+  Target
+  TransformUtils
+  XCoreDesc
+  XCoreInfo
+
+  ADD_TO_COMPONENT
+  XCore
   )
 
 add_subdirectory(Disassembler)

diff  --git a/llvm/lib/Target/XCore/Disassembler/CMakeLists.txt b/llvm/lib/Target/XCore/Disassembler/CMakeLists.txt
index 1cded7b8158b..cf4a63bb34e0 100644
--- a/llvm/lib/Target/XCore/Disassembler/CMakeLists.txt
+++ b/llvm/lib/Target/XCore/Disassembler/CMakeLists.txt
@@ -1,3 +1,11 @@
 add_llvm_component_library(LLVMXCoreDisassembler
   XCoreDisassembler.cpp
+
+  LINK_COMPONENTS
+  MCDisassembler
+  Support
+  XCoreInfo
+
+  ADD_TO_COMPONENT
+  XCore
   )

diff  --git a/llvm/lib/Target/XCore/Disassembler/LLVMBuild.txt b/llvm/lib/Target/XCore/Disassembler/LLVMBuild.txt
deleted file mode 100644
index f27972cc3f7c..000000000000
--- a/llvm/lib/Target/XCore/Disassembler/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/XCore/Disassembler/LLVMBuild.txt ------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = XCoreDisassembler
-parent = XCore
-required_libraries = MCDisassembler Support XCoreInfo
-add_to_library_groups = XCore

diff  --git a/llvm/lib/Target/XCore/LLVMBuild.txt b/llvm/lib/Target/XCore/LLVMBuild.txt
deleted file mode 100644
index 280c20a2aefd..000000000000
--- a/llvm/lib/Target/XCore/LLVMBuild.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-;===- ./lib/Target/XCore/LLVMBuild.txt -------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = Disassembler MCTargetDesc TargetInfo
-
-[component_0]
-type = TargetGroup
-name = XCore
-parent = Target
-has_asmprinter = 1
-has_disassembler = 1
-
-[component_1]
-type = Library
-name = XCoreCodeGen
-parent = XCore
-required_libraries =
- Analysis
- AsmPrinter
- CodeGen
- Core
- MC
- SelectionDAG
- Support
- Target
- TransformUtils
- XCoreDesc
- XCoreInfo
-add_to_library_groups = XCore

diff  --git a/llvm/lib/Target/XCore/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/XCore/MCTargetDesc/CMakeLists.txt
index 94dc178fbb1a..a4fb8fa0c1c4 100644
--- a/llvm/lib/Target/XCore/MCTargetDesc/CMakeLists.txt
+++ b/llvm/lib/Target/XCore/MCTargetDesc/CMakeLists.txt
@@ -2,4 +2,12 @@ add_llvm_component_library(LLVMXCoreDesc
   XCoreInstPrinter.cpp
   XCoreMCTargetDesc.cpp
   XCoreMCAsmInfo.cpp
+
+  LINK_COMPONENTS
+  MC
+  Support
+  XCoreInfo
+
+  ADD_TO_COMPONENT
+  XCore
   )

diff  --git a/llvm/lib/Target/XCore/MCTargetDesc/LLVMBuild.txt b/llvm/lib/Target/XCore/MCTargetDesc/LLVMBuild.txt
deleted file mode 100644
index eabd0cb6c62e..000000000000
--- a/llvm/lib/Target/XCore/MCTargetDesc/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/XCore/MCTargetDesc/LLVMBuild.txt ------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = XCoreDesc
-parent = XCore
-required_libraries = MC Support XCoreInfo
-add_to_library_groups = XCore

diff  --git a/llvm/lib/Target/XCore/TargetInfo/CMakeLists.txt b/llvm/lib/Target/XCore/TargetInfo/CMakeLists.txt
index a041def3caa7..f3af86a21b34 100644
--- a/llvm/lib/Target/XCore/TargetInfo/CMakeLists.txt
+++ b/llvm/lib/Target/XCore/TargetInfo/CMakeLists.txt
@@ -1,3 +1,9 @@
 add_llvm_component_library(LLVMXCoreInfo
   XCoreTargetInfo.cpp
+
+  LINK_COMPONENTS
+  Support
+
+  ADD_TO_COMPONENT
+  XCore
   )

diff  --git a/llvm/lib/Target/XCore/TargetInfo/LLVMBuild.txt b/llvm/lib/Target/XCore/TargetInfo/LLVMBuild.txt
deleted file mode 100644
index 21e2ee340274..000000000000
--- a/llvm/lib/Target/XCore/TargetInfo/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Target/XCore/TargetInfo/LLVMBuild.txt --------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = XCoreInfo
-parent = XCore
-required_libraries = Support
-add_to_library_groups = XCore

diff  --git a/llvm/lib/Testing/LLVMBuild.txt b/llvm/lib/Testing/LLVMBuild.txt
deleted file mode 100644
index 4b331468a03e..000000000000
--- a/llvm/lib/Testing/LLVMBuild.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-;===- ./lib/Testing/LLVMBuild.txt ------------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = Support

diff  --git a/llvm/lib/Testing/Support/CMakeLists.txt b/llvm/lib/Testing/Support/CMakeLists.txt
index ed2fd8ae43b2..bde4e1d64f15 100644
--- a/llvm/lib/Testing/Support/CMakeLists.txt
+++ b/llvm/lib/Testing/Support/CMakeLists.txt
@@ -4,7 +4,7 @@ add_llvm_library(LLVMTestingSupport
   SupportHelpers.cpp
 
   BUILDTREE_ONLY
-  
+
   ADDITIONAL_HEADER_DIRS
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/Testing/Support
 

diff  --git a/llvm/lib/Testing/Support/LLVMBuild.txt b/llvm/lib/Testing/Support/LLVMBuild.txt
deleted file mode 100644
index 98278f9c5b0b..000000000000
--- a/llvm/lib/Testing/Support/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./Testing/Support/LLVMBuild.txt --------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = TestingSupport
-parent = Libraries
-required_libraries = Support
-installed = 0

diff  --git a/llvm/lib/TextAPI/CMakeLists.txt b/llvm/lib/TextAPI/CMakeLists.txt
index b63bc64b31f1..e0bf84271106 100644
--- a/llvm/lib/TextAPI/CMakeLists.txt
+++ b/llvm/lib/TextAPI/CMakeLists.txt
@@ -13,4 +13,8 @@ add_llvm_component_library(LLVMTextAPI
   "${LLVM_MAIN_INCLUDE_DIR}/llvm/TextAPI"
   "${LLVM_MAIN_INCLUDE_DIR}/llvm/TextAPI/Elf"
   "${LLVM_MAIN_INCLUDE_DIR}/llvm/TextAPI/MachO"
+
+  LINK_COMPONENTS
+  Support
+  BinaryFormat
 )

diff  --git a/llvm/lib/TextAPI/LLVMBuild.txt b/llvm/lib/TextAPI/LLVMBuild.txt
deleted file mode 100644
index fafab9f07981..000000000000
--- a/llvm/lib/TextAPI/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/TextAPI/LLVMBuild.txt ------------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = TextAPI
-parent = Libraries
-required_libraries = Support BinaryFormat

diff  --git a/llvm/lib/ToolDrivers/LLVMBuild.txt b/llvm/lib/ToolDrivers/LLVMBuild.txt
deleted file mode 100644
index cd7ba29998b8..000000000000
--- a/llvm/lib/ToolDrivers/LLVMBuild.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-;===- ./lib/ToolDrivers/LLVMBuild.txt --------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = llvm-dlltool llvm-lib
-
-[component_0]
-type = Group
-name = ToolDrivers
-parent = Libraries

diff  --git a/llvm/lib/ToolDrivers/llvm-dlltool/CMakeLists.txt b/llvm/lib/ToolDrivers/llvm-dlltool/CMakeLists.txt
index fb3ac8a41a6f..52d3f3f1f957 100644
--- a/llvm/lib/ToolDrivers/llvm-dlltool/CMakeLists.txt
+++ b/llvm/lib/ToolDrivers/llvm-dlltool/CMakeLists.txt
@@ -4,6 +4,11 @@ add_public_tablegen_target(DllOptionsTableGen)
 
 add_llvm_component_library(LLVMDlltoolDriver
   DlltoolDriver.cpp
+
+  LINK_COMPONENTS
+  Object
+  Option
+  Support
   )
 
 add_dependencies(LLVMDlltoolDriver DllOptionsTableGen)

diff  --git a/llvm/lib/ToolDrivers/llvm-dlltool/LLVMBuild.txt b/llvm/lib/ToolDrivers/llvm-dlltool/LLVMBuild.txt
deleted file mode 100644
index b1f4ad90a443..000000000000
--- a/llvm/lib/ToolDrivers/llvm-dlltool/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/ToolDrivers/llvm-dlltool/LLVMBuild.txt -------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = DlltoolDriver
-parent = Libraries
-required_libraries = Object Option Support

diff  --git a/llvm/lib/ToolDrivers/llvm-lib/CMakeLists.txt b/llvm/lib/ToolDrivers/llvm-lib/CMakeLists.txt
index a6ba436927bc..b4a3ea6e2002 100644
--- a/llvm/lib/ToolDrivers/llvm-lib/CMakeLists.txt
+++ b/llvm/lib/ToolDrivers/llvm-lib/CMakeLists.txt
@@ -15,5 +15,12 @@ add_llvm_component_library(LLVMLibDriver
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  BinaryFormat
+  BitReader
+  Object
+  Option
+  Support
   )
 add_dependencies(LLVMLibDriver LibOptionsTableGen)

diff  --git a/llvm/lib/ToolDrivers/llvm-lib/LLVMBuild.txt b/llvm/lib/ToolDrivers/llvm-lib/LLVMBuild.txt
deleted file mode 100644
index 9d117e215726..000000000000
--- a/llvm/lib/ToolDrivers/llvm-lib/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/LibDriver/LLVMBuild.txt ----------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = LibDriver
-parent = Libraries
-required_libraries = BinaryFormat BitReader Object Option Support

diff  --git a/llvm/lib/Transforms/AggressiveInstCombine/CMakeLists.txt b/llvm/lib/Transforms/AggressiveInstCombine/CMakeLists.txt
index 10686d420780..77b7cdfb144e 100644
--- a/llvm/lib/Transforms/AggressiveInstCombine/CMakeLists.txt
+++ b/llvm/lib/Transforms/AggressiveInstCombine/CMakeLists.txt
@@ -8,4 +8,10 @@ add_llvm_component_library(LLVMAggressiveInstCombine
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  Analysis
+  Core
+  Support
+  TransformUtils
   )

diff  --git a/llvm/lib/Transforms/AggressiveInstCombine/LLVMBuild.txt b/llvm/lib/Transforms/AggressiveInstCombine/LLVMBuild.txt
deleted file mode 100644
index 13728abb0d30..000000000000
--- a/llvm/lib/Transforms/AggressiveInstCombine/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/Transforms/AggressiveInstCombine/LLVMBuild.txt -----*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = AggressiveInstCombine
-parent = Transforms
-required_libraries = Analysis Core Support TransformUtils

diff  --git a/llvm/lib/Transforms/CFGuard/CMakeLists.txt b/llvm/lib/Transforms/CFGuard/CMakeLists.txt
index d1c020317799..b25e820bbbc2 100644
--- a/llvm/lib/Transforms/CFGuard/CMakeLists.txt
+++ b/llvm/lib/Transforms/CFGuard/CMakeLists.txt
@@ -6,4 +6,8 @@ add_llvm_component_library(LLVMCFGuard
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  Core
+  Support
   )

diff  --git a/llvm/lib/Transforms/CFGuard/LLVMBuild.txt b/llvm/lib/Transforms/CFGuard/LLVMBuild.txt
deleted file mode 100644
index d20cdb443eb3..000000000000
--- a/llvm/lib/Transforms/CFGuard/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/Transforms/CFGuard/LLVMBuild.txt -------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = CFGuard
-parent = Transforms
-required_libraries = Core Support

diff  --git a/llvm/lib/Transforms/Coroutines/CMakeLists.txt b/llvm/lib/Transforms/Coroutines/CMakeLists.txt
index a3b3f58b2b7b..d8ef0fee467d 100644
--- a/llvm/lib/Transforms/Coroutines/CMakeLists.txt
+++ b/llvm/lib/Transforms/Coroutines/CMakeLists.txt
@@ -12,4 +12,12 @@ add_llvm_component_library(LLVMCoroutines
   DEPENDS
   intrinsics_gen
   LLVMAnalysis
+
+  LINK_COMPONENTS
+  Analysis
+  Core
+  IPO
+  Scalar
+  Support
+  TransformUtils
   )

diff  --git a/llvm/lib/Transforms/Coroutines/LLVMBuild.txt b/llvm/lib/Transforms/Coroutines/LLVMBuild.txt
deleted file mode 100644
index 63c7fd04493c..000000000000
--- a/llvm/lib/Transforms/Coroutines/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/Transforms/Coroutines/LLVMBuild.txt ----------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = Coroutines
-parent = Transforms
-required_libraries = Analysis Core IPO Scalar Support TransformUtils

diff  --git a/llvm/lib/Transforms/HelloNew/CMakeLists.txt b/llvm/lib/Transforms/HelloNew/CMakeLists.txt
index a7a1a5b93b06..76ac8ada6e32 100644
--- a/llvm/lib/Transforms/HelloNew/CMakeLists.txt
+++ b/llvm/lib/Transforms/HelloNew/CMakeLists.txt
@@ -3,4 +3,8 @@ add_llvm_component_library(LLVMHelloNew
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  Core
+  Support
   )

diff  --git a/llvm/lib/Transforms/HelloNew/LLVMBuild.txt b/llvm/lib/Transforms/HelloNew/LLVMBuild.txt
deleted file mode 100644
index 06d3c81333b7..000000000000
--- a/llvm/lib/Transforms/HelloNew/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Transforms/HelloNew/LLVMBuild.txt ------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = HelloNew
-parent = Transforms
-library_name = HelloNew
-required_libraries = Core Support

diff  --git a/llvm/lib/Transforms/IPO/CMakeLists.txt b/llvm/lib/Transforms/IPO/CMakeLists.txt
index a17ef6337106..c391454c5528 100644
--- a/llvm/lib/Transforms/IPO/CMakeLists.txt
+++ b/llvm/lib/Transforms/IPO/CMakeLists.txt
@@ -45,4 +45,25 @@ add_llvm_component_library(LLVMipo
   DEPENDS
   intrinsics_gen
   omp_gen
+
+  COMPONENT_NAME
+  ipo
+
+  LINK_COMPONENTS
+  AggressiveInstCombine
+  Analysis
+  BitReader
+  BitWriter
+  Core
+  FrontendOpenMP
+  InstCombine
+  IRReader
+  Linker
+  Object
+  ProfileData
+  Scalar
+  Support
+  TransformUtils
+  Vectorize
+  Instrumentation
   )

diff  --git a/llvm/lib/Transforms/IPO/LLVMBuild.txt b/llvm/lib/Transforms/IPO/LLVMBuild.txt
deleted file mode 100644
index ea207e81fce8..000000000000
--- a/llvm/lib/Transforms/IPO/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Transforms/IPO/LLVMBuild.txt -----------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = IPO
-parent = Transforms
-library_name = ipo
-required_libraries = AggressiveInstCombine Analysis BitReader BitWriter Core FrontendOpenMP InstCombine IRReader Linker Object ProfileData Scalar Support TransformUtils Vectorize Instrumentation

diff  --git a/llvm/lib/Transforms/InstCombine/CMakeLists.txt b/llvm/lib/Transforms/InstCombine/CMakeLists.txt
index 426e1c29760d..6ab5e6da21cf 100644
--- a/llvm/lib/Transforms/InstCombine/CMakeLists.txt
+++ b/llvm/lib/Transforms/InstCombine/CMakeLists.txt
@@ -21,4 +21,10 @@ add_llvm_component_library(LLVMInstCombine
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  Analysis
+  Core
+  Support
+  TransformUtils
   )

diff  --git a/llvm/lib/Transforms/InstCombine/LLVMBuild.txt b/llvm/lib/Transforms/InstCombine/LLVMBuild.txt
deleted file mode 100644
index d1f91c071c06..000000000000
--- a/llvm/lib/Transforms/InstCombine/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/Transforms/InstCombine/LLVMBuild.txt ---------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = InstCombine
-parent = Transforms
-required_libraries = Analysis Core Support TransformUtils

diff  --git a/llvm/lib/Transforms/Instrumentation/CMakeLists.txt b/llvm/lib/Transforms/Instrumentation/CMakeLists.txt
index 63bc57ac9c44..3b29c3df6429 100644
--- a/llvm/lib/Transforms/Instrumentation/CMakeLists.txt
+++ b/llvm/lib/Transforms/Instrumentation/CMakeLists.txt
@@ -24,4 +24,12 @@ add_llvm_component_library(LLVMInstrumentation
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  Analysis
+  Core
+  MC
+  Support
+  TransformUtils
+  ProfileData
   )

diff  --git a/llvm/lib/Transforms/Instrumentation/LLVMBuild.txt b/llvm/lib/Transforms/Instrumentation/LLVMBuild.txt
deleted file mode 100644
index 16776c768bfd..000000000000
--- a/llvm/lib/Transforms/Instrumentation/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/Transforms/Instrumentation/LLVMBuild.txt -----------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = Instrumentation
-parent = Transforms
-required_libraries = Analysis Core MC Support TransformUtils ProfileData

diff  --git a/llvm/lib/Transforms/LLVMBuild.txt b/llvm/lib/Transforms/LLVMBuild.txt
deleted file mode 100644
index 6c6a6bb317fa..000000000000
--- a/llvm/lib/Transforms/LLVMBuild.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-;===- ./lib/Transforms/LLVMBuild.txt ---------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = AggressiveInstCombine Coroutines HelloNew IPO InstCombine Instrumentation Scalar Utils Vectorize ObjCARC CFGuard
-
-[component_0]
-type = Group
-name = Transforms
-parent = Libraries

diff  --git a/llvm/lib/Transforms/ObjCARC/CMakeLists.txt b/llvm/lib/Transforms/ObjCARC/CMakeLists.txt
index 774f150c5791..9d234cce5f88 100644
--- a/llvm/lib/Transforms/ObjCARC/CMakeLists.txt
+++ b/llvm/lib/Transforms/ObjCARC/CMakeLists.txt
@@ -14,4 +14,13 @@ add_llvm_component_library(LLVMObjCARCOpts
 
   DEPENDS
   intrinsics_gen
+
+  COMPONENT_NAME
+  ObjCARC
+
+  LINK_COMPONENTS
+  Analysis
+  Core
+  Support
+  TransformUtils
   )

diff  --git a/llvm/lib/Transforms/ObjCARC/LLVMBuild.txt b/llvm/lib/Transforms/ObjCARC/LLVMBuild.txt
deleted file mode 100644
index 97af03be2400..000000000000
--- a/llvm/lib/Transforms/ObjCARC/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Transforms/ObjCARC/LLVMBuild.txt -------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = ObjCARC
-parent = Transforms
-library_name = ObjCARCOpts
-required_libraries = Analysis Core Support TransformUtils

diff  --git a/llvm/lib/Transforms/Scalar/CMakeLists.txt b/llvm/lib/Transforms/Scalar/CMakeLists.txt
index 030fb31bc646..0f7559e4ea77 100644
--- a/llvm/lib/Transforms/Scalar/CMakeLists.txt
+++ b/llvm/lib/Transforms/Scalar/CMakeLists.txt
@@ -82,4 +82,15 @@ add_llvm_component_library(LLVMScalarOpts
 
   DEPENDS
   intrinsics_gen
+
+  COMPONENT_NAME
+  Scalar
+
+  LINK_COMPONENTS
+  AggressiveInstCombine
+  Analysis
+  Core
+  InstCombine
+  Support
+  TransformUtils
   )

diff  --git a/llvm/lib/Transforms/Scalar/LLVMBuild.txt b/llvm/lib/Transforms/Scalar/LLVMBuild.txt
deleted file mode 100644
index 69f6c82f27f9..000000000000
--- a/llvm/lib/Transforms/Scalar/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Transforms/Scalar/LLVMBuild.txt --------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = Scalar
-parent = Transforms
-library_name = ScalarOpts
-required_libraries = AggressiveInstCombine Analysis Core InstCombine Support TransformUtils

diff  --git a/llvm/lib/Transforms/Utils/CMakeLists.txt b/llvm/lib/Transforms/Utils/CMakeLists.txt
index 2ef17dc595fa..cfa177a74626 100644
--- a/llvm/lib/Transforms/Utils/CMakeLists.txt
+++ b/llvm/lib/Transforms/Utils/CMakeLists.txt
@@ -79,4 +79,9 @@ add_llvm_component_library(LLVMTransformUtils
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  Analysis
+  Core
+  Support
   )

diff  --git a/llvm/lib/Transforms/Utils/LLVMBuild.txt b/llvm/lib/Transforms/Utils/LLVMBuild.txt
deleted file mode 100644
index df9a023b5132..000000000000
--- a/llvm/lib/Transforms/Utils/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/Transforms/Utils/LLVMBuild.txt ---------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = TransformUtils
-parent = Transforms
-required_libraries = Analysis Core Support

diff  --git a/llvm/lib/Transforms/Vectorize/CMakeLists.txt b/llvm/lib/Transforms/Vectorize/CMakeLists.txt
index 6f3071ea74a1..bacf6c6f1823 100644
--- a/llvm/lib/Transforms/Vectorize/CMakeLists.txt
+++ b/llvm/lib/Transforms/Vectorize/CMakeLists.txt
@@ -18,4 +18,10 @@ add_llvm_component_library(LLVMVectorize
 
   DEPENDS
   intrinsics_gen
+
+  LINK_COMPONENTS
+  Analysis
+  Core
+  Support
+  TransformUtils
   )

diff  --git a/llvm/lib/Transforms/Vectorize/LLVMBuild.txt b/llvm/lib/Transforms/Vectorize/LLVMBuild.txt
deleted file mode 100644
index 89346652ddee..000000000000
--- a/llvm/lib/Transforms/Vectorize/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/Transforms/Scalar/LLVMBuild.txt --------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = Vectorize
-parent = Transforms
-library_name = Vectorize
-required_libraries = Analysis Core Support TransformUtils

diff  --git a/llvm/lib/WindowsManifest/CMakeLists.txt b/llvm/lib/WindowsManifest/CMakeLists.txt
index 0f597af3c36f..8134ac8c815b 100644
--- a/llvm/lib/WindowsManifest/CMakeLists.txt
+++ b/llvm/lib/WindowsManifest/CMakeLists.txt
@@ -10,7 +10,13 @@ add_llvm_component_library(LLVMWindowsManifest
   ADDITIONAL_HEADER_DIRS
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/WindowsManifest
   ${Backtrace_INCLUDE_DIRS}
-  LINK_LIBS ${imported_libs})
+
+  LINK_LIBS
+  ${imported_libs}
+
+  LINK_COMPONENTS
+  Support
+  )
 
 # This block is only needed for llvm-config. When we deprecate llvm-config and
 # move to using CMake export, this block can be removed.

diff  --git a/llvm/lib/WindowsManifest/LLVMBuild.txt b/llvm/lib/WindowsManifest/LLVMBuild.txt
deleted file mode 100644
index 385f20cca5eb..000000000000
--- a/llvm/lib/WindowsManifest/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./lib/WindowsManifest/LLVMBuild.txt ----------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = WindowsManifest
-parent = Libraries
-required_libraries = Support

diff  --git a/llvm/lib/XRay/CMakeLists.txt b/llvm/lib/XRay/CMakeLists.txt
index e56cf4a1d83e..55e786a1d263 100644
--- a/llvm/lib/XRay/CMakeLists.txt
+++ b/llvm/lib/XRay/CMakeLists.txt
@@ -17,4 +17,8 @@ add_llvm_component_library(LLVMXRay
   ADDITIONAL_HEADER_DIRS
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/ADT
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/XRay
+
+  LINK_COMPONENTS
+  Support
+  Object
   )

diff  --git a/llvm/lib/XRay/LLVMBuild.txt b/llvm/lib/XRay/LLVMBuild.txt
deleted file mode 100644
index 3bf556f0dd24..000000000000
--- a/llvm/lib/XRay/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./lib/XRay/LLVMBuild.txt ---------------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = XRay
-parent = Libraries
-required_libraries = Support Object
-installed = 1

diff  --git a/llvm/projects/LLVMBuild.txt b/llvm/projects/LLVMBuild.txt
deleted file mode 100644
index 17ffc8a6cc6e..000000000000
--- a/llvm/projects/LLVMBuild.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-;===- ./projects/LLVMBuild.txt ---------------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Group
-name = Projects
-parent = $ROOT

diff  --git a/llvm/tools/LLVMBuild.txt b/llvm/tools/LLVMBuild.txt
deleted file mode 100644
index 8f9aaa5349ea..000000000000
--- a/llvm/tools/LLVMBuild.txt
+++ /dev/null
@@ -1,63 +0,0 @@
-;===- ./tools/LLVMBuild.txt ------------------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories =
- bugpoint
- dsymutil
- llc
- lli
- llvm-ar
- llvm-as
- llvm-bcanalyzer
- llvm-cat
- llvm-cfi-verify
- llvm-cov
- llvm-cvtres
- llvm-
diff 
- llvm-dis
- llvm-dwarfdump
- llvm-dwp
- llvm-elfabi
- llvm-ifs
- llvm-exegesis
- llvm-extract
- llvm-jitlistener
- llvm-jitlink
- llvm-link
- llvm-lto
- llvm-mc
- llvm-mca
- llvm-modextract
- llvm-mt
- llvm-nm
- llvm-objcopy
- llvm-objdump
- llvm-pdbutil
- llvm-profdata
- llvm-rc
- llvm-reduce
- llvm-rtdyld
- llvm-size
- llvm-split
- llvm-undname
- opt
- verify-uselistorder
-
-[component_0]
-type = Group
-name = Tools
-parent = $ROOT

diff  --git a/llvm/tools/bugpoint/LLVMBuild.txt b/llvm/tools/bugpoint/LLVMBuild.txt
deleted file mode 100644
index a0be9ab7ea03..000000000000
--- a/llvm/tools/bugpoint/LLVMBuild.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-;===- ./tools/bugpoint/LLVMBuild.txt ---------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = bugpoint
-parent = Tools
-required_libraries =
- AsmParser
- BitReader
- BitWriter
- CodeGen
- IRReader
- IPO
- Instrumentation
- Linker
- ObjCARC
- Scalar
- all-targets

diff  --git a/llvm/tools/dsymutil/LLVMBuild.txt b/llvm/tools/dsymutil/LLVMBuild.txt
deleted file mode 100644
index 819d3c4b30d9..000000000000
--- a/llvm/tools/dsymutil/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/dsymutil/LLVMBuild.txt ---------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = dsymutil
-parent = Tools
-required_libraries = AsmPrinter DebugInfoDWARF DWARFLinker MC Object CodeGen Support all-targets

diff  --git a/llvm/tools/llc/LLVMBuild.txt b/llvm/tools/llc/LLVMBuild.txt
deleted file mode 100644
index 53fdeaf81991..000000000000
--- a/llvm/tools/llc/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llc/LLVMBuild.txt --------------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llc
-parent = Tools
-required_libraries = AsmParser BitReader IRReader MIRParser TransformUtils Scalar Vectorize all-targets

diff  --git a/llvm/tools/lli/ChildTarget/LLVMBuild.txt b/llvm/tools/lli/ChildTarget/LLVMBuild.txt
deleted file mode 100644
index 7c3d813aa71e..000000000000
--- a/llvm/tools/lli/ChildTarget/LLVMBuild.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-;===- ./tools/lli/ChildTarget/LLVMBuild.txt --------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = lli-child-target
-parent = lli

diff  --git a/llvm/tools/lli/LLVMBuild.txt b/llvm/tools/lli/LLVMBuild.txt
deleted file mode 100644
index 0d473cbe9238..000000000000
--- a/llvm/tools/lli/LLVMBuild.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-;===- ./tools/lli/LLVMBuild.txt --------------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = ChildTarget
-
-[component_0]
-type = Tool
-name = lli
-parent = Tools
-required_libraries =
- AsmParser
- BitReader
- IRReader
- Instrumentation
- Interpreter
- MCJIT
- OrcJIT
- OrcShared
- OrcTargetProcess
- Native
- NativeCodeGen
- SelectionDAG
- TransformUtils

diff  --git a/llvm/tools/llvm-ar/LLVMBuild.txt b/llvm/tools/llvm-ar/LLVMBuild.txt
deleted file mode 100644
index 7247851829c3..000000000000
--- a/llvm/tools/llvm-ar/LLVMBuild.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-;===- ./tools/llvm-ar/LLVMBuild.txt ----------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-ar
-parent = Tools

diff  --git a/llvm/tools/llvm-as/LLVMBuild.txt b/llvm/tools/llvm-as/LLVMBuild.txt
deleted file mode 100644
index 2e037e860a65..000000000000
--- a/llvm/tools/llvm-as/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-as/LLVMBuild.txt ----------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-as
-parent = Tools
-required_libraries = AsmParser BitWriter

diff  --git a/llvm/tools/llvm-bcanalyzer/LLVMBuild.txt b/llvm/tools/llvm-bcanalyzer/LLVMBuild.txt
deleted file mode 100644
index c3b69110747e..000000000000
--- a/llvm/tools/llvm-bcanalyzer/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-bcanalyzer/LLVMBuild.txt --------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-bcanalyzer
-parent = Tools
-required_libraries = BitReader BitstreamReader Support

diff  --git a/llvm/tools/llvm-cat/LLVMBuild.txt b/llvm/tools/llvm-cat/LLVMBuild.txt
deleted file mode 100644
index 1a85099674ed..000000000000
--- a/llvm/tools/llvm-cat/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-cat/LLVMBuild.txt ---------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-cat
-parent = Tools
-required_libraries = AsmParser BitReader BitWriter

diff  --git a/llvm/tools/llvm-cfi-verify/LLVMBuild.txt b/llvm/tools/llvm-cfi-verify/LLVMBuild.txt
deleted file mode 100644
index 63a5dc562959..000000000000
--- a/llvm/tools/llvm-cfi-verify/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-cfi-verify/LLVMBuild.txt --------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-cfi-verify
-parent = Tools
-required_libraries = all-targets MC MCDisassembler MCParser Support Symbolize

diff  --git a/llvm/tools/llvm-cfi-verify/lib/LLVMBuild.txt b/llvm/tools/llvm-cfi-verify/lib/LLVMBuild.txt
deleted file mode 100644
index 7083e35d99e7..000000000000
--- a/llvm/tools/llvm-cfi-verify/lib/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-cfi-verify/lib/LLVMBuild.txt ----------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = CFIVerify
-parent = Libraries
-required_libraries = DebugInfoDWARF MC MCDisassembler MCParser Support Symbolize

diff  --git a/llvm/tools/llvm-cov/LLVMBuild.txt b/llvm/tools/llvm-cov/LLVMBuild.txt
deleted file mode 100644
index e6aff83ac555..000000000000
--- a/llvm/tools/llvm-cov/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-cov/LLVMBuild.txt ---------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-cov
-parent = Tools
-required_libraries = Coverage Support Instrumentation

diff  --git a/llvm/tools/llvm-cvtres/LLVMBuild.txt b/llvm/tools/llvm-cvtres/LLVMBuild.txt
deleted file mode 100644
index d24c947e4e77..000000000000
--- a/llvm/tools/llvm-cvtres/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-cvtres/LLVMBuild.txt ------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-cvtres
-parent = Tools
-required_libraries = Object Option Support

diff  --git a/llvm/tools/llvm-cxxdump/LLVMBuild.txt b/llvm/tools/llvm-cxxdump/LLVMBuild.txt
deleted file mode 100644
index a46c78bd3efc..000000000000
--- a/llvm/tools/llvm-cxxdump/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-cxxdump/LLVMBuild.txt -----------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-cxxdump
-parent = Tools
-required_libraries = all-targets BitReader Object

diff  --git a/llvm/tools/llvm-cxxmap/LLVMBuild.txt b/llvm/tools/llvm-cxxmap/LLVMBuild.txt
deleted file mode 100644
index 92c4242da0f2..000000000000
--- a/llvm/tools/llvm-cxxmap/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-cxxmap/LLVMBuild.txt ------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-cxxmap
-parent = Tools
-required_libraries = Support

diff  --git a/llvm/tools/llvm-
diff /LLVMBuild.txt b/llvm/tools/llvm-
diff /LLVMBuild.txt
deleted file mode 100644
index f7bba4773546..000000000000
--- a/llvm/tools/llvm-
diff /LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-
diff /LLVMBuild.txt --------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-
diff 
-parent = Tools
-required_libraries = AsmParser BitReader IRReader

diff  --git a/llvm/tools/llvm-dis/LLVMBuild.txt b/llvm/tools/llvm-dis/LLVMBuild.txt
deleted file mode 100644
index ca8e11ee4304..000000000000
--- a/llvm/tools/llvm-dis/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-dis/LLVMBuild.txt ---------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-dis
-parent = Tools
-required_libraries = Analysis BitReader

diff  --git a/llvm/tools/llvm-dwarfdump/LLVMBuild.txt b/llvm/tools/llvm-dwarfdump/LLVMBuild.txt
deleted file mode 100644
index 4eda51443213..000000000000
--- a/llvm/tools/llvm-dwarfdump/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-dwarfdump/LLVMBuild.txt ---------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-dwarfdump
-parent = Tools
-required_libraries = DebugInfoDWARF Object

diff  --git a/llvm/tools/llvm-dwp/LLVMBuild.txt b/llvm/tools/llvm-dwp/LLVMBuild.txt
deleted file mode 100644
index f83e5581e6b5..000000000000
--- a/llvm/tools/llvm-dwp/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./tools/llvm-dwp/LLVMBuild.txt ---------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-dwp
-parent = Tools
-required_libraries = AsmPrinter DebugInfoDWARF MC Object Support all-targets
-

diff  --git a/llvm/tools/llvm-elfabi/LLVMBuild.txt b/llvm/tools/llvm-elfabi/LLVMBuild.txt
deleted file mode 100644
index 4e8021442fb6..000000000000
--- a/llvm/tools/llvm-elfabi/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-elfabi/LLVMBuild.txt ------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-elfabi
-parent = Tools
-required_libraries = InterfaceStub Object Support TextAPI

diff  --git a/llvm/tools/llvm-exegesis/LLVMBuild.txt b/llvm/tools/llvm-exegesis/LLVMBuild.txt
deleted file mode 100644
index d13f2abea979..000000000000
--- a/llvm/tools/llvm-exegesis/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-exegesis/LLVMBuild.txt ----------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-exegesis
-parent = Tools
-required_libraries = CodeGen ExecutionEngine MC MCJIT Native NativeCodeGen Object Support

diff  --git a/llvm/tools/llvm-exegesis/lib/AArch64/LLVMBuild.txt b/llvm/tools/llvm-exegesis/lib/AArch64/LLVMBuild.txt
deleted file mode 100644
index dcbf72efd3c0..000000000000
--- a/llvm/tools/llvm-exegesis/lib/AArch64/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-exegesis/lib/AArch64/LLVMBuild.txt ----------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = ExegesisAArch64
-parent = Libraries
-required_libraries = AArch64

diff  --git a/llvm/tools/llvm-exegesis/lib/LLVMBuild.txt b/llvm/tools/llvm-exegesis/lib/LLVMBuild.txt
deleted file mode 100644
index 85a18f2cf4c9..000000000000
--- a/llvm/tools/llvm-exegesis/lib/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-exegesis/lib/LLVMBuild.txt ------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = Exegesis
-parent = Libraries
-required_libraries = CodeGen ExecutionEngine MC MCDisassembler MCJIT Object ObjectYAML Support

diff  --git a/llvm/tools/llvm-exegesis/lib/Mips/LLVMBuild.txt b/llvm/tools/llvm-exegesis/lib/Mips/LLVMBuild.txt
deleted file mode 100644
index bfbeda03b3f6..000000000000
--- a/llvm/tools/llvm-exegesis/lib/Mips/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-exegesis/lib/Mips/LLVMBuild.txt -------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = ExegesisMips
-parent = Libraries
-required_libraries = Mips

diff  --git a/llvm/tools/llvm-exegesis/lib/PowerPC/LLVMBuild.txt b/llvm/tools/llvm-exegesis/lib/PowerPC/LLVMBuild.txt
deleted file mode 100644
index 0e1b94a39a6e..000000000000
--- a/llvm/tools/llvm-exegesis/lib/PowerPC/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-exegesis/lib/PowerPC/LLVMBuild.txt ---------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = ExegesisPowerPC
-parent = Libraries
-required_libraries = PowerPC

diff  --git a/llvm/tools/llvm-exegesis/lib/X86/LLVMBuild.txt b/llvm/tools/llvm-exegesis/lib/X86/LLVMBuild.txt
deleted file mode 100644
index 58a6596e3da3..000000000000
--- a/llvm/tools/llvm-exegesis/lib/X86/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-exegesis/lib/X86LLVMBuild.txt ---------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = ExegesisX86
-parent = Libraries
-required_libraries = X86

diff  --git a/llvm/tools/llvm-extract/LLVMBuild.txt b/llvm/tools/llvm-extract/LLVMBuild.txt
deleted file mode 100644
index 77072b4e899a..000000000000
--- a/llvm/tools/llvm-extract/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-extract/LLVMBuild.txt -----------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-extract
-parent = Tools
-required_libraries = AsmParser BitReader BitWriter IRReader IPO

diff  --git a/llvm/tools/llvm-ifs/LLVMBuild.txt b/llvm/tools/llvm-ifs/LLVMBuild.txt
deleted file mode 100644
index 10dc6bd8f550..000000000000
--- a/llvm/tools/llvm-ifs/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-ifs/LLVMBuild.txt ---------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-ifs
-parent = Tools
-required_libraries = Object Support TextAPI

diff  --git a/llvm/tools/llvm-jitlink/LLVMBuild.txt b/llvm/tools/llvm-jitlink/LLVMBuild.txt
deleted file mode 100644
index 8aa0ef8161e6..000000000000
--- a/llvm/tools/llvm-jitlink/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./tools/llvm-jitlink/LLVMBuild.txt -----------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-jitlink
-parent = Tools
-required_libraries = JITLink BinaryFormat MC Object OrcJIT OrcTargetProcess
-                     Support all-targets

diff  --git a/llvm/tools/llvm-jitlistener/LLVMBuild.txt b/llvm/tools/llvm-jitlistener/LLVMBuild.txt
deleted file mode 100644
index 4a1390d00571..000000000000
--- a/llvm/tools/llvm-jitlistener/LLVMBuild.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-;===- ./tools/llvm-jitlistener/LLVMBuild.txt -------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-jitlistener
-parent = Tools
-required_libraries =
- AsmParser
- BitReader
- IRReader
- Interpreter
- MCJIT
- NativeCodeGen
- Object
- SelectionDAG
- Native

diff  --git a/llvm/tools/llvm-libtool-darwin/LLVMBuild.txt b/llvm/tools/llvm-libtool-darwin/LLVMBuild.txt
deleted file mode 100644
index a31a3a1400f5..000000000000
--- a/llvm/tools/llvm-libtool-darwin/LLVMBuild.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-;===- ./tools/llvm-libtool-darwin/LVMBuild.txt -----------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-[component_0]
-type = Tool
-name = llvm-libtool-darwin
-parent = Tools
-required_libraries = BinaryFormat Object Support TextAPI

diff  --git a/llvm/tools/llvm-link/LLVMBuild.txt b/llvm/tools/llvm-link/LLVMBuild.txt
deleted file mode 100644
index adc6a25c8b5f..000000000000
--- a/llvm/tools/llvm-link/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-link/LLVMBuild.txt --------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-link
-parent = Tools
-required_libraries = AsmParser BitReader BitWriter IRReader Linker Object TransformUtils IPO

diff  --git a/llvm/tools/llvm-lipo/LLVMBuild.txt b/llvm/tools/llvm-lipo/LLVMBuild.txt
deleted file mode 100644
index 744c9add7e3a..000000000000
--- a/llvm/tools/llvm-lipo/LLVMBuild.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-;===- ./tools/llvm-lipo/LLVMBuild.txt --------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-[component_0]
-type = Tool
-name = llvm-lipo
-parent = Tools
-required_libraries = Object Option Support BinaryFormat

diff  --git a/llvm/tools/llvm-lto/LLVMBuild.txt b/llvm/tools/llvm-lto/LLVMBuild.txt
deleted file mode 100644
index bc7cdcd2db94..000000000000
--- a/llvm/tools/llvm-lto/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-lto/LLVMBuild.txt ----------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-lto
-parent = Tools
-required_libraries = BitWriter Core IRReader LTO Object Support all-targets

diff  --git a/llvm/tools/llvm-lto2/LLVMBuild.txt b/llvm/tools/llvm-lto2/LLVMBuild.txt
deleted file mode 100644
index 1665b331202c..000000000000
--- a/llvm/tools/llvm-lto2/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-lto2/LLVMBuild.txt --------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-lto2
-parent = Tools
-required_libraries = BitReader Core Linker LTO MC Object Support all-targets

diff  --git a/llvm/tools/llvm-mc/LLVMBuild.txt b/llvm/tools/llvm-mc/LLVMBuild.txt
deleted file mode 100644
index 64f8ed0a9896..000000000000
--- a/llvm/tools/llvm-mc/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-mc/LLVMBuild.txt ----------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-mc
-parent = Tools
-required_libraries = MC MCDisassembler MCParser Support all-targets

diff  --git a/llvm/tools/llvm-mca/LLVMBuild.txt b/llvm/tools/llvm-mca/LLVMBuild.txt
deleted file mode 100644
index d1f9fc81060c..000000000000
--- a/llvm/tools/llvm-mca/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-mc/LLVMBuild.txt ----------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-mca
-parent = Tools
-required_libraries = MC MCA MCParser Support all-targets

diff  --git a/llvm/tools/llvm-modextract/LLVMBuild.txt b/llvm/tools/llvm-modextract/LLVMBuild.txt
deleted file mode 100644
index 24cb8806d1c9..000000000000
--- a/llvm/tools/llvm-modextract/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-modextract/LLVMBuild.txt --------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-modextract
-parent = Tools
-required_libraries = BitReader BitWriter

diff  --git a/llvm/tools/llvm-mt/LLVMBuild.txt b/llvm/tools/llvm-mt/LLVMBuild.txt
deleted file mode 100644
index 322477023041..000000000000
--- a/llvm/tools/llvm-mt/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-mt/LLVMBuild.txt ---------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-mt
-parent = Tools
-required_libraries = Option Support WindowsManifest

diff  --git a/llvm/tools/llvm-nm/LLVMBuild.txt b/llvm/tools/llvm-nm/LLVMBuild.txt
deleted file mode 100644
index 1486786c2c74..000000000000
--- a/llvm/tools/llvm-nm/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-nm/LLVMBuild.txt ----------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-nm
-parent = Tools
-required_libraries = BitReader Object

diff  --git a/llvm/tools/llvm-objcopy/LLVMBuild.txt b/llvm/tools/llvm-objcopy/LLVMBuild.txt
deleted file mode 100644
index 8951715c3647..000000000000
--- a/llvm/tools/llvm-objcopy/LLVMBuild.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-;===- ./tools/llvm-objcopy/LLVMBuild.txt -----------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-[component_0]
-type = Tool
-name = llvm-objcopy
-parent = Tools
-required_libraries = Object Option Support MC

diff  --git a/llvm/tools/llvm-objdump/LLVMBuild.txt b/llvm/tools/llvm-objdump/LLVMBuild.txt
deleted file mode 100644
index 3aea3b7432ce..000000000000
--- a/llvm/tools/llvm-objdump/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-objdump/LLVMBuild.txt -----------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-objdump
-parent = Tools
-required_libraries = DebugInfoDWARF MC MCDisassembler MCParser Object all-targets Demangle

diff  --git a/llvm/tools/llvm-pdbutil/LLVMBuild.txt b/llvm/tools/llvm-pdbutil/LLVMBuild.txt
deleted file mode 100644
index c694058dabd2..000000000000
--- a/llvm/tools/llvm-pdbutil/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./tools/llvm-pdbutil/LLVMBuild.txt -----------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-pdbutil
-parent = Tools
-required_libraries = DebugInfoMSF DebugInfoPDB
-

diff  --git a/llvm/tools/llvm-profdata/LLVMBuild.txt b/llvm/tools/llvm-profdata/LLVMBuild.txt
deleted file mode 100644
index 6378fafd99b0..000000000000
--- a/llvm/tools/llvm-profdata/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-profdata/LLVMBuild.txt ----------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-profdata
-parent = Tools
-required_libraries = ProfileData Support

diff  --git a/llvm/tools/llvm-rc/LLVMBuild.txt b/llvm/tools/llvm-rc/LLVMBuild.txt
deleted file mode 100644
index 1a96eaa05401..000000000000
--- a/llvm/tools/llvm-rc/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-rc/LLVMBuild.txt ----------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-rc
-parent = Tools
-required_libraries = Option

diff  --git a/llvm/tools/llvm-readobj/LLVMBuild.txt b/llvm/tools/llvm-readobj/LLVMBuild.txt
deleted file mode 100644
index a6963658e51b..000000000000
--- a/llvm/tools/llvm-readobj/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-readobj/LLVMBuild.txt ---------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-readobj
-parent = Tools
-required_libraries = all-targets BitReader Object BinaryFormat DebugInfoCodeView DebugInfoPDB DebugInfoMSF

diff  --git a/llvm/tools/llvm-reduce/LLVMBuild.txt b/llvm/tools/llvm-reduce/LLVMBuild.txt
deleted file mode 100644
index 7928f0503283..000000000000
--- a/llvm/tools/llvm-reduce/LLVMBuild.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-;===- ./tools/llvm-reduce/LLVMBuild.txt ------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-reduce
-parent = Tools
-required_libraries =
- BitReader
- IRReader
- all-targets

diff  --git a/llvm/tools/llvm-rtdyld/LLVMBuild.txt b/llvm/tools/llvm-rtdyld/LLVMBuild.txt
deleted file mode 100644
index 38d29a14262f..000000000000
--- a/llvm/tools/llvm-rtdyld/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-rtdyld/LLVMBuild.txt ------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-rtdyld
-parent = Tools
-required_libraries = MC Object RuntimeDyld Support all-targets

diff  --git a/llvm/tools/llvm-size/LLVMBuild.txt b/llvm/tools/llvm-size/LLVMBuild.txt
deleted file mode 100644
index 5ae7fc39aec8..000000000000
--- a/llvm/tools/llvm-size/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-size/LLVMBuild.txt --------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-size
-parent = Tools
-required_libraries = Object

diff  --git a/llvm/tools/llvm-split/LLVMBuild.txt b/llvm/tools/llvm-split/LLVMBuild.txt
deleted file mode 100644
index 546f455a891d..000000000000
--- a/llvm/tools/llvm-split/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-split/LLVMBuild.txt -------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-split
-parent = Tools
-required_libraries = TransformUtils BitWriter Core IRReader Support

diff  --git a/llvm/tools/llvm-stress/LLVMBuild.txt b/llvm/tools/llvm-stress/LLVMBuild.txt
deleted file mode 100644
index abea0b1b0f73..000000000000
--- a/llvm/tools/llvm-stress/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-stress/LLVMBuild.txt -------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-stress
-parent = Tools
-required_libraries = AsmParser BitReader BitWriter IPO Instrumentation Scalar

diff  --git a/llvm/tools/llvm-strings/LLVMBuild.txt b/llvm/tools/llvm-strings/LLVMBuild.txt
deleted file mode 100644
index ec3369348112..000000000000
--- a/llvm/tools/llvm-strings/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/llvm-strings/LLVMBuild.txt -----------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-strings
-parent = Tools
-required_libraries = Archive Object

diff  --git a/llvm/tools/llvm-undname/LLVMBuild.txt b/llvm/tools/llvm-undname/LLVMBuild.txt
deleted file mode 100644
index a931bfa32677..000000000000
--- a/llvm/tools/llvm-undname/LLVMBuild.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-;===- ./tools/llvm-undname/LLVMBuild.txt -----------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = llvm-undname
-parent = Tools
-required_libraries = Demangle Support
-

diff  --git a/llvm/tools/opt/LLVMBuild.txt b/llvm/tools/opt/LLVMBuild.txt
deleted file mode 100644
index 70d44f298675..000000000000
--- a/llvm/tools/opt/LLVMBuild.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-;===- ./tools/opt/LLVMBuild.txt --------------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = opt
-parent = Tools
-required_libraries =
- AsmParser
- BitReader
- BitWriter
- CodeGen
- IRReader
- IPO
- Instrumentation
- Scalar
- ObjCARC
- Passes
- all-targets

diff  --git a/llvm/tools/verify-uselistorder/LLVMBuild.txt b/llvm/tools/verify-uselistorder/LLVMBuild.txt
deleted file mode 100644
index 7f8029390811..000000000000
--- a/llvm/tools/verify-uselistorder/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./tools/verify-uselistorder/LLVMBuild.txt ----------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Tool
-name = verify-uselistorder
-parent = Tools
-required_libraries = IRReader BitWriter Support

diff  --git a/llvm/utils/LLVMBuild.txt b/llvm/utils/LLVMBuild.txt
deleted file mode 100644
index 2bf879755f53..000000000000
--- a/llvm/utils/LLVMBuild.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-;===- ./utils/LLVMBuild.txt ------------------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[common]
-subdirectories = TableGen unittest
-
-[component_0]
-type = Group
-name = BuildTools
-parent = $ROOT
-
-[component_1]
-type = Group
-name = UtilityTools
-parent = $ROOT

diff  --git a/llvm/utils/TableGen/LLVMBuild.txt b/llvm/utils/TableGen/LLVMBuild.txt
deleted file mode 100644
index 6293aa0e4024..000000000000
--- a/llvm/utils/TableGen/LLVMBuild.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-;===- ./utils/TableGen/LLVMBuild.txt ---------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = BuildTool
-name = tblgen
-parent = BuildTools
-required_libraries = Support TableGen

diff  --git a/llvm/utils/llvm-build/README.txt b/llvm/utils/llvm-build/README.txt
deleted file mode 100644
index b6bcaae0f1df..000000000000
--- a/llvm/utils/llvm-build/README.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-==============================
- llvm-build - LLVM Build Tool
-==============================
-
-`llvm-build` is a tool for helping build the LLVM project.

diff  --git a/llvm/utils/llvm-build/llvm-build b/llvm/utils/llvm-build/llvm-build
deleted file mode 100755
index 7377e3d3fed7..000000000000
--- a/llvm/utils/llvm-build/llvm-build
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/usr/bin/env python
-
-import llvmbuild
-
-if __name__ == '__main__':
-   llvmbuild.main()

diff  --git a/llvm/utils/llvm-build/llvmbuild/__init__.py b/llvm/utils/llvm-build/llvmbuild/__init__.py
deleted file mode 100644
index eb20d0989882..000000000000
--- a/llvm/utils/llvm-build/llvmbuild/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from llvmbuild.main import main

diff  --git a/llvm/utils/llvm-build/llvmbuild/componentinfo.py b/llvm/utils/llvm-build/llvmbuild/componentinfo.py
deleted file mode 100644
index 0e9d08915fba..000000000000
--- a/llvm/utils/llvm-build/llvmbuild/componentinfo.py
+++ /dev/null
@@ -1,475 +0,0 @@
-"""
-Descriptor objects for entities that are part of the LLVM project.
-"""
-
-from __future__ import absolute_import, print_function
-try:
-    import configparser
-except:
-    import ConfigParser as configparser
-import sys
-
-from llvmbuild.util import fatal, warning
-
-class ParseError(Exception):
-    pass
-
-class ComponentInfo(object):
-    """
-    Base class for component descriptions.
-    """
-
-    type_name = None
-
-    @staticmethod
-    def parse_items(items, has_dependencies = True):
-        kwargs = {}
-        kwargs['name'] = items.get_string('name')
-        kwargs['parent'] = items.get_optional_string('parent')
-        if has_dependencies:
-            kwargs['dependencies'] = items.get_list('dependencies')
-        return kwargs
-
-    def __init__(self, subpath, name, dependencies, parent):
-        if not subpath.startswith('/'):
-            raise ValueError("invalid subpath: %r" % subpath)
-        self.subpath = subpath
-        self.name = name
-        self.dependencies = list(dependencies)
-
-        # The name of the parent component to logically group this component
-        # under.
-        self.parent = parent
-
-        # The parent instance, once loaded.
-        self.parent_instance = None
-        self.children = []
-
-        # The original source path.
-        self._source_path = None
-
-        # A flag to mark "special" components which have some amount of magic
-        # handling (generally based on command line options).
-        self._is_special_group = False
-
-    def set_parent_instance(self, parent):
-        assert parent.name == self.parent, "Unexpected parent!"
-        self.parent_instance = parent
-        self.parent_instance.children.append(self)
-
-    def get_component_references(self):
-        """get_component_references() -> iter
-
-        Return an iterator over the named references to other components from
-        this object. Items are of the form (reference-type, component-name).
-        """
-
-        # Parent references are handled specially.
-        for r in self.dependencies:
-            yield ('dependency', r)
-
-    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,
-    but exist to help organize other components into a logical tree structure.
-    """
-
-    type_name = 'Group'
-
-    @staticmethod
-    def parse(subpath, items):
-        kwargs = ComponentInfo.parse_items(items, has_dependencies = False)
-        return GroupComponentInfo(subpath, **kwargs)
-
-    def __init__(self, subpath, name, parent):
-        ComponentInfo.__init__(self, subpath, name, [], parent)
-
-    def get_llvmbuild_fragment(self):
-        return """\
-type = %s
-name = %s
-parent = %s
-""" % (self.type_name, self.name, self.parent)
-
-class LibraryComponentInfo(ComponentInfo):
-    type_name = 'Library'
-
-    @staticmethod
-    def parse_items(items):
-        kwargs = ComponentInfo.parse_items(items)
-        kwargs['library_name'] = items.get_optional_string('library_name')
-        kwargs['required_libraries'] = items.get_list('required_libraries')
-        kwargs['add_to_library_groups'] = items.get_list(
-            'add_to_library_groups')
-        kwargs['installed'] = items.get_optional_bool('installed', True)
-        return kwargs
-
-    @staticmethod
-    def parse(subpath, items):
-        kwargs = LibraryComponentInfo.parse_items(items)
-        return LibraryComponentInfo(subpath, **kwargs)
-
-    def __init__(self, subpath, name, dependencies, parent, library_name,
-                 required_libraries, add_to_library_groups, installed):
-        ComponentInfo.__init__(self, subpath, name, dependencies, parent)
-
-        # If given, the name to use for the library instead of deriving it from
-        # the component name.
-        self.library_name = library_name
-
-        # The names of the library components which are required when linking
-        # with this component.
-        self.required_libraries = list(required_libraries)
-
-        # The names of the library group components this component should be
-        # considered part of.
-        self.add_to_library_groups = list(add_to_library_groups)
-
-        # Whether or not this library is installed.
-        self.installed = installed
-
-    def get_component_references(self):
-        for r in ComponentInfo.get_component_references(self):
-            yield r
-        for r in self.required_libraries:
-            yield ('required library', r)
-        for r in self.add_to_library_groups:
-            yield ('library group', r)
-
-    def get_llvmbuild_fragment(self):
-        result = """\
-type = %s
-name = %s
-parent = %s
-""" % (self.type_name, self.name, self.parent)
-        if self.library_name is not None:
-            result += 'library_name = %s\n' % self.library_name
-        if self.required_libraries:
-            result += 'required_libraries = %s\n' % ' '.join(
-                self.required_libraries)
-        if self.add_to_library_groups:
-            result += 'add_to_library_groups = %s\n' % ' '.join(
-                self.add_to_library_groups)
-        if not self.installed:
-            result += 'installed = 0\n'
-        return result
-
-    def get_library_name(self):
-        return self.library_name or self.name
-
-    def get_prefixed_library_name(self):
-        """
-        get_prefixed_library_name() -> str
-
-        Return the library name prefixed by the project name. This is generally
-        what the library name will be on disk.
-        """
-
-        basename = self.get_library_name()
-
-        # FIXME: We need to get the prefix information from an explicit project
-        # object, or something.
-        if basename in ('gtest', 'gtest_main'):
-            return basename
-
-        return 'LLVM%s' % basename
-
-    def get_llvmconfig_component_name(self):
-        return self.get_library_name().lower()
-
-class OptionalLibraryComponentInfo(LibraryComponentInfo):
-    type_name = "OptionalLibrary"
-
-    @staticmethod
-    def parse(subpath, items):
-      kwargs = LibraryComponentInfo.parse_items(items)
-      return OptionalLibraryComponentInfo(subpath, **kwargs)
-
-    def __init__(self, subpath, name, dependencies, parent, library_name,
-                 required_libraries, add_to_library_groups, installed):
-      LibraryComponentInfo.__init__(self, subpath, name, dependencies, parent,
-                                    library_name, required_libraries,
-                                    add_to_library_groups, installed)
-
-class LibraryGroupComponentInfo(ComponentInfo):
-    type_name = 'LibraryGroup'
-
-    @staticmethod
-    def parse(subpath, items):
-        kwargs = ComponentInfo.parse_items(items, has_dependencies = False)
-        kwargs['required_libraries'] = items.get_list('required_libraries')
-        kwargs['add_to_library_groups'] = items.get_list(
-            'add_to_library_groups')
-        return LibraryGroupComponentInfo(subpath, **kwargs)
-
-    def __init__(self, subpath, name, parent, required_libraries = [],
-                 add_to_library_groups = []):
-        ComponentInfo.__init__(self, subpath, name, [], parent)
-
-        # The names of the library components which are required when linking
-        # with this component.
-        self.required_libraries = list(required_libraries)
-
-        # The names of the library group components this component should be
-        # considered part of.
-        self.add_to_library_groups = list(add_to_library_groups)
-
-    def get_component_references(self):
-        for r in ComponentInfo.get_component_references(self):
-            yield r
-        for r in self.required_libraries:
-            yield ('required library', r)
-        for r in self.add_to_library_groups:
-            yield ('library group', r)
-
-    def get_llvmbuild_fragment(self):
-        result = """\
-type = %s
-name = %s
-parent = %s
-""" % (self.type_name, self.name, self.parent)
-        if self.required_libraries and not self._is_special_group:
-            result += 'required_libraries = %s\n' % ' '.join(
-                self.required_libraries)
-        if self.add_to_library_groups:
-            result += 'add_to_library_groups = %s\n' % ' '.join(
-                self.add_to_library_groups)
-        return result
-
-    def get_llvmconfig_component_name(self):
-        return self.name.lower()
-
-class TargetGroupComponentInfo(ComponentInfo):
-    type_name = 'TargetGroup'
-
-    @staticmethod
-    def parse(subpath, items):
-        kwargs = ComponentInfo.parse_items(items, has_dependencies = False)
-        kwargs['required_libraries'] = items.get_list('required_libraries')
-        kwargs['add_to_library_groups'] = items.get_list(
-            'add_to_library_groups')
-        kwargs['has_jit'] = items.get_optional_bool('has_jit', False)
-        kwargs['has_asmprinter'] = items.get_optional_bool('has_asmprinter',
-                                                           False)
-        kwargs['has_asmparser'] = items.get_optional_bool('has_asmparser',
-                                                          False)
-        kwargs['has_disassembler'] = items.get_optional_bool('has_disassembler',
-                                                             False)
-        return TargetGroupComponentInfo(subpath, **kwargs)
-
-    def __init__(self, subpath, name, parent, required_libraries = [],
-                 add_to_library_groups = [], has_jit = False,
-                 has_asmprinter = False, has_asmparser = False,
-                 has_disassembler = False):
-        ComponentInfo.__init__(self, subpath, name, [], parent)
-
-        # The names of the library components which are required when linking
-        # with this component.
-        self.required_libraries = list(required_libraries)
-
-        # The names of the library group components this component should be
-        # considered part of.
-        self.add_to_library_groups = list(add_to_library_groups)
-
-        # Whether or not this target supports the JIT.
-        self.has_jit = bool(has_jit)
-
-        # Whether or not this target defines an assembly printer.
-        self.has_asmprinter = bool(has_asmprinter)
-
-        # Whether or not this target defines an assembly parser.
-        self.has_asmparser = bool(has_asmparser)
-
-        # Whether or not this target defines an disassembler.
-        self.has_disassembler = bool(has_disassembler)
-
-        # Whether or not this target is enabled. This is set in response to
-        # configuration parameters.
-        self.enabled = False
-
-    def get_component_references(self):
-        for r in ComponentInfo.get_component_references(self):
-            yield r
-        for r in self.required_libraries:
-            yield ('required library', r)
-        for r in self.add_to_library_groups:
-            yield ('library group', r)
-
-    def get_llvmbuild_fragment(self):
-        result = """\
-type = %s
-name = %s
-parent = %s
-""" % (self.type_name, self.name, self.parent)
-        if self.required_libraries:
-            result += 'required_libraries = %s\n' % ' '.join(
-                self.required_libraries)
-        if self.add_to_library_groups:
-            result += 'add_to_library_groups = %s\n' % ' '.join(
-                self.add_to_library_groups)
-        for bool_key in ('has_asmparser', 'has_asmprinter', 'has_disassembler',
-                         'has_jit'):
-            if getattr(self, bool_key):
-                result += '%s = 1\n' % (bool_key,)
-        return result
-
-    def get_llvmconfig_component_name(self):
-        return self.name.lower()
-
-class ToolComponentInfo(ComponentInfo):
-    type_name = 'Tool'
-
-    @staticmethod
-    def parse(subpath, items):
-        kwargs = ComponentInfo.parse_items(items)
-        kwargs['required_libraries'] = items.get_list('required_libraries')
-        return ToolComponentInfo(subpath, **kwargs)
-
-    def __init__(self, subpath, name, dependencies, parent,
-                 required_libraries):
-        ComponentInfo.__init__(self, subpath, name, dependencies, parent)
-
-        # The names of the library components which are required to link this
-        # tool.
-        self.required_libraries = list(required_libraries)
-
-    def get_component_references(self):
-        for r in ComponentInfo.get_component_references(self):
-            yield r
-        for r in self.required_libraries:
-            yield ('required library', r)
-
-    def get_llvmbuild_fragment(self):
-        return """\
-type = %s
-name = %s
-parent = %s
-required_libraries = %s
-""" % (self.type_name, self.name, self.parent,
-       ' '.join(self.required_libraries))
-
-class BuildToolComponentInfo(ToolComponentInfo):
-    type_name = 'BuildTool'
-
-    @staticmethod
-    def parse(subpath, items):
-        kwargs = ComponentInfo.parse_items(items)
-        kwargs['required_libraries'] = items.get_list('required_libraries')
-        return BuildToolComponentInfo(subpath, **kwargs)
-
-###
-
-class IniFormatParser(dict):
-    def get_list(self, key):
-        # Check if the value is defined.
-        value = self.get(key)
-        if value is None:
-            return []
-
-        # Lists are just whitespace separated strings.
-        return value.split()
-
-    def get_optional_string(self, key):
-        value = self.get_list(key)
-        if not value:
-            return None
-        if len(value) > 1:
-            raise ParseError("multiple values for scalar key: %r" % key)
-        return value[0]
-
-    def get_string(self, key):
-        value = self.get_optional_string(key)
-        if not value:
-            raise ParseError("missing value for required string: %r" % key)
-        return value
-
-    def get_optional_bool(self, key, default = None):
-        value = self.get_optional_string(key)
-        if not value:
-            return default
-        if value not in ('0', '1'):
-            raise ParseError("invalid value(%r) for boolean property: %r" % (
-                    value, key))
-        return bool(int(value))
-
-    def get_bool(self, key):
-        value = self.get_optional_bool(key)
-        if value is None:
-            raise ParseError("missing value for required boolean: %r" % key)
-        return value
-
-_component_type_map = dict(
-    (t.type_name, t)
-    for t in (GroupComponentInfo,
-              LibraryComponentInfo, LibraryGroupComponentInfo,
-              ToolComponentInfo, BuildToolComponentInfo,
-              TargetGroupComponentInfo, OptionalLibraryComponentInfo))
-def load_from_path(path, subpath):
-    # Load the LLVMBuild.txt file as an .ini format file.
-    parser = configparser.RawConfigParser()
-    parser.read(path)
-
-    # Extract the common section.
-    if parser.has_section("common"):
-        common = IniFormatParser(parser.items("common"))
-        parser.remove_section("common")
-    else:
-        common = IniFormatParser({})
-
-    return common, _read_components_from_parser(parser, path, subpath)
-
-def _read_components_from_parser(parser, path, subpath):
-    # We load each section which starts with 'component' as a distinct component
-    # description (so multiple components can be described in one file).
-    for section in parser.sections():
-        if not section.startswith('component'):
-            # We don't expect arbitrary sections currently, warn the user.
-            warning("ignoring unknown section %r in %r" % (section, path))
-            continue
-
-        # Determine the type of the component to instantiate.
-        if not parser.has_option(section, 'type'):
-            fatal("invalid component %r in %r: %s" % (
-                    section, path, "no component type"))
-
-        type_name = parser.get(section, 'type')
-        type_class = _component_type_map.get(type_name)
-        if type_class is None:
-            fatal("invalid component %r in %r: %s" % (
-                    section, path, "invalid component type: %r" % type_name))
-
-        # Instantiate the component based on the remaining values.
-        try:
-            info = type_class.parse(subpath,
-                                    IniFormatParser(parser.items(section)))
-        except TypeError:
-            print("error: invalid component %r in %r: %s" % (
-                section, path, "unable to instantiate: %r" % type_name), file=sys.stderr)
-            import traceback
-            traceback.print_exc()
-            raise SystemExit(1)
-        except ParseError:
-            e = sys.exc_info()[1]
-            fatal("unable to load component %r in %r: %s" % (
-                    section, path, e.message))
-
-        info._source_path = path
-        yield info

diff  --git a/llvm/utils/llvm-build/llvmbuild/main.py b/llvm/utils/llvm-build/llvmbuild/main.py
deleted file mode 100644
index 4f64c52608f9..000000000000
--- a/llvm/utils/llvm-build/llvmbuild/main.py
+++ /dev/null
@@ -1,844 +0,0 @@
-from __future__ import absolute_import
-import filecmp
-import os
-import sys
-
-import llvmbuild.componentinfo as componentinfo
-
-from llvmbuild.util import fatal, note
-
-###
-
-def cmake_quote_string(value):
-    """
-    cmake_quote_string(value) -> str
-
-    Return a quoted form of the given value that is suitable for use in CMake
-    language files.
-    """
-
-    # Currently, we only handle escaping backslashes.
-    value = value.replace("\\", "\\\\")
-
-    return value
-
-def cmake_quote_path(value):
-    """
-    cmake_quote_path(value) -> str
-
-    Return a quoted form of the given value that is suitable for use in CMake
-    language files.
-    """
-
-    # CMake has a bug in it's Makefile generator that doesn't properly quote
-    # strings it generates. So instead of using proper quoting, we just use "/"
-    # style paths.  Currently, we only handle escaping backslashes.
-    value = value.replace("\\", "/")
-
-    return value
-
-def make_install_dir(path):
-    """
-    make_install_dir(path) -> None
-
-    Create the given directory path for installation, including any parents.
-    """
-
-    # os.makedirs considers it an error to be called with an existent path.
-    if not os.path.exists(path):
-        os.makedirs(path)
-
-###
-
-class LLVMProjectInfo(object):
-    @staticmethod
-    def load_infos_from_path(llvmbuild_source_root):
-        def recurse(subpath):
-            # Load the LLVMBuild file.
-            llvmbuild_path = os.path.join(llvmbuild_source_root + subpath,
-                                          'LLVMBuild.txt')
-            if not os.path.exists(llvmbuild_path):
-                fatal("missing LLVMBuild.txt file at: %r" % (llvmbuild_path,))
-
-            # Parse the components from it.
-            common,info_iter = componentinfo.load_from_path(llvmbuild_path,
-                                                            subpath)
-            for info in info_iter:
-                yield info
-
-            # Recurse into the specified subdirectories.
-            for subdir in common.get_list("subdirectories"):
-                for item in recurse(os.path.join(subpath, subdir)):
-                    yield item
-
-        return recurse("/")
-
-    @staticmethod
-    def load_from_path(source_root, llvmbuild_source_root):
-        infos = list(
-            LLVMProjectInfo.load_infos_from_path(llvmbuild_source_root))
-
-        return LLVMProjectInfo(source_root, infos)
-
-    def __init__(self, source_root, component_infos):
-        # Store our simple ivars.
-        self.source_root = source_root
-        self.component_infos = list(component_infos)
-        self.component_info_map = None
-        self.ordered_component_infos = None
-
-    def validate_components(self):
-        """validate_components() -> None
-
-        Validate that the project components are well-defined. Among other
-        things, this checks that:
-          - Components have valid references.
-          - Components references do not form cycles.
-
-        We also construct the map from component names to info, and the
-        topological ordering of components.
-        """
-
-        # Create the component info map and validate that component names are
-        # unique.
-        self.component_info_map = {}
-        for ci in self.component_infos:
-            existing = self.component_info_map.get(ci.name)
-            if existing is not None:
-                # We found a duplicate component name, report it and error out.
-                fatal("found duplicate component %r (at %r and %r)" % (
-                        ci.name, ci.subpath, existing.subpath))
-            self.component_info_map[ci.name] = ci
-
-        # Disallow 'all' as a component name, which is a special case.
-        if 'all' in self.component_info_map:
-            fatal("project is not allowed to define 'all' component")
-
-        # Add the root component.
-        if '$ROOT' in self.component_info_map:
-            fatal("project is not allowed to define $ROOT component")
-        self.component_info_map['$ROOT'] = componentinfo.GroupComponentInfo(
-            '/', '$ROOT', None)
-        self.component_infos.append(self.component_info_map['$ROOT'])
-
-        # Topologically order the component information according to their
-        # component references.
-        def visit_component_info(ci, current_stack, current_set):
-            # Check for a cycles.
-            if ci in current_set:
-                # We found a cycle, report it and error out.
-                cycle_description = ' -> '.join(
-                    '%r (%s)' % (ci.name, relation)
-                    for relation,ci in current_stack)
-                fatal("found cycle to %r after following: %s -> %s" % (
-                        ci.name, cycle_description, ci.name))
-
-            # If we have already visited this item, we are done.
-            if ci not in components_to_visit:
-                return
-
-            # Otherwise, mark the component info as visited and traverse.
-            components_to_visit.remove(ci)
-
-            # Validate the parent reference, which we treat specially.
-            if ci.parent is not None:
-                parent = self.component_info_map.get(ci.parent)
-                if parent is None:
-                    fatal("component %r has invalid reference %r (via %r)" % (
-                            ci.name, ci.parent, 'parent'))
-                ci.set_parent_instance(parent)
-
-            for relation,referent_name in ci.get_component_references():
-                # Validate that the reference is ok.
-                referent = self.component_info_map.get(referent_name)
-                if referent is None:
-                    fatal("component %r has invalid reference %r (via %r)" % (
-                            ci.name, referent_name, relation))
-
-                # Visit the reference.
-                current_stack.append((relation,ci))
-                current_set.add(ci)
-                visit_component_info(referent, current_stack, current_set)
-                current_set.remove(ci)
-                current_stack.pop()
-
-            # Finally, add the component info to the ordered list.
-            self.ordered_component_infos.append(ci)
-
-        # FIXME: We aren't actually correctly checking for cycles along the
-        # parent edges. Haven't decided how I want to handle this -- I thought
-        # about only checking cycles by relation type. If we do that, it falls
-        # out easily. If we don't, we should special case the check.
-
-        self.ordered_component_infos = []
-        components_to_visit = sorted(
-            set(self.component_infos),
-            key = lambda c: c.name)
-        while components_to_visit:
-            visit_component_info(components_to_visit[0], [], set())
-
-        # Canonicalize children lists.
-        for c in self.ordered_component_infos:
-            c.children.sort(key = lambda c: c.name)
-
-    def print_tree(self):
-        def visit(node, depth = 0):
-            print('%s%-40s (%s)' % ('  '*depth, node.name, node.type_name))
-            for c in node.children:
-                visit(c, depth + 1)
-        visit(self.component_info_map['$ROOT'])
-
-    def write_components(self, output_path):
-        # Organize all the components by the directory their LLVMBuild file
-        # should go in.
-        info_basedir = {}
-        for ci in self.component_infos:
-            # Ignore the $ROOT component.
-            if ci.parent is None:
-                continue
-
-            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 = []
-
-            # 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
-
-            assert subpath.startswith('/')
-            directory_path = os.path.join(output_path, subpath[1:])
-
-            # Create the directory if it does not already exist.
-            if not os.path.exists(directory_path):
-                os.makedirs(directory_path)
-
-            # In an effort to preserve comments (which aren't parsed), read in
-            # the original file and extract the comments. We only know how to
-            # associate comments that prefix a section name.
-            f = open(infos[0]._source_path)
-            comments_map = {}
-            comment_block = ""
-            for ln in f:
-                if ln.startswith(';'):
-                    comment_block += ln
-                elif ln.startswith('[') and ln.endswith(']\n'):
-                    comments_map[ln[1:-2]] = comment_block
-                else:
-                    comment_block = ""
-            f.close()
-
-            # Create the LLVMBuild fil[e.
-            file_path = os.path.join(directory_path, 'LLVMBuild.txt')
-            f = open(file_path, "w")
-
-            # Write the header.
-            header_fmt = ';===- %s %s-*- Conf -*--===;'
-            header_name = '.' + os.path.join(subpath, 'LLVMBuild.txt')
-            header_pad = '-' * (80 - len(header_fmt % (header_name, '')))
-            header_string = header_fmt % (header_name, header_pad)
-            f.write("""\
-%s
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-""" % header_string)
-
-            # 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)
-                f.write("[%s]\n" % name)
-                f.write(fragment)
-                if fragment is not fragments[-1][1]:
-                    f.write('\n')
-
-            f.close()
-
-    def write_library_table(self, output_path, enabled_optional_components):
-        # Write out the mapping from component names to required libraries.
-        #
-        # We do this in topological order so that we know we can append the
-        # dependencies for added library groups.
-        entries = {}
-        for c in self.ordered_component_infos:
-            # 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'):
-                continue
-
-            # Compute the llvm-config "component name". For historical reasons,
-            # this is lowercased based on the library name.
-            llvmconfig_component_name = c.get_llvmconfig_component_name()
-
-            # Get the library name, or None for LibraryGroups.
-            if c.type_name == 'Library' or c.type_name == 'OptionalLibrary':
-                library_name = c.get_prefixed_library_name()
-                is_installed = c.installed
-            else:
-                library_name = None
-                is_installed = True
-
-            # Get the component names of all the required libraries.
-            required_llvmconfig_component_names = [
-                self.component_info_map[dep].get_llvmconfig_component_name()
-                for dep in c.required_libraries]
-
-            # Insert the entries for library groups we should add to.
-            for dep in c.add_to_library_groups:
-                entries[dep][2].append(llvmconfig_component_name)
-
-            # Add the entry.
-            entries[c.name] = (llvmconfig_component_name, library_name,
-                               required_llvmconfig_component_names,
-                               is_installed)
-
-        # Convert to a list of entries and sort by name.
-        entries = list(entries.values())
-
-        # Create an 'all' pseudo component. We keep the dependency list small by
-        # only listing entries that have no other dependents.
-        root_entries = set(e[0] for e in entries)
-        for _,_,deps,_ in entries:
-            root_entries -= set(deps)
-        entries.append(('all', None, sorted(root_entries), True))
-
-        entries.sort()
-
-        # Compute the maximum number of required libraries, plus one so there is
-        # always a sentinel.
-        max_required_libraries = max(len(deps)
-                                     for _,_,deps,_ in entries) + 1
-
-        # Write out the library table.
-        make_install_dir(os.path.dirname(output_path))
-        f = open(output_path+'.new', 'w')
-        f.write("""\
-//===- llvm-build generated file --------------------------------*- C++ -*-===//
-//
-// Component Library Dependency Table
-//
-// Automatically generated file, do not edit!
-//
-//===----------------------------------------------------------------------===//
-
-""")
-        f.write('struct AvailableComponent {\n')
-        f.write('  /// The name of the component.\n')
-        f.write('  const char *Name;\n')
-        f.write('\n')
-        f.write('  /// The name of the library for this component (or NULL).\n')
-        f.write('  const char *Library;\n')
-        f.write('\n')
-        f.write('  /// Whether the component is installed.\n')
-        f.write('  bool IsInstalled;\n')
-        f.write('\n')
-        f.write('\
-  /// The list of libraries required when linking this component.\n')
-        f.write('  const char *RequiredLibraries[%d];\n' % (
-            max_required_libraries))
-        f.write('} AvailableComponents[%d] = {\n' % len(entries))
-        for name,library_name,required_names,is_installed in entries:
-            if library_name is None:
-                library_name_as_cstr = 'nullptr'
-            else:
-                library_name_as_cstr = '"%s"' % library_name
-            if is_installed:
-                is_installed_as_cstr = 'true'
-            else:
-                is_installed_as_cstr = 'false'
-            f.write('  { "%s", %s, %s, { %s } },\n' % (
-                name, library_name_as_cstr, is_installed_as_cstr,
-                ', '.join('"%s"' % dep
-                          for dep in required_names)))
-        f.write('};\n')
-        f.close()
-
-        if not os.path.isfile(output_path):
-            os.rename(output_path+'.new', output_path)
-        elif filecmp.cmp(output_path, output_path+'.new'):
-            os.remove(output_path+'.new')
-        else:
-            os.remove(output_path)
-            os.rename(output_path+'.new', output_path)
-
-    def get_required_libraries_for_component(self, ci, traverse_groups = False):
-        """
-        get_required_libraries_for_component(component_info) -> iter
-
-        Given a Library component info descriptor, return an iterator over all
-        of the directly required libraries for linking with this component. If
-        traverse_groups is True, then library and target groups will be
-        traversed to include their required libraries.
-        """
-
-        assert ci.type_name in ('Library', 'OptionalLibrary', 'LibraryGroup', 'TargetGroup')
-
-        for name in ci.required_libraries:
-            # Get the dependency info.
-            dep = self.component_info_map[name]
-
-            # If it is a library, yield it.
-            if dep.type_name == 'Library' or dep.type_name == 'OptionalLibrary':
-                yield dep
-                continue
-
-            # Otherwise if it is a group, yield or traverse depending on what
-            # was requested.
-            if dep.type_name in ('LibraryGroup', 'TargetGroup'):
-                if not traverse_groups:
-                    yield dep
-                    continue
-
-                for res in self.get_required_libraries_for_component(dep, True):
-                    yield res
-
-    def get_fragment_dependencies(self):
-        """
-        get_fragment_dependencies() -> iter
-
-        Compute the list of files (as absolute paths) on which the output
-        fragments depend (i.e., files for which a modification should trigger a
-        rebuild of the fragment).
-        """
-
-        # Construct a list of all the dependencies of the Makefile fragment
-        # itself. These include all the LLVMBuild files themselves, as well as
-        # all of our own sources.
-        #
-        # Many components may come from the same file, so we make sure to unique
-        # these.
-        build_paths = set()
-        for ci in self.component_infos:
-            p = os.path.join(self.source_root, ci.subpath[1:], 'LLVMBuild.txt')
-            if p not in build_paths:
-                yield p
-                build_paths.add(p)
-
-        # Gather the list of necessary sources by just finding all loaded
-        # modules that are inside the LLVM source tree.
-        for module in sys.modules.values():
-            # Find the module path.
-            if not hasattr(module, '__file__'):
-                continue
-            path = getattr(module, '__file__')
-            if not path:
-                continue
-
-            # Strip off any compiled suffix.
-            if os.path.splitext(path)[1] in ['.pyc', '.pyo', '.pyd']:
-                path = path[:-1]
-
-            # If the path exists and is in the source tree, consider it a
-            # dependency.
-            if (path.startswith(self.source_root) and os.path.exists(path)):
-                yield path
-
-    def foreach_cmake_library(self, f,
-                              enabled_optional_components,
-                              skip_disabled,
-                              skip_not_installed):
-        for ci in self.ordered_component_infos:
-            # Skip optional components which are not enabled.
-            if ci.type_name == 'OptionalLibrary' \
-                and ci.name not in enabled_optional_components:
-                continue
-
-            # We only write the information for libraries currently.
-            if ci.type_name not in ('Library', 'OptionalLibrary'):
-                continue
-
-            # Skip disabled targets.
-            if skip_disabled:
-                tg = ci.get_parent_target_group()
-                if tg and not tg.enabled:
-                    continue
-
-            # Skip targets that will not be installed
-            if skip_not_installed and not ci.installed:
-                continue
-
-            f(ci)
-
-
-    def write_cmake_fragment(self, output_path, enabled_optional_components):
-        """
-        write_cmake_fragment(output_path) -> None
-
-        Generate a CMake fragment which includes all of the collated LLVMBuild
-        information in a format that is easily digestible by a CMake. The exact
-        contents of this are closely tied to how the CMake configuration
-        integrates LLVMBuild, see CMakeLists.txt in the top-level.
-        """
-
-        dependencies = list(self.get_fragment_dependencies())
-
-        # Write out the CMake fragment.
-        make_install_dir(os.path.dirname(output_path))
-        f = open(output_path, 'w')
-
-        # Write the header.
-        header_fmt = '\
-#===-- %s - LLVMBuild Configuration for LLVM %s-*- CMake -*--===#'
-        header_name = os.path.basename(output_path)
-        header_pad = '-' * (80 - len(header_fmt % (header_name, '')))
-        header_string = header_fmt % (header_name, header_pad)
-        f.write("""\
-%s
-#
-# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-# See https://llvm.org/LICENSE.txt for license information.
-# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-#
-#===------------------------------------------------------------------------===#
-#
-# This file contains the LLVMBuild project information in a format easily
-# consumed by the CMake based build system.
-#
-# This file is autogenerated by llvm-build, do not edit!
-#
-#===------------------------------------------------------------------------===#
-
-""" % header_string)
-
-        # Write the dependency information in the best way we can.
-        f.write("""
-# LLVMBuild CMake fragment dependencies.
-#
-""")
-        for dep in dependencies:
-            f.write("""\
-set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS \"%s\")\n""" % (
-                cmake_quote_path(dep),))
-
-        # Write the properties we use to encode the required library dependency
-        # information in a form CMake can easily use directly.
-        f.write("""
-# Explicit library dependency information.
-#
-# The following property assignments effectively create a map from component
-# names to required libraries, in a way that is easily accessed from CMake.
-""")
-        self.foreach_cmake_library(
-            lambda ci:
-              f.write("""\
-set_property(GLOBAL PROPERTY LLVMBUILD_LIB_DEPS_%s %s)\n""" % (
-                ci.get_prefixed_library_name(), " ".join(sorted(
-                     dep.get_prefixed_library_name()
-                     for dep in self.get_required_libraries_for_component(ci)))))
-            ,
-            enabled_optional_components,
-            skip_disabled = False,
-            skip_not_installed = False # Dependency info must be emitted for internals libs too
-            )
-
-        f.close()
-
-    def write_cmake_exports_fragment(self, output_path, enabled_optional_components):
-        """
-        write_cmake_exports_fragment(output_path) -> None
-
-        Generate a CMake fragment which includes LLVMBuild library
-        dependencies expressed similarly to how CMake would write
-        them via install(EXPORT).
-        """
-
-        dependencies = list(self.get_fragment_dependencies())
-
-        # Write out the CMake exports fragment.
-        make_install_dir(os.path.dirname(output_path))
-        f = open(output_path, 'w')
-
-        f.write("""\
-# Explicit library dependency information.
-#
-# The following property assignments tell CMake about link
-# dependencies of libraries imported from LLVM.
-""")
-        self.foreach_cmake_library(
-            lambda ci:
-              f.write("""\
-set_property(TARGET %s PROPERTY IMPORTED_LINK_INTERFACE_LIBRARIES %s)\n""" % (
-                ci.get_prefixed_library_name(), " ".join(sorted(
-                     dep.get_prefixed_library_name()
-                     for dep in self.get_required_libraries_for_component(ci)))))
-            ,
-            enabled_optional_components,
-            skip_disabled = True,
-            skip_not_installed = True # Do not export internal libraries like gtest
-            )
-
-        f.close()
-
-def add_magic_target_components(parser, project, opts):
-    """add_magic_target_components(project, opts) -> None
-
-    Add the "magic" target based components to the project, which can only be
-    determined based on the target configuration options.
-
-    This currently is responsible for populating the required_libraries list of
-    the "all-targets", "Native", "NativeCodeGen", and "Engine" components.
-    """
-
-    # Determine the available targets.
-    available_targets = dict((ci.name,ci)
-                             for ci in project.component_infos
-                             if ci.type_name == 'TargetGroup')
-
-    # Find the configured native target.
-
-    # We handle a few special cases of target names here for historical
-    # reasons, as these are the names configure currently comes up with.
-    native_target_name = { 'x86' : 'X86',
-                           'x86_64' : 'X86',
-                           'Unknown' : None }.get(opts.native_target,
-                                                  opts.native_target)
-    if native_target_name is None:
-        native_target = None
-    else:
-        native_target = available_targets.get(native_target_name)
-        if native_target is None:
-            parser.error("invalid native target: %r (not in project)" % (
-                    opts.native_target,))
-        if native_target.type_name != 'TargetGroup':
-            parser.error("invalid native target: %r (not a target)" % (
-                    opts.native_target,))
-
-    # Find the list of targets to enable.
-    if opts.enable_targets is None:
-        enable_targets = available_targets.values()
-    else:
-        # We support both space separated and semi-colon separated lists.
-        if opts.enable_targets == '':
-            enable_target_names = []
-        elif ' ' in opts.enable_targets:
-            enable_target_names = opts.enable_targets.split()
-        else:
-            enable_target_names = opts.enable_targets.split(';')
-
-        enable_targets = []
-        for name in enable_target_names:
-            target = available_targets.get(name)
-            if target is None:
-                parser.error("invalid target to enable: %r (not in project)" % (
-                        name,))
-            if target.type_name != 'TargetGroup':
-                parser.error("invalid target to enable: %r (not a target)" % (
-                        name,))
-            enable_targets.append(target)
-
-    # Find the special library groups we are going to populate. We enforce that
-    # these appear in the project (instead of just adding them) so that they at
-    # least have an explicit representation in the project LLVMBuild files (and
-    # comments explaining how they are populated).
-    def find_special_group(name):
-        info = info_map.get(name)
-        if info is None:
-            fatal("expected project to contain special %r component" % (
-                    name,))
-
-        if info.type_name != 'LibraryGroup':
-            fatal("special component %r should be a LibraryGroup" % (
-                    name,))
-
-        if info.required_libraries:
-            fatal("special component %r must have empty %r list" % (
-                    name, 'required_libraries'))
-        if info.add_to_library_groups:
-            fatal("special component %r must have empty %r list" % (
-                    name, 'add_to_library_groups'))
-
-        info._is_special_group = True
-        return info
-
-    info_map = dict((ci.name, ci) for ci in project.component_infos)
-    all_targets = find_special_group('all-targets')
-    native_group = find_special_group('Native')
-    native_codegen_group = find_special_group('NativeCodeGen')
-    engine_group = find_special_group('Engine')
-
-    # Set the enabled bit in all the target groups, and append to the
-    # all-targets list.
-    for ci in enable_targets:
-        all_targets.required_libraries.append(ci.name)
-        ci.enabled = True
-
-    # If we have a native target, then that defines the native and
-    # native_codegen libraries.
-    if native_target and native_target.enabled:
-        native_group.required_libraries.append(native_target.name)
-        native_codegen_group.required_libraries.append(
-            '%sCodeGen' % native_target.name)
-
-    # If we have a native target with a JIT, use that for the engine. Otherwise,
-    # use the interpreter.
-    if native_target and native_target.enabled and native_target.has_jit:
-        engine_group.required_libraries.append('MCJIT')
-        engine_group.required_libraries.append(native_group.name)
-    else:
-        engine_group.required_libraries.append('Interpreter')
-
-def main():
-    from optparse import OptionParser, OptionGroup
-    parser = OptionParser("usage: %prog [options]")
-
-    group = OptionGroup(parser, "Input Options")
-    group.add_option("", "--source-root", dest="source_root", metavar="PATH",
-                      help="Path to the LLVM source (inferred if not given)",
-                      action="store", default=None)
-    group.add_option("", "--llvmbuild-source-root",
-                     dest="llvmbuild_source_root",
-                     help=(
-            "If given, an alternate path to search for LLVMBuild.txt files"),
-                     action="store", default=None, metavar="PATH")
-    parser.add_option_group(group)
-
-    group = OptionGroup(parser, "Output Options")
-    group.add_option("", "--print-tree", dest="print_tree",
-                     help="Print out the project component tree [%default]",
-                     action="store_true", default=False)
-    group.add_option("", "--write-llvmbuild", dest="write_llvmbuild",
-                      help="Write out the LLVMBuild.txt files to PATH",
-                      action="store", default=None, metavar="PATH")
-    group.add_option("", "--write-library-table",
-                     dest="write_library_table", metavar="PATH",
-                     help="Write the C++ library dependency table to PATH",
-                     action="store", default=None)
-    group.add_option("", "--write-cmake-fragment",
-                     dest="write_cmake_fragment", metavar="PATH",
-                     help="Write the CMake project information to PATH",
-                     action="store", default=None)
-    group.add_option("", "--write-cmake-exports-fragment",
-                     dest="write_cmake_exports_fragment", metavar="PATH",
-                     help="Write the CMake exports information to PATH",
-                     action="store", default=None)
-    parser.add_option_group(group)
-
-    group = OptionGroup(parser, "Configuration Options")
-    group.add_option("", "--native-target",
-                      dest="native_target", metavar="NAME",
-                      help=("Treat the named target as the 'native' one, if "
-                            "given [%default]"),
-                      action="store", default=None)
-    group.add_option("", "--enable-targets",
-                      dest="enable_targets", metavar="NAMES",
-                      help=("Enable the given space or semi-colon separated "
-                            "list of targets, or all targets if not present"),
-                      action="store", default=None)
-    group.add_option("", "--enable-optional-components",
-                      dest="optional_components", metavar="NAMES",
-                      help=("Enable the given space or semi-colon separated "
-                            "list of optional components"),
-                      action="store", default="")
-    parser.add_option_group(group)
-
-    (opts, args) = parser.parse_args()
-
-    # Determine the LLVM source path, if not given.
-    source_root = opts.source_root
-    if source_root:
-        if not os.path.exists(os.path.join(source_root, 'lib', 'IR',
-                                           'Function.cpp')):
-            parser.error('invalid LLVM source root: %r' % source_root)
-    else:
-        llvmbuild_path = os.path.dirname(__file__)
-        llvm_build_path = os.path.dirname(llvmbuild_path)
-        utils_path = os.path.dirname(llvm_build_path)
-        source_root = os.path.dirname(utils_path)
-        if not os.path.exists(os.path.join(source_root, 'lib', 'IR',
-                                           'Function.cpp')):
-            parser.error('unable to infer LLVM source root, please specify')
-
-    # Construct the LLVM project information.
-    llvmbuild_source_root = opts.llvmbuild_source_root or source_root
-    project_info = LLVMProjectInfo.load_from_path(
-        source_root, llvmbuild_source_root)
-
-    # Add the magic target based components.
-    add_magic_target_components(parser, project_info, opts)
-
-    # Validate the project component info.
-    project_info.validate_components()
-
-    # Print the component tree, if requested.
-    if opts.print_tree:
-        project_info.print_tree()
-
-    # Write out the components, if requested. This is useful for auto-upgrading
-    # the schema.
-    if opts.write_llvmbuild:
-        project_info.write_components(opts.write_llvmbuild)
-
-    # Write out the required library table, if requested.
-    if opts.write_library_table:
-        project_info.write_library_table(opts.write_library_table,
-                                         opts.optional_components)
-
-    # Write out the cmake fragment, if requested.
-    if opts.write_cmake_fragment:
-        project_info.write_cmake_fragment(opts.write_cmake_fragment,
-                                          opts.optional_components)
-    if opts.write_cmake_exports_fragment:
-        project_info.write_cmake_exports_fragment(opts.write_cmake_exports_fragment,
-                                                  opts.optional_components)
-
-if __name__=='__main__':
-    main()

diff  --git a/llvm/utils/llvm-build/llvmbuild/util.py b/llvm/utils/llvm-build/llvmbuild/util.py
deleted file mode 100644
index ca021c4d574e..000000000000
--- a/llvm/utils/llvm-build/llvmbuild/util.py
+++ /dev/null
@@ -1,13 +0,0 @@
-import os
-import sys
-
-def _write_message(kind, message):
-    program = os.path.basename(sys.argv[0])
-    sys.stderr.write('%s: %s: %s\n' % (program, kind, message))
-
-note = lambda message: _write_message('note', message)
-warning = lambda message: _write_message('warning', message)
-error = lambda message: _write_message('error', message)
-fatal = lambda message: (_write_message('fatal error', message), sys.exit(1))
-
-__all__ = ['note', 'warning', 'error', 'fatal']

diff  --git a/llvm/utils/unittest/LLVMBuild.txt b/llvm/utils/unittest/LLVMBuild.txt
deleted file mode 100644
index a91a7f0c0c18..000000000000
--- a/llvm/utils/unittest/LLVMBuild.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-;===- ./utils/unittest/LLVMBuild.txt ---------------------------*- Conf -*--===;
-;
-; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-; See https://llvm.org/LICENSE.txt for license information.
-; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-;
-;===------------------------------------------------------------------------===;
-;
-; This is an LLVMBuild description file for the components in this subdirectory.
-;
-; For more information on the LLVMBuild system, please see:
-;
-;   http://llvm.org/docs/LLVMBuild.html
-;
-;===------------------------------------------------------------------------===;
-
-[component_0]
-type = Library
-name = gtest
-parent = Libraries
-required_libraries = Support
-installed = 0
-
-[component_1]
-type = Library
-name = gtest_main
-parent = Libraries
-required_libraries = gtest
-installed = 0


        


More information about the llvm-commits mailing list