Commit Graph

434 Commits

Author SHA1 Message Date
Reid Kleckner 6452ae9617 [compiler-rt] Rename lit.*.cfg.* -> lit.*.cfg.py.*
These lit configuration files are really Python source code. Using the
.py file extension helps editors and tools use the correct language
mode. LLVM and Clang already use this convention for lit configuration,
this change simply applies it to all of compiler-rt.

Reviewers: vitalybuka, dberris

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364591 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-27 20:56:04 +00:00
Vitaly Buka 7687273d4e [GN] Update build file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364583 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-27 19:55:22 +00:00
Vitaly Buka 6dfbf1efb2 [GN] Set exit code to 1 if changes are needed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364582 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-27 19:55:21 +00:00
Nico Weber 83d25842b0 gn build: Follow-up to r364491 "[GN] Update build files"
- Merge r364427 (GSYM lib) more: It was missing the new unit test
  (as pointed out by llvm/utils/gn/build/sync_source_lists_from_cmake.py),
  and it had some superfluous deps not present in the cmake build.

- Merge r364474 (clang DependencyScanning lib) more: The deps didn't
  quite match cmake.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364501 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-27 06:08:57 +00:00
Vitaly Buka 2f93dab1ae [GN] Fix check-llvm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364493 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-27 01:35:47 +00:00
Vitaly Buka fd46f2294b [GN] Update build files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364491 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-27 01:34:19 +00:00
Clement Courbet 6f6d98e186 Revert "r364412 [ExpandMemCmp][MergeICmps] Move passes out of CodeGen into opt pipeline."
Breaks sanitizers:
    libFuzzer :: cxxstring.test
    libFuzzer :: memcmp.test
    libFuzzer :: recommended-dictionary.test
    libFuzzer :: strcmp.test
    libFuzzer :: value-profile-mem.test
    libFuzzer :: value-profile-strcmp.test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364416 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-26 12:13:13 +00:00
Clement Courbet e0fc543f4c [ExpandMemCmp][MergeICmps] Move passes out of CodeGen into opt pipeline.
This allows later passes (in particular InstCombine) to optimize more
cases.

One that's important to us is `memcmp(p, q, constant) < 0` and memcmp(p, q, constant) > 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364412 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-26 11:50:18 +00:00
Nico Weber 04f6b4ef8c gn build: Merge r364387
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364411 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-26 11:44:54 +00:00
Nico Weber 615e00618a gn build: Merge r364386
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364409 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-26 11:35:28 +00:00
Nico Weber bafb499a2f gn build: Merge r364389
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364408 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-26 11:33:56 +00:00
Peter Collingbourne 40a575fd11 gn build: Merge r364288.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364374 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-26 01:52:22 +00:00
Petr Hosek 43f3f95395 [GN] Generation failure caused by trailing space in file name
When I executed gn.py gen out/gn I got the following error:

ERROR at //compiler-rt/lib/builtins/BUILD.gn:162:7: Only source, header, and object files belong in the sources of a static_library. //compiler-rt/lib/builtins/emutls.c  is not one of the valid types.
      "emutls.c ",
      ^----------
See //compiler-rt/lib/BUILD.gn:3:5: which caused the file to be included.
    "//compiler-rt/lib/builtins",
    ^---------------------------
It turns out to be that the latest gn doesn't accept ill-format file name. And the emutls.c above has a trailing space.
Remove the trailing space should work.

Patch By: myhsu
Differential Revision: https://reviews.llvm.org/D63449

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364162 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-23 23:12:10 +00:00
Peter Collingbourne fd3d2d94f1 gn build: Merge r364046.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364116 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-22 00:03:53 +00:00
Vitaly Buka da9b59dae2 [GN] Fix check-clang by disabling plugins
We can't link Analysis/plugins without -fPIC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364016 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-21 09:54:32 +00:00
Vitaly Buka 4dd240da59 [GN] Put libcxx include into the same place as cmake to fix Driver/print-file-name.c test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364015 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-21 09:54:31 +00:00
Vitaly Buka d8ba01e7c9 [GN] Fix build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364004 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-21 02:15:07 +00:00
Nico Weber f49faebedd gn build: Merge r363948
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363960 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-20 18:18:40 +00:00
Peter Collingbourne 3e7c8a9acd gn build: Merge r363757.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363865 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-19 19:11:23 +00:00
Peter Collingbourne d3a9dda294 gn build: Merge r363848.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363864 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-19 19:11:14 +00:00
Peter Collingbourne f2506466d2 gn build: Merge r363846.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363863 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-19 19:11:05 +00:00
Peter Collingbourne 91db7a7580 gn build: Merge r363794.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363862 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-19 19:10:56 +00:00
Peter Collingbourne f43e6f57b1 gn build: Merge r363680.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363861 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-19 19:10:47 +00:00
Peter Collingbourne 6b9664a15e gn build: Merge r363712.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363860 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-19 19:10:38 +00:00
Nico Weber 6ba6c1c9af gn build: Merge r363658
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363673 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-18 12:29:04 +00:00
Nico Weber 9ad1ee6fd3 gn build: Merge r363649
This reverts commit "gn build: Merge r363626" because r363626
was reverted in r363649.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363672 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-18 12:26:31 +00:00
Peter Collingbourne bca91c8cab gn build: Merge r363626.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363634 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-17 23:39:31 +00:00
Peter Collingbourne e6bda13f36 gn build: Merge r363483.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363610 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-17 20:03:11 +00:00
Peter Collingbourne d07c0627e3 gn build: Merge r363584.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363609 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-17 19:59:16 +00:00
Nico Weber c0de78b220 gn build: Merge r363541
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363583 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-17 17:45:12 +00:00
Nico Weber f95bc3347d gn build: Merge r363530
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363549 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-17 12:18:27 +00:00
Nico Weber 29fd1c2a34 gn build: Merge r363444
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363505 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-16 02:24:01 +00:00
Nico Weber b38f353791 gn build: Add NVPTX target
The NVPTX target is a bit unusual in that it's the only target without a
disassembler, and one of three targets without an asm parser (and the
first one of those three in the gn build). NVPTX doesn't have those
because it's not a binary format.

The CMake build checks for the existence of
{AsmParser,Disassembler}/CMakeLists.txt when setting
LLVM_ENUM_ASM_PARSERS / LLVM_ENUM_DISASSEBLERS
(http://llvm-cs.pcc.me.uk/CMakeLists.txt#744). The GN build doesn't want
to hit the disk for things like this, so instead I'm adding explicit
`targets_with_asm_parsers` and `targets_with_disassemblers` lists. Since
both are needed rarely, they are defined in their own gni files.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363437 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-14 18:07:00 +00:00
Nico Weber ce52d84b19 gn build: Simplify Target build files
Now that the cycle between MCTargetDesc and TargetInfo is gone
(see revisions 360709 360718 360722 360724 360726 360731 360733 360735 360736),
remove the dependency from TargetInfo on MCTargetDesc:tablegen. In most
targets, this makes MCTargetDesc:tablegen have just a single use, so
inline it there.

For AArch64, ARM, and RISCV there's still a similar cycle between
MCTargetDesc and Utils, so the MCTargetDesc:tablegen indirection is
still needed there.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363436 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-14 17:58:34 +00:00
Nico Weber 11004010bf gn build: Merge r363376
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363378 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-14 12:31:18 +00:00
Nico Weber d2380d1dbb gn build: Merge r363204 (clang-scan-deps)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363353 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-14 04:26:01 +00:00
Nico Weber 521eae8a46 gn build: Merge r363242
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363324 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-13 20:25:18 +00:00
Nico Weber 3646c4faaf gn build: Add SystemZ target
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363170 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-12 14:24:43 +00:00
Nico Weber 705be8ba10 gn build: Add Mips target
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363159 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-12 13:25:58 +00:00
Nico Weber 0a40e2c608 gn build: add RISCV target
Patch from David L. Jones <dlj@google.com>, with minor tweaks by me.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363154 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-12 12:41:03 +00:00
Nico Weber 4dac0addd8 gn build: Merge r363122
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363152 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-12 12:27:04 +00:00
Nico Weber 2ecbbba539 Share /machine: handling code with llvm-cvtres too
r363016 let lld-link and llvm-lib share the /machine: parsing code.
This lets llvm-cvtres share it as well.

Making llvm-cvtres depend on llvm-lib seemed a bit strange (it doesn't
need llvm-lib's dependencies on BinaryFormat and BitReader) and I
couldn't find a good place to put this code. Since it's just a few
lines, put it in lib/Object for now.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363144 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-12 11:32:43 +00:00
Nico Weber bf221f5fdf lld-link: Reject more than one resource .obj file
Users are exepcted to pass all .res files to the linker, which then
merges all the resource in all .res files into a tree structure and then
converts the final tree structure to a .obj file with .rsrc$01 and
.rsrc$02 sections and then links that.

If the user instead passes several .obj files containing such resources,
the correct thing to do would be to have custom code to merge the trees
in the resource sections instead of doing normal section merging -- but
link.exe rejects if multiple resource obj files are passed in with
LNK4078, so let lld-link do that too instead of silently writing broken
.rsrc sections in that case.

The only real way to run into this is if users manually convert .res
files to .obj files by running cvtres and then handing the resulting
.obj files to lld-link instead, which in practice likely never happens.

(lld-link is slightly stricter than link.exe now: If link.exe is passed
one .obj file created by cvtres, and a .res file, for some reason it
just emits a warning instead of an error and outputs strange looking
data. lld-link now errors out on mixed input like this.)

One way users could accidentally run into this is the following
scenario: If a .res file is passed to lib.exe, then lib.exe calls
cvtres.exe on the .res file before putting it in the output .lib.
(llvm-lib currently doesn't do this.)
link.exe's /wholearchive seems to only add obj files referenced from the
static library index, but lld-link current really adds all files in the
archive. So if lld-link /wholearchive is used with .lib files produced
by lib.exe and .res files were among the files handed to lib.exe, we
previously silently produced invalid output, but now we error out.

link.exe's /wholearchive semantics on the other hand mean that it
wouldn't load the resource object files from the .lib file at all.
Since this scenario is probably still an unlikely corner case,
the difference in behavior here seems fine -- and lld-link might have to
change to use link.exe's /wholearchive semantics in the future anyways.

Vaguely related to PR42180.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363078 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 15:22:28 +00:00
Nico Weber f4068f34be gn build: Merge r362939
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363020 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 01:29:11 +00:00
Nico Weber 54784fa169 gn build: Merge r362972
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363019 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 01:23:38 +00:00
Nico Weber dbcdf91ca8 gn build: Merge r362913
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362932 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-10 12:49:02 +00:00
Nico Weber 878711af6c gn build: Merge r362857
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362864 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-08 01:27:47 +00:00
Nico Weber d939c9d32a llvm-lib: Disallow mixing object files with different machine types
lib.exe doesn't allow creating .lib files with object files that have
differing machine types. Update llvm-lib to match.

The motivation is to make it possible to infer the machine type of a
.lib file in lld, so that it can warn when e.g. a 32-bit .lib file is
passed to a 64-bit link (PR38965).

Fixes PR38782.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362798 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-07 13:24:34 +00:00
Nico Weber 0ae4a51971 gn build: Merge r362766
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362796 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-07 13:09:40 +00:00
Nico Weber d24e6ef824 gn build: Merge r362774
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362795 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-07 13:08:17 +00:00