1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

154 Commits

Author SHA1 Message Date
Nico Weber
b40a638b3b [gn check] Unbreak check-lld if llvm_install_binutils_symlinks is false
The check-lld target was missing the dependency on llvm-nm and llvm-objdump in that case.

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

llvm-svn: 349836
2018-12-20 21:57:12 +00:00
Nico Weber
b77734a037 [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
Nico Weber
59c115d06d [gn build] Add build files for clang/lib/{Frontend,Frontend/Rewrite,Serialization}
Differential Revision: https://reviews.llvm.org/D55930

llvm-svn: 349833
2018-12-20 21:55:28 +00:00
Nico Weber
fb5d608939 [gn build] Add build file for clang/lib/Driver
Mostly boring, except for the spurious dependency on StaticAnalyzer/Checkers --
see comments in the code.

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

llvm-svn: 349832
2018-12-20 21:54:13 +00:00
Nico Weber
77d86f21fc [gn build] Add build file for clang/lib/Parse
Nothing really interesting. One thing to consider is where the clang_tablegen()
invocations that generate files that are private to a library should be. The
CMake build puts them in clang/include/clang/Parse (in this case), but maybe
putting them right in clang/lib/Parse/BUILD.gn makes mor sense. (For
clang_tablegen() calls that generate .inc files used by the public headers,
putting the call in the public BUILD file makes sense.)

For now, I've put the build file in the public header folder, since that
matches CMake and what I did in the last 2 clang patches, but I'm not sure I
like this.

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

llvm-svn: 349831
2018-12-20 21:53:05 +00:00
Nico Weber
45bca46cc8 [gn build] Add build files for clang-format and lib/{Format,Rewrite,Tooling/Core,Tooling/Inclusions}
Differential Revision: https://reviews.llvm.org/D55924

llvm-svn: 349830
2018-12-20 21:51:46 +00:00
Nico Weber
b969ccfaaa [gn build] Add build files for clang/lib/{Analysis,Edit,Sema}
Differential Revision: https://reviews.llvm.org/D55913

llvm-svn: 349757
2018-12-20 13:39:25 +00:00
Nico Weber
6e271260e5 [gn build] Add build files for clang/lib/Lex and clang/lib/AST
Differential Revision: https://reviews.llvm.org/D55912

llvm-svn: 349756
2018-12-20 13:38:36 +00:00
Nico Weber
4ca15610d7 [gn build] Make ninja check-lld also run LLD's unit tests
And add build files for gtest.

With this, the build files for //lld are complete.

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

llvm-svn: 349704
2018-12-20 00:04:10 +00:00
Nico Weber
4a9897ae62 [gn build] Add check-lld target and make it work
Also add a build file for llvm-lit, which in turn needs llvm/tools/llvm-config.

With this, check-lld runs and passes all of lld's lit tests. It doesn't run any
of its unit tests yet.

Running just ninja -C out/gn will build all prerequisites needed to run tests,
but it won't run the tests (so that the build becomes clean after one build).
Running ninja -C out/gn check-lld will build prerequisites if needed and run
the tests. The check-lld target never becomes clean and runs tests every time.

llvm-config's build file is a bit gnarly: Everything not needed to run tests is
basically stubbed out. Also, to generate LibraryDependencies.inc we shell out
to llvm-build at build-time. It would be much nicer to get the library
dependencies by using the dependency data the GN build contains
(http://llvm-cs.pcc.me.uk/gen/tools/llvm-config/LibraryDependencies.inc#1).

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

llvm-svn: 349702
2018-12-19 23:52:16 +00:00
Nico Weber
bfb43d499e [gn build] Add build file for clang/lib/Basic and dependencies, 2nd try
Adds a build file for clang-tblgen and an action for running it, and uses that
to process all the .td files in include/clang/Basic.

Also adds an action to write include/clang/Config/config.h and
include/clang/Basic/Version.inc.

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

(The previous commit of this contained unrelated changes, so I reverted the
whole previous commit and I'm now landing only what I intended to land.)

llvm-svn: 349679
2018-12-19 20:21:49 +00:00
Nico Weber
098c087057 Revert 349677, it contained a whole bunch of stuff I did not mean to commit
llvm-svn: 349678
2018-12-19 20:19:58 +00:00
Nico Weber
095ff4074a [gn build] Add build file for clang/lib/Basic and dependencies
Adds a build file for clang-tblgen and an action for running it, and uses that
to process all the .td files in include/clang/Basic.

Also adds an action to write include/clang/Config/config.h and
include/clang/Basic/Version.inc.

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

llvm-svn: 349677
2018-12-19 20:18:59 +00:00
Nico Weber
188de3dcb2 [gn build] Merge r349605
llvm-svn: 349638
2018-12-19 16:38:16 +00:00
Nico Weber
60a32e805a Let TableGen write output only if it changed, instead of doing so in cmake, attempt 2
This relands r330742:
"""
Let TableGen write output only if it changed, instead of doing so in cmake.

Removes one subprocess and one temp file from the build for each tablegen
invocation.

No intended behavior change.
"""

In particular, if you see rebuilds after this change that you didn't see
before this change, that's unintended and it's fine to revert this change
again (but let me know).

r330742 got reverted because some people reported that llvm-tblgen ran on every
build after it.  This could happen if the depfile output got deleted without
deleting the main .inc output. To fix, make TableGen always write the depfile,
but keep writing the main .inc output only if it has changed. This matches what
we did in cmake before.

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

llvm-svn: 349624
2018-12-19 13:35:53 +00:00
Nico Weber
df742158c7 [gn build] Add build file for llvm-objcopy
Needed by check-lld.

This should've been part of r349486 but I messed up.

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

llvm-svn: 349598
2018-12-19 02:48:01 +00:00
Nico Weber
7824809f5a [gn build] Add build file for llvm-pdbutil
Needed for check-lld.

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

llvm-svn: 349490
2018-12-18 15:09:07 +00:00
Nico Weber
863f077958 [gn build] Add build file for llvm-bcanalyzer
Needed for check-lld.

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

llvm-svn: 349488
2018-12-18 14:58:48 +00:00
Nico Weber
d5d6c165b5 [gn build] Add build files for llvm-ar, llvm-nm, llvm-objdump, llvm-readelf
Also add build files for deps DebugInfo/Symbolize, ToolDrivers/dll-tool.
Also add gn/build/libs/xar (needed by llvm-objdump).

Also delete an incorrect part of the symlink description in //BUILD.gn (it used
to be true before I made the symlink step write a stamp file; now it's no
longer true).

These are all binaries needed by check-lld that need symlinks.

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

llvm-svn: 349486
2018-12-18 13:52:21 +00:00
Nico Weber
b8e447f672 [gn build] Add build files for opt and its dependency Transforms/Couroutines
Needed for check-lld.

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

llvm-svn: 349324
2018-12-17 02:33:15 +00:00
Nico Weber
ab798a428a [gn build] Merge r349167
llvm-svn: 349291
2018-12-16 02:32:20 +00:00
Nico Weber
0b2496bfd0 [gn build] Add build files for obj2yaml, yaml2obj, and lib/ObjectYAML
The two executables are needed by check-lld.

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

llvm-svn: 349290
2018-12-16 02:29:02 +00:00
Nico Weber
13f5841557 [gn build] Add build files for llvm-as, llvm-dis, llvm-dwarfdump, llvm-mc, FileCheck, count, not
These executables are needed by check-lld.

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

llvm-svn: 349289
2018-12-16 02:27:10 +00:00
Nico Weber
349a17eff9 [gn build] Merge r348963 and r349076
llvm-svn: 349124
2018-12-14 03:20:46 +00:00
Nico Weber
4635e976e8 [gn build] Add infrastructure to create symlinks and use it to create lld's symlinks
This is slightly involved, see the comments in the code.

The GN build now builds a functional lld!

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

llvm-svn: 349096
2018-12-14 00:16:33 +00:00
Shoaib Meenai
2d56ac1f2c [gn build] Fix defines define on Windows
On Windows, we won't go into the `host_os != "win"` block, so `defines`
won't have been defined, and we'll run into an undefined identifier
error when we try to later append to it. Unconditionally define it at
the start and append to it everywhere else.

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

llvm-svn: 348993
2018-12-12 23:57:21 +00:00
Nico Weber
d0ff6ced87 [gn build] Merge r348944
llvm-svn: 348948
2018-12-12 18:04:57 +00:00
Nico Weber
6d994471cc [gn build] Add all non-test build files for lld
Version.inc.in processing has a potentially interesting part which I've punted
on for now (LLD_REVISION and LLD_REPOSITORY are set to empty strings for now).

lld now builds in the gn build. But no symlinks to it are created yet, so it
can't be meaningfully run yet.

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

llvm-svn: 348945
2018-12-12 17:57:10 +00:00
Nico Weber
60fc14bfb7 [gn build] Add build files for DebugInfo/{DWARF,PDB}, Option, ToolDrivers/llvm-lib, and WindowsManifest
The diff in targets.gni is due to me running `gn format` on all .gn and .gni
files.

llvm_enable_dia_sdk is in a gni file because I'm going to have to read it when
writing the lit invocations for check-llvm and check-lld. I've never had the
DIA sdk installed locally so I never tested building with it enabled -- it
probably doesn't Just Work and needs some path to diaguids.lib. We can finish
that once somebody needs it.

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

llvm-svn: 348908
2018-12-12 03:05:59 +00:00
Nico Weber
e39345eabe [gn build] Add build files for lib/LTO, lib/Linker, lib/Passes, lib/Transforms/{IPO,Instrumentation,ObjCARC}
Differential Revision: https://reviews.llvm.org/D55553

llvm-svn: 348905
2018-12-12 00:04:38 +00:00
Nico Weber
321ce59ba4 [gn build] Add build files for Target/X86/... and for tools/llc
The tablegen setup for Target/X86 is a bit different from the CMake build: In
the CMake build, Target/X86/CMakeLists.txt has a single tablegen target that
does everything. But some of the generated files are only used privately by a
subproject, so in the GN build some of the tablegen invocations are
smaller-scoped, mostly for build cleanliness. (It helps also a tiny bit with
build parallelism since now e.g. the cpp files in MCTargetDesc can build after
just 3 .inc files are generated instead of being blocked on all 13. But it's
not a big win, since things depending on Target still need to wait for all 11,
even though all .inc file use is internal to lib/Target.)

Also add a build file for llc, since now all its dependencies have build files.

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

llvm-svn: 348903
2018-12-12 00:03:23 +00:00
Nico Weber
3d7ba53a20 [gn build] Add build files for AsmParser, MIRParser, IRReader, MCDisassembler, Vectorize
These are all remaining build dependencies of llc, except for Target/X86 which
is in a separate patch at https://reviews.llvm.org/D55524

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

llvm-svn: 348823
2018-12-11 02:09:32 +00:00
Nico Weber
0f070d70e6 [gn build] Add build files for CodeGen subfolders AsmPrinter, GlobalISel, SelectionDAG.
Differential Revision: https://reviews.llvm.org/D55462

llvm-svn: 348704
2018-12-08 10:53:10 +00:00
Nico Weber
f16ea2b84e [gn build] Merge r348593
llvm-svn: 348671
2018-12-08 00:37:14 +00:00
Nico Weber
59094317e4 [gn build] Add build files for lib/CodeGen, lib/Transforms/..., and lib/Bitcode/Writer
Differential Revision: https://reviews.llvm.org/D55454

llvm-svn: 348667
2018-12-08 00:09:56 +00:00
Nico Weber
bcee0107a7 Run git ls-files '*.gn' '*.gni' | xargs -n 1 gn format.
llvm-svn: 348539
2018-12-06 22:40:05 +00:00
Nico Weber
eeb1f9b2da [gn build] merge r348505.
llvm-svn: 348537
2018-12-06 22:36:16 +00:00
Nico Weber
c61e8a060b [gn build] Process .def.in files in llvm/Config and add lib/Target/BUILD.gn
Tweak write_cmake_config.py to also handle variable references looking @FOO@
(matching CMake's configure_file() function), and make it replace '\' 'n' in
values with a newline literal since there's no good portable way of passing a
real newline literal on a command line.

Use that to process all the .def.in files in llvm/include/Config and add
llvm/lib/Target/BUILD.gn, which (indirectly, through llvm-c/Target.h) includes
them.

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

llvm-svn: 348503
2018-12-06 17:42:35 +00:00
Martell Malone
7e5a79b353 [GN][NFC] Update readme example to functional command
`ninja -C out/gn check-lld` is not a valid command yet

Differential revision: https://reviews.llvm.org/D54840

llvm-svn: 348259
2018-12-04 12:59:22 +00:00
Nico Weber
58ab0bcce6 [gn build] Use print_function in write_cmake_config.py
No behavior change, just makes the script match the other scripts in
llvm/utils/gn/build.

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

llvm-svn: 348190
2018-12-03 21:10:19 +00:00
Nico Weber
184177b539 [gn build] Fix cosmetic bug in write_cmake_config.py
Before, #cmakedefine FOO resulted in #define FOO  with a trailing space if FOO
was set to something truthy. Make it so that it's just #define FOO without a
trailing space.

No functional difference.

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

llvm-svn: 348107
2018-12-02 22:26:18 +00:00
Nico Weber
1835f9f561 [gn build] Slightly simplify write_cmake_config.
Before, the script had a bunch of special cases for #cmakedefine and
#cmakedefine01 and then did general variable substitution. Now, the script
always does general variable substitution for all lines and handles the special
cases afterwards.

This has no observable effect for the inputs we use, but is easier to explain
and slightly easier to implement.

Also mention to link to CMake's configure_file() in the docstring.

(The new behavior doesn't quite match CMake on lines like #cmakedefine ${FOO},
but nobody does that.)

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

llvm-svn: 348106
2018-12-02 22:25:25 +00:00
Nico Weber
39f9b06cce [gn build] Add build files for llvm/lib/Analysis and llvm/lib/ProfileData
Differential Revision: https://reviews.llvm.org/D55166

llvm-svn: 348105
2018-12-02 21:43:15 +00:00
Nico Weber
00e6b8131b [gn build] Add action to generate VCSRevision.h and use it to add llvm/lib/Object/BUILD.gn
Differential Revision: https://reviews.llvm.org/D55090

llvm-svn: 348054
2018-12-01 00:02:39 +00:00
Nico Weber
e64f65be5f [gn build] Add build files for llvm/lib/Bitcode/Reader and llvm/lib/MC/MCParser.
Differential Revision: https://reviews.llvm.org/D55087

llvm-svn: 347995
2018-11-30 14:49:46 +00:00
Nico Weber
a1025b0045 [gn build] merge r346978 and r347741.
llvm-svn: 347929
2018-11-29 23:03:17 +00:00
Nico Weber
c486fc8e18 [gn build] Set +x bit on .py files in llvm/utils/gn/build.
Also add a shebang line to write_cmake_config.py.

llvm-svn: 347928
2018-11-29 22:56:40 +00:00
Nico Weber
e579a7abab [gn build] Add template for running llvm-tblgen and use it to add build file for llvm/lib/IR.
Also adds a boring build file for llvm/lib/BinaryFormat (needed by llvm/lib/IR).

lib/IR marks Attributes and IntrinsicsEnum as public_deps (because IR's public
headers include the generated .inc files), so projects depending on lib/IR will
implicitly depend on them being generated. As a consequence, most targets won't
have to explicitly list a dependency on these tablegen steps (contrast with
intrinsics_gen in the cmake build).

This doesn't yet have the optimization where tablegen's output is only updated
if it's changed.

Differential Revision: https://reviews.llvm.org/D55028#inline-486755

llvm-svn: 347927
2018-11-29 22:53:21 +00:00
Nico Weber
e229277af2 [gn build] Add a script checking if sources in BUILD.gn and CMakeLists.txt files match.
Also fix a missing file in lib/Support/BUILD.gn found by the script.

The script is very stupid and assumes that CMakeLists.txt follow the standard
LLVM CMakeLists.txt formatting with one cpp source file per line. Despite its
simplicity, it works well in practice.

It would be nice if it also checked deps and maybe automatically applied its
suggestions.

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

llvm-svn: 347925
2018-11-29 22:25:31 +00:00
Nico Weber
ce6e3acf53 [gn build] Add enough build files to be able to build llvm-tblgen.
Adds build files for:

- llvm/lib/DebugInfo/CodeView
- llvm/lib/DebugInfo/MSF
- llvm/lib/MC
- llvm/lib/TableGen
- llvm/utils/TableGen

All the build files just list sources and deps and are uninteresting.

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

llvm-svn: 347702
2018-11-27 20:10:26 +00:00
Nico Weber
cc3d32505c [gn build] Merge r347530 to gn.
llvm-svn: 347639
2018-11-27 06:04:49 +00:00
Nico Weber
3fa3a9903c Move a file I forgot to move in r347636.
llvm-svn: 347638
2018-11-27 05:49:08 +00:00
Nico Weber
32dd8bd084 [gn build] Create abi-breaking.h, config.h, llvm-config.h, and add a build file for llvm/lib/Support.
The comments at the top of
llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn and
llvm/utils/gn/build/write_cmake_config.py should explain the main bits
happening in this patch. The main parts here are that these headers are
generated at build time, not gn time, and that currently they don't do any
actual feature checks but just hardcode most things based on the current OS,
which seems to work well enough. If this stops being enough, the feature checks
should each be their own action writing the result to somewhere, and the config
write step should depend on those checks (so that they can run in parallel and
as part of the build) -- utils/llvm/gn/README.rst already has some more words
on that in "Philosophy".

(write_cmake_config.py is also going to be used to write clang's
clang/include/clang/Config/config.h)

This also adds a few files for linking to system libraries in a consistent way
if needed in llvm/utils/gn/build/libs (and moves pthread to that model).0

I'm also adding llvm/utils/gn/secondary/llvm/lib/Target/targets.gni in this
patch because $native_arch is needed for writing llvm-config.h -- the rest of
it will be used later, when the build files for llvm/lib/Target get added. That
file describes how to select which archs to build.

As a demo, also add a build file for llvm-undname and make it the default build
target (it depends on everything that can currently be built).

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

llvm-svn: 347636
2018-11-27 05:19:17 +00:00
Nico Weber
de3429242c Add initial scaffolding for the GN build.
See "GN build roundtable summary; adding GN build files to the repo" on
llvm-dev and cfe-dev for discussion.

In particular, this build is completely unsupported. People adding new files to
LLVM are not expected to update the GN build files, and reviewers are not
supposed to request the gn build files to be updated.

This adds just enough to be able to build llvm/lib/Demangle. It requires using
a monorepo.

This adds a few build config options you can set in args.gn
(`gn args out/foo --list` for all):
- is_debug = true to enable debug builds (defaults to release)
- llvm_enable_assertions to toggle assertions (defaults to true)
- clang_base_path, if set an absolute path to a locally-built clang to be used
  as host compiler

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

llvm-svn: 347128
2018-11-17 02:21:53 +00:00