29 Commits

Author SHA1 Message Date
Nico Weber
81330286f1 [gn] port a207e6307a58 (LLVMFrontendDriver) 2023-11-13 08:42:39 -05:00
LLVM GN Syncbot
b8a0620615 [gn build] Port c6cf32950283 2023-11-08 18:54:05 +00:00
Arthur Eubanks
94ed99af7c [gn build] Manually port 078ae8cd 2023-10-25 14:46:29 -07:00
Nico Weber
5e97a9119d [gn] fix build after 992cb98462ab 2023-06-17 19:02:16 -04:00
Sergei Barannikov
992cb98462 [clang][CodeGen] Break up TargetInfo.cpp [8/8]
This commit breaks up CodeGen/TargetInfo.cpp into a set of *.cpp files,
one file per target. There are no functional changes, mostly just code moving.

Non-code-moving changes are:
* A virtual destructor has been added to DefaultABIInfo to pin the vtable to a cpp file.
* A few methods of ABIInfo and DefaultABIInfo were split into declaration + definition
  in order to reduce the number of transitive includes.
* Several functions that used to be static have been placed in clang::CodeGen
  namespace so that they can be accessed from other cpp files.

RFC: https://discourse.llvm.org/t/rfc-splitting-clangs-targetinfo-cpp/69883

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D148094
2023-06-17 07:14:50 +03:00
Nico Weber
f55bac933f [gn] Port 9f6250f more
Follow-up to da54bd230a.
* Add dep to _cg and _sema targets only to CodeGen and Sema,
  like with the other Basic clang_tablegen()s
* Make tablegen_headers depend on arm_sme_draft_spec_subject_to_change
  so that the header gets installed
2023-05-29 20:24:25 -04:00
Nico Weber
3d5932b114 [gn] Actually reformat files after adding CodeGen deps
This should've been part of 8221c316d524695.
2023-05-02 20:46:31 -04:00
Nico Weber
8221c316d5 [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.
2023-05-02 20:44:21 -04:00
Nico Weber
65e63497f9 [gn] port fa43608d1649 (riscv_sifive_vector.td) 2023-05-02 19:06:34 -04:00
Nico Weber
2aa998d22f [gn] Add explicit deps on TargetParser
This diff was generated by the following script:

    #!/usr/bin/env python3
    import os, subprocess
    r = subprocess.run('git show --pretty='' --name-only f09cf34d00'.split(),
                       stdout=subprocess.PIPE, text=True)
    for line in r.stdout.splitlines():
      if not line.endswith('CMakeLists.txt'): continue
      gn = 'llvm/utils/gn/secondary/' + os.path.dirname(line) + '/BUILD.gn'
      if not os.path.exists(gn): continue
      with open(gn) as f:
        contents = f.read()
      if contents.count('"//llvm/lib/Support",') == 1:
        contents = contents.replace(
            '"//llvm/lib/Support",',
            '"//llvm/lib/Support", "//llvm/lib/TargetParser",')
      elif contents.count(' deps = [') == 1:
        contents = contents.replace(
            ' deps = [',
            ' deps = [ "//llvm/lib/TargetParser",')
      else:
        print('needs manual fixup:', gn)
        continue
      with open(gn, 'w') as f:
        f.write(contents)

I then manually fixed up the BUILD.gn files for Support (should not depend on
TargetParser) and TargetParser (should depend on Support) and ran `gn format`
on all touched files.
2022-12-20 10:09:43 -05:00
Nico Weber
7c188afde1 [gn build] Reformat all build files
Ran:

    git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format
2022-11-19 11:54:55 -05:00
Nico Weber
63f79fe2eb [gn build] port 7059a6c32cfa 2022-11-18 06:48:51 -05:00
Nico Weber
37c693d8da [gn build] port 911d2dc230 (LLVMFrontendHLSL) 2022-10-14 14:59:41 -04:00
LLVM GN Syncbot
616dd4fe4e [gn build] Port 73417c517644 2022-04-30 00:44:51 +00:00
LLVM GN Syncbot
a8b2277069 [gn build] Port 737c4a2673da 2021-11-09 20:11:28 +00:00
LLVM GN Syncbot
eaa8533b33 [gn build] Port ef717f385232 2021-11-09 07:11:34 +00:00
LLVM GN Syncbot
4edbc2736e [gn build] Port 81a7cad2ffc1 2021-11-09 06:54:23 +00:00
Arthur Eubanks
aa53785f23 Reland [clang] Rework dontcall attributes
To avoid using the AST when emitting diagnostics, split the "dontcall"
attribute into "dontcall-warn" and "dontcall-error", and also add the
frontend attribute value as the LLVM attribute value. This gives us all
the information to report diagnostics we need from within the IR (aside
from access to the original source).

One downside is we directly use LLVM's demangler rather than using the
existing Clang diagnostic pretty printing of symbols.

Previous revisions didn't properly declare the new dependencies.

Reviewed By: nickdesaulniers

Differential Revision: https://reviews.llvm.org/D110364
2021-09-28 15:31:30 -07:00
Nico Weber
cb17f060e2 [gn build] (manually) Port d6a0560bf258 2021-03-10 21:56:59 -05:00
LLVM GN Syncbot
5a4cd55e5d [gn build] Port 160ff83765a 2020-08-03 05:55:14 +00:00
LLVM GN Syncbot
8475981b30 [gn build] Port c7562e77b3a 2020-07-17 14:38:56 +00:00
Nico Weber
f57290ec57 [gn build] add rebase changes that should have been in 9f981e9adf9c8d29bb80306daf08d2770263ade6 2020-03-18 11:38:37 -04:00
Nico Weber
9f981e9adf Reland "[gn build] (manually) port 8b409eaba"
This reverts commit 4060016fce3e6a0b926ee9fc59e440a612d3a2ec
and re-merges c5b81466c.
2020-03-18 11:31:18 -04:00
Nico Weber
4060016fce Revert "[gn build] (manually) port 8b409eaba"
This reverts commit 85462aefb527eaa4a6a7563f9341ceab283cdf1f
and follow-up 8d6582aa6bbd952744abd1f3cb74065f96535169.

8b409eaba was reverted.
2020-03-16 11:33:19 -04:00
Nico Weber
85462aefb5 [gn build] (manually) port 8b409eaba 2020-03-16 09:47:06 -04:00
Nico Weber
877073bc1c [gn build] (manually) merge 47edf5bafb 2020-03-10 10:22:39 -04:00
Nico Weber
13d8d19d51 gn build: (manually) merge 08074cc9 2019-10-25 02:35:14 -04:00
Nico Weber
6de31be67e gn build: Merge r358243
llvm-svn: 358365
2019-04-14 23:21:58 +00:00
Nico Weber
200ed0147b [gn build] Add build file for clang/lib/CodeGen and llvm/lib/ProfileData/Coverage
Differential Revision: https://reviews.llvm.org/D55931

llvm-svn: 349834
2018-12-20 21:56:16 +00:00