[all-commits] [llvm/llvm-project] 8221c3: [gn build] Port rest of 9cfeba5b12b6 (LowLevelType...

Nico Weber via All-commits all-commits at lists.llvm.org
Tue May 2 17:45:04 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8221c316d5246952709efc5e5886c67ec7ea03fd
      https://github.com/llvm/llvm-project/commit/8221c316d5246952709efc5e5886c67ec7ea03fd
  Author: Nico Weber <thakis at chromium.org>
  Date:   2023-05-02 (Tue, 02 May 2023)

  Changed paths:
    M llvm/utils/gn/secondary/clang/lib/CodeGen/BUILD.gn
    M llvm/utils/gn/secondary/llvm/lib/Target/AArch64/AsmParser/BUILD.gn
    M llvm/utils/gn/secondary/llvm/lib/Target/AArch64/MCTargetDesc/BUILD.gn
    M llvm/utils/gn/secondary/llvm/lib/Target/AMDGPU/AsmParser/BUILD.gn
    M llvm/utils/gn/secondary/llvm/lib/Target/AMDGPU/Disassembler/BUILD.gn
    M llvm/utils/gn/secondary/llvm/lib/Target/AMDGPU/MCA/BUILD.gn
    M llvm/utils/gn/secondary/llvm/lib/Target/AMDGPU/MCTargetDesc/BUILD.gn
    M llvm/utils/gn/secondary/llvm/lib/Target/AMDGPU/Utils/BUILD.gn
    M llvm/utils/gn/secondary/llvm/lib/Target/ARM/AsmParser/BUILD.gn
    M llvm/utils/gn/secondary/llvm/lib/Target/ARM/Disassembler/BUILD.gn
    M llvm/utils/gn/secondary/llvm/lib/Target/ARM/MCTargetDesc/BUILD.gn
    M llvm/utils/gn/secondary/llvm/lib/Target/AVR/AsmParser/BUILD.gn
    M llvm/utils/gn/secondary/llvm/lib/Target/AVR/Disassembler/BUILD.gn
    M llvm/utils/gn/secondary/llvm/lib/Target/Lanai/AsmParser/BUILD.gn
    M llvm/utils/gn/secondary/llvm/lib/Target/Lanai/Disassembler/BUILD.gn
    M llvm/utils/gn/secondary/llvm/lib/Target/Mips/MCTargetDesc/BUILD.gn
    M llvm/utils/gn/secondary/llvm/lib/Target/PowerPC/MCTargetDesc/BUILD.gn
    M llvm/utils/gn/secondary/llvm/lib/Target/SystemZ/MCTargetDesc/BUILD.gn
    M llvm/utils/gn/secondary/llvm/lib/Target/WebAssembly/AsmParser/BUILD.gn
    M llvm/utils/gn/secondary/llvm/lib/Target/WebAssembly/Disassembler/BUILD.gn
    M llvm/utils/gn/secondary/llvm/lib/Target/WebAssembly/MCTargetDesc/BUILD.gn
    M llvm/utils/gn/secondary/llvm/lib/Target/X86/MCA/BUILD.gn
    M llvm/utils/gn/secondary/llvm/lib/Target/X86/MCTargetDesc/BUILD.gn
    M llvm/utils/gn/secondary/llvm/tools/llvm-dwarfutil/BUILD.gn
    M llvm/utils/gn/secondary/llvm/tools/llvm-exegesis/BUILD.gn
    M llvm/utils/gn/secondary/llvm/tools/llvm-exegesis/lib/AArch64/BUILD.gn
    M llvm/utils/gn/secondary/llvm/tools/llvm-exegesis/lib/Mips/BUILD.gn
    M llvm/utils/gn/secondary/llvm/tools/llvm-exegesis/lib/PowerPC/BUILD.gn
    M llvm/utils/gn/secondary/llvm/unittests/DebugInfo/DWARF/BUILD.gn
    M llvm/utils/gn/secondary/llvm/utils/TableGen/BUILD.gn
    M llvm/utils/gn/secondary/llvm/utils/TableGen/GlobalISel/BUILD.gn

  Log Message:
  -----------
  [gn build] Port rest of 9cfeba5b12b6 (LowLevelType->Support)

This adds all the CodeGen deps all over the place.

I ran

    git show 9cfeba5b12b6 > foo2.txt

to get the original patch into a text file and then ran

    #!/usr/bin/env python3
    import os
    in_cmake = False
    for l in open('foo2.txt'):
      if l.startswith('+++ b/'):
        cmake = l[len('+++ b/'):-1]
        in_cmake = 'CMakeLists.txt' in cmake
      if not in_cmake:
        continue
      prefix = 'llvm/utils/gn/secondary/'
      gn_file = os.path.join(prefix, os.path.dirname(cmake), 'BUILD.gn')
      if l.startswith('+ '):
        add = l[1:].strip()
        if add == 'CodeGen':
          try:
            with open(gn_file) as f:
                contents = f.read()
          except:
            print(f'skipping {gn_file}')
            continue
          contents = contents.replace(' deps = [', ' deps = ["//llvm/lib/CodeGen",')
          with open(gn_file, 'w') as f:
              f.write(contents)

to update all the GN files.

(I manually removed the dep on CodeGen that this added to llvm-min-tblgen.)

Finally, I ran

    git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format

to fix up the formatting.




More information about the All-commits mailing list