Commit Graph

2340 Commits

Author SHA1 Message Date
LLVM GN Syncbot 2cb4f53612 [gn build] Port 49e736d845 2021-10-07 15:19:44 +00:00
LLVM GN Syncbot 6c8e80c3c2 [gn build] Port 3e9689d72c 2021-10-07 15:11:38 +00:00
LLVM GN Syncbot c50162b271 [gn build] Port d550930afc 2021-10-07 15:03:32 +00:00
LLVM GN Syncbot ae4c0c7cfc [gn build] Port ccfb0555f7 2021-10-06 22:24:38 +00:00
LLVM GN Syncbot 9f5c70c7ad [gn build] Port 67231650e6 2021-10-06 20:22:05 +00:00
Nico Weber 07e5394c63 [gn build] (manually) port 77d5ccdc6f
(similar to 64f623d4c3)
2021-10-06 15:41:38 -04:00
LLVM GN Syncbot 665662a71e [gn build] Port 10f16bc7b2 2021-10-06 17:59:12 +00:00
LLVM GN Syncbot 1e013f112e [gn build] Port a30a36f66a 2021-10-06 11:59:40 +00:00
LLVM GN Syncbot a67b1220f5 [gn build] Port fc36fb4d23 2021-10-06 08:40:14 +00:00
LLVM GN Syncbot 8b2d6fd6cb [gn build] Port 214054f78a 2021-10-05 10:41:33 +00:00
LLVM GN Syncbot e66121b68e [gn build] Port cfef1803dd 2021-10-05 04:34:07 +00:00
LLVM GN Syncbot 72abda418e [gn build] Port 811b1736d9 2021-10-04 15:13:27 +00:00
LLVM GN Syncbot e420164f40 [gn build] Port 657f02d458 2021-10-02 00:21:42 +00:00
LLVM GN Syncbot 4cdee8de6b [gn build] Port c8c2b4629f 2021-10-01 20:14:30 +00:00
LLVM GN Syncbot 06cea95a5a [gn build] Port 33dd98e9e4 2021-10-01 18:18:21 +00:00
LLVM GN Syncbot 9c49587cc1 [gn build] Port 47d6274d4c 2021-10-01 14:57:31 +00:00
LLVM GN Syncbot 4f0a39b9b4 [gn build] Port fb99424a6f 2021-10-01 14:29:37 +00:00
LLVM GN Syncbot fcdefc8575 [gn build] Port 3077bc90de 2021-10-01 00:43:50 +00:00
LLVM GN Syncbot 0337e228c1 [gn build] Port 050edef853 2021-09-30 19:35:12 +00:00
Nico Weber e31899c708 Reland "[clang-cl] Accept `#pragma warning(disable : N)` for some N"
This reverts commit 0cd9d8a48b and
adds the changes described in https://reviews.llvm.org/D110668#3034461.
2021-09-30 15:03:23 -04:00
LLVM GN Syncbot 4db00342e5 [gn build] Port 13f3c39f36 2021-09-30 08:28:24 +00:00
Amy Huang 0cd9d8a48b Revert "[clang-cl] Accept `#pragma warning(disable : N)` for some N"
because it causes `error: error reading '/wd4091'` errors in
compiler-rt builds.
2021-09-29 18:46:55 -07:00
LLVM GN Syncbot 9ad17fe0de [gn build] Port 969359e3b8 2021-09-29 20:09:08 +00:00
Nico Weber b2de52bec1 [clang-cl] Accept `#pragma warning(disable : N)` for some N
clang-cl maps /wdNNNN to -Wno-flags for a few warnings that map
cleanly from cl.exe concepts to clang concepts.

This patch adds support for the same numbers to
`#pragma warning(disable : NNNN)`. It also lets
`#pragma warning(push)` and `#pragma warning(pop)` have an effect,
since these are used together with `warning(disable)`.

The optional numeric argument to `warning(push)` is ignored,
as are the other non-`disable` `pragma warning()` arguments.
(Supporting `error` would be easy, but we also don't support
`/we`, and those should probably be added together.)

The motivating example is that a bunch of code (including in LLVM)
uses this idiom to locally disable warnings about calls to deprecated
functions in Windows-only code, and 4996 maps nicely to
-Wno-deprecated-declarations:

    #pragma warning(push)
    #pragma warning(disable: 4996)
      f();
    #pragma warning(pop)

Implementation-wise:
- Move `/wd` flag handling from Options.td to actual Driver-level code
- Extract the function mapping cl.exe IDs to warning groups to the
  new file clang/lib/Basic/CLWarnings.cpp
- Create a diag::Group enum so that CLWarnings.cpp can refer to
  existing groups by ID (and give DllexportExplicitInstantiationDecl
  a named group), and add a function to map a diag::Group to the
  spelling of it's associated commandline flag
- Call that new function from PragmaWarningHandler

Differential Revision: https://reviews.llvm.org/D110668
2021-09-29 13:14:23 -04:00
LLVM GN Syncbot fd9a5b911d [gn build] Port c07f709969 2021-09-29 01:03:11 +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
LLVM GN Syncbot 5aa4c74c9a [gn build] Port 864b206796 2021-09-28 10:58:48 +00:00
LLVM GN Syncbot 57cd7b018c [gn build] Port 6cfb4d46ba 2021-09-27 21:56:39 +00:00
LLVM GN Syncbot e2eb651cfc [gn build] Port 9da2fa277e 2021-09-27 12:33:13 +00:00
LLVM GN Syncbot a44b122ade [gn build] Port 6498b0e991 2021-09-26 17:25:08 +00:00
LLVM GN Syncbot 70a48697d5 [gn build] Port c0d889995e 2021-09-24 20:30:26 +00:00
LLVM GN Syncbot 5f98024011 [gn build] Port a9ae2436fc 2021-09-24 20:30:25 +00:00
LLVM GN Syncbot 58d9ed2c93 [gn build] Port a2c1cf09df 2021-09-24 03:01:20 +00:00
LLVM GN Syncbot 1aed7fcf09 [gn build] Port a44ab17025 2021-09-23 19:01:30 +00:00
LLVM GN Syncbot ac889a5262 [gn build] Port f4abdb0c07 2021-09-23 13:34:40 +00:00
Nico Weber 64f623d4c3 [gn build] (manually) port ac191bcc99 2021-09-23 09:34:24 -04:00
Nico Weber cef0280a95 [gn build] (semi-manually) port 702cb7afe9 2021-09-23 09:26:27 -04:00
LLVM GN Syncbot f099ac838e [gn build] Port 7a320b279d 2021-09-22 12:20:22 +00:00
Nico Weber c828b93fb3 [gn build] (manually) port f8b1cc3657 2021-09-22 08:20:12 -04:00
LLVM GN Syncbot a3bb4f1455 [gn build] Port a04a6ce772 2021-09-21 16:34:07 +00:00
Amara Emerson 4ceea77409 [X86] Rename the X86WinAllocaExpander pass and related symbols to "DynAlloca". NFC.
For x86 Darwin, we have a stack checking feature which re-uses some of this
machinery around stack probing on Windows. Renaming this to be more appropriate
for a generic feature.

Differential Revision: https://reviews.llvm.org/D109993
2021-09-20 16:19:28 -07:00
Arthur Eubanks b64fdaa86b [gn build] Don't pass -Wl,-z,defs for sanitizer builds
-Wl,-z,defs doesn't work with sanitizers.
See https://clang.llvm.org/docs/AddressSanitizer.html

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D110086
2021-09-20 11:39:39 -07:00
LLVM GN Syncbot 93604c9711 [gn build] Port d85e347a28 2021-09-20 16:39:59 +00:00
Amy Huang 6f7483b1ec Reland "[LLD] Remove global state in lld/COFF" after fixing asan and msan test failures
Original commit description:

  [LLD] Remove global state in lld/COFF

  This patch removes globals from the lldCOFF library, by moving globals
  into a context class (COFFLinkingContext) and passing it around wherever
  it's needed.

  See https://lists.llvm.org/pipermail/llvm-dev/2021-June/151184.html for
  context about removing globals from LLD.

  I also haven't moved the `driver` or `config` variables yet.

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

This reverts commit a2fd05ada9.

Original commits were b4fa71eed3
and e03c7e367a.
2021-09-17 17:18:42 -07:00
Samuel f18c0739b3 [llvm-reduce] Add reduce operands pass
Add reduction to set operands to default values

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D108903
2021-09-17 12:32:15 -07:00
Nico Weber df1ab7de38 [gn build] (semi-manually) port 750d5fc65c 2021-09-17 12:02:09 -04:00
LLVM GN Syncbot 2755670411 [gn build] Port cc8229603b 2021-09-17 00:45:09 +00:00
LLVM GN Syncbot a9a6cdc1bd [gn build] Port 78b083dbb7 2021-09-16 23:56:09 +00:00
Amy Huang a2fd05ada9 Temporarily revert "[LLD] Remove global state in lld/COFF" and "[lld] Add test to
check for timer output"

Seems to be causing a number of asan test failures.

This reverts commit b4fa71eed3
and e03c7e367a.
2021-09-16 11:58:11 -07:00
Amy Huang b4fa71eed3 [LLD] Remove global state in lld/COFF
This patch removes globals from the lldCOFF library, by moving globals
into a context class (COFFLinkingContext) and passing it around wherever
it's needed.

See https://lists.llvm.org/pipermail/llvm-dev/2021-June/151184.html for
context about removing globals from LLD.

I also haven't moved the `driver` or `config` variables yet.

Differential Revision: https://reviews.llvm.org/D109634
2021-09-16 11:00:23 -07:00
Arthur Eubanks c3ddc13d7d [NFC] Split up PassBuilder.cpp
PassBuilder.cpp is the slowest file to compile in LLVM.
When trying to test changes to pipelines, it takes a long time to recompile.

This doesn't actually speedup building PassBuilder.cpp itself since most
of the time is spent in other large/duplicated functions caused by
PassRegistry.def.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D109798
2021-09-15 15:30:39 -07:00
LLVM GN Syncbot c90cbb2d34 [gn build] Port d249200fa7 2021-09-15 22:14:18 +00:00
Nico Weber afc45ff06f [gn build] (manually) port 2c42a73d6c 2021-09-15 08:01:02 -04:00
LLVM GN Syncbot 10b069d1a0 [gn build] Port 626586fc25 2021-09-15 02:29:04 +00:00
LLVM GN Syncbot 5a7e1d52a9 [gn build] Port 49992c0414 2021-09-14 17:54:35 +00:00
Nico Weber 53727b48fd [gn build] Use lib_dirs instead of qualified path in libs for diaguids.lib
Follow-up to D109708: Using lib_dirs means this will work with ancient gn binaries.

Change the toolchain definitions to make lib_dirs have the right effect, and
pull out lib_switch of each of the tools while here.

This means we now do pass /LIBPATH: to link.exe, but since we invoke it directly
and not through clang-cl, this doesn't actually require D109624. And since this
is built in to GN, we don't need a config to push the flag to dependents.

This is arguably a bit more idiomatic, and it doesn't require folks to update
their GN binaries. No effective behavior change.

Differential Revision: https://reviews.llvm.org/D109763
2021-09-14 12:31:41 -04:00
Nico Weber 8cfab5de13 [Windows build] Use "DIA SDK" in sysroot
This updates llvm/utils/sysroot.py to include the "DIA SDK" folder in the
sysroot.

It also updates the build to look for the DIA SDK there if a sysroot is set.

This requires moving LLVM_WINSYSROOT to config-ix.cmake.

For the GN build, I chose to pass a qualified path to diaguids in libs instead
of pushing a config with a `/libpath:` flag. The former requires a GN with
https://gn-review.googlesource.com/c/gn/+/12200, the latter requires D109624.
The former is more like the cmake build, arguably a bit simpler, and it's
easier to check for the wrong GN revision and easier to update GN.

Differential Revision: https://reviews.llvm.org/D109708
2021-09-14 08:59:28 -04:00
LLVM GN Syncbot 7c76cefd7c [gn build] Port 2c8e784915 2021-09-14 00:27:49 +00:00
Nico Weber 1a56a291c5 [gn build] Fix typos in config visibility lists
GN https://gn-review.googlesource.com/c/gn/+/12140 identified these
typos. Fix them.

No effective behavior change.
2021-09-13 12:50:33 -04:00
Nico Weber 80b60580df [gn build] (semi-manually) port 4247381e26 2021-09-13 10:03:29 -04:00
LLVM GN Syncbot dfc68591a6 [gn build] Port 0213d7ec0c 2021-09-13 12:04:24 +00:00
LLVM GN Syncbot d06691481d [gn build] Port bb72f07380 2021-09-12 04:32:13 +00:00
LLVM GN Syncbot 6aacc69338 [gn build] Port 2269a941a4 2021-09-11 09:02:52 +00:00
LLVM GN Syncbot 26f1cab44a [gn build] Port bb27e45643 2021-09-11 08:51:51 +00:00
LLVM GN Syncbot 49b7d641f9 [gn build] Port b1fb3d75c9 2021-09-09 15:10:21 +00:00
Nico Weber 7484206cfd [gn build] Make lldb build on Windows
Differential Revision: https://reviews.llvm.org/D109478
2021-09-09 08:13:50 -04:00
LLVM GN Syncbot 9bb803c7a6 [gn build] Port c58c7a6ea0 2021-09-09 11:25:54 +00:00
Peter Collingbourne 883e93cb28 gn build: Add support for building lldb-server on Android.
The cross-compiled lldb-server targets are added to the lldb deps if
Android cross compilation is enabled.

Differential Revision: https://reviews.llvm.org/D109464
2021-09-08 19:33:51 -07:00
Peter Collingbourne 9449f441fc gn build: Add support for building LLDB on Linux.
On Linux, LLDB depends on lldb-server at runtime (on Mac, the dependency on
a debug server presumably comes via the system debugserver), so I added it
to deps.

Differential Revision: https://reviews.llvm.org/D109463
2021-09-08 19:33:51 -07:00
Nico Weber b32506cb86 Revert "[gn build] Add a file that should have been in cfe02847496b856aa"
This reverts commit 6be7f5c354.
We'll need this file eventually, but it in fact shouldn't have been in
cfe0284749. It's currently unreferenced.
2021-09-07 17:01:48 -04:00
Nico Weber d4071b2777 [gn build] Try to fix win build after cfe0284749 2021-09-07 16:58:57 -04:00
Nico Weber f514fb587c [gn build] Try to fix mac/intel build after cfe0284749
The public header lldb/include/lldb/Host/XML.h includes libxml/xmlreader.h,
so this must be a public dep.
2021-09-07 15:52:59 -04:00
Nico Weber d5166f86a3 [gn build] Try to fix mac/arm build after cfe0284749 2021-09-07 15:46:55 -04:00
Nico Weber 6be7f5c354 [gn build] Add a file that should have been in cfe0284749 2021-09-07 15:37:24 -04:00
Nico Weber b3e9ba605f [gn build] Attempt to fix linux build after cfe0284749 2021-09-07 15:29:30 -04:00
Nico Weber cfe0284749 [gn build] Add build files for LLDB
This is enough to get the lit-based tests to pass on macOS.

Doesn't yet add build targets for:
- Any LLDB unit tests
- swig bindings
- various targets not needed by lit tests

LLDB has many dependency cycles, something GN doesn't allow. For
that reason, I've omitted some dependency edges. Hopefully we can
clean up the cycles one day.

LLDB has a public/private header distinction, but mostly ignores it.
Many libraries include private headers from other modules.

Since LLDB is the first target the LLVM/GN build that uses Objective-C++
code, add some machinery to the toolchain file to handle that.

Differential Revision: https://reviews.llvm.org/D109185
2021-09-07 15:25:04 -04:00
LLVM GN Syncbot edc8ce1ecf [gn build] Port 12fa608af4 2021-09-06 09:25:28 +00:00
LLVM GN Syncbot fa69ccd189 [gn build] Port 8ce2675b13 2021-09-05 19:38:22 +00:00
LLVM GN Syncbot a1ea479f0a [gn build] Port d7444d9f41 2021-09-04 09:41:32 +00:00
Nico Weber 543fd3dd2b [gn build] Reformat all files
Ran `git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format`.
2021-09-03 14:17:28 -04:00
LLVM GN Syncbot db8edbe240 [gn build] Port b9e57e0305 2021-09-03 17:37:49 +00:00
Nico Weber 98d0f8f2ff Revert "[gn build] (manually) port 6fe2beba7d (ExceptionTests)"
This reverts commit da47c2719b.
6fe2beba7d was reverted in 8859640461.
2021-09-03 09:19:11 -04:00
Nico Weber da47c2719b [gn build] (manually) port 6fe2beba7d (ExceptionTests) 2021-09-03 09:01:24 -04:00
LLVM GN Syncbot 53486ea159 [gn build] Port a375bfb5b7 2021-09-03 11:51:19 +00:00
LLVM GN Syncbot 62bbae8407 [gn build] Port 2ed91da0f1 2021-09-03 08:53:21 +00:00
LLVM GN Syncbot 6cc5333650 [gn build] Port dad60f8071 2021-09-02 22:29:41 +00:00
LLVM GN Syncbot 621a615372 [gn build] Port 0922ce56f4 2021-09-01 17:49:53 +00:00
LLVM GN Syncbot 9c37eda6e4 [gn build] Port e983a659e5 2021-08-31 16:45:24 +00:00
LLVM GN Syncbot 22efb9d364 [gn build] Port 3285c7a436 2021-08-31 13:47:38 +00:00
LLVM GN Syncbot d4d008f7d7 [gn build] Port 54e8cae565 2021-08-27 17:29:43 +00:00
LLVM GN Syncbot e57205b555 [gn build] Port c8b14c03ec 2021-08-27 16:46:52 +00:00
Arthur Eubanks 77b6a4bde4 [gn build] Don't copy xray includes
The gn build doesn't support xray, so there's no reason to make the xray
headers available. Some CMake checks check if xray includes are
available to determine if xray is usable. Since we don't build the xray
runtime, there are link errors.

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D108737
2021-08-27 08:51:27 -07:00
LLVM GN Syncbot f8df807653 [gn build] Port b749ef9e22 2021-08-27 04:42:51 +00:00
LLVM GN Syncbot 9ade9d9ac1 [gn build] Port ee44dd8062 2021-08-26 18:08:07 +00:00
LLVM GN Syncbot 70f3ccb6a2 [gn build] Port 1076082a0d 2021-08-26 16:28:53 +00:00
LLVM GN Syncbot 6894552a74 [gn build] Port 21b25a1fb3 2021-08-26 08:14:37 +00:00
LLVM GN Syncbot fdefde4965 [gn build] Port 3373e84539 2021-08-26 07:29:05 +00:00
Arthur Eubanks 1bdeafeaf4 [gn build] Unbreak non-clang host builds
eecd5d0a broke non-clang host builds.
Some crt code is not always built with the just-built clang.

0da172b checked if the compiler is clang, not assert that the compiler
is clang.
2021-08-25 16:14:45 -07:00
LLVM GN Syncbot 8e135a6d08 [gn build] Port fe01014faa 2021-08-25 19:14:11 +00:00
Arthur Eubanks 4b7621c485 [gn build] Add missing dependency required by 832aae73 2021-08-25 10:13:23 -07:00
LLVM GN Syncbot b0b26ae4b3 [gn build] Port 48958d02d2 2021-08-25 09:02:08 +00:00
Nico Weber 2847b8b6ff [gn build] Manually port dbed061b more 2021-08-24 21:02:13 -04:00
Nico Weber 5f0d265b15 [gn build] (manually) port 87dd51983c 2021-08-24 16:40:44 -04:00
Arthur Eubanks d2e103644b [llvm-reduce] Remove various module data
This removes the data layout, target triple, source filename, and module
identifier when possible.

Reviewed By: swamulism

Differential Revision: https://reviews.llvm.org/D108568
2021-08-24 09:45:31 -07:00
LLVM GN Syncbot 93de779d63 [gn build] Port 7f99337f9b 2021-08-21 09:44:22 +00:00
LLVM GN Syncbot fa4132dc88 [gn build] Port e6407356ba 2021-08-20 06:14:22 +00:00
LLVM GN Syncbot 9b0f292e82 [gn build] Port 642885710e 2021-08-20 05:16:08 +00:00
LLVM GN Syncbot fe658c3f6e [gn build] Port 5fdaaf7fd8 2021-08-19 01:52:47 +00:00
LLVM GN Syncbot a0ed44943a [gn build] Port d8bbfe8a48 2021-08-18 21:58:30 +00:00
Peter Collingbourne b2e77cd095 gn build: Build libclang.so and libLTO.so on ELF platforms.
This requires changing the ELF build to enable -fPIC, consistent
with other platforms.

Differential Revision: https://reviews.llvm.org/D108223
2021-08-18 13:48:33 -07:00
LLVM GN Syncbot 0dfce025c4 [gn build] Port 38812f4ac1 2021-08-18 14:02:48 +00:00
LLVM GN Syncbot 26da53f5b6 [gn build] Port 45ac5f5441 2021-08-18 10:43:22 +00:00
LLVM GN Syncbot f58c0a962c [gn build] Port d1ec581ebf 2021-08-18 08:10:40 +00:00
LLVM GN Syncbot 6724d82ee2 [gn build] Port e256445bff 2021-08-18 05:02:05 +00:00
Nico Weber 20170447b0 [gn build] (manually) port 957334382c 2021-08-15 13:21:36 -04:00
LLVM GN Syncbot a00eb48059 [gn build] Port df324bba5c 2021-08-13 18:34:09 +00:00
LLVM GN Syncbot 95795e9d6e [gn build] Port 7b20e05c71 2021-08-13 18:34:09 +00:00
LLVM GN Syncbot 76beb4184c [gn build] Port 2ff7ca98a9 2021-08-13 01:31:18 +00:00
Nico Weber 1899112037 [gn build] manually port 18f9e25ce1 (AttrDocTable)
Also clang ClangAttrEmitter for -gen-clang-attr-doc-table to be
like all other tablegen: Produce a .inc file with the generated bits
and put the static parts into a regular .cpp file that includes the
.inc file.
2021-08-12 21:30:59 -04:00
LLVM GN Syncbot f5d32c56ee [gn build] Port 4ac87e3378 2021-08-12 17:16:05 +00:00
LLVM GN Syncbot 876664317a [gn build] Port d2c5cbc3a8 2021-08-12 15:33:09 +00:00
LLVM GN Syncbot 62c08c021d [gn build] Port 89a7bdb1f3 2021-08-11 14:16:15 +00:00
LLVM GN Syncbot f6425dfcbe [gn build] Port 2021-08-11 08:16:37 +00:00
LLVM GN Syncbot d41de8ed26 [gn build] Port 58915667d0 2021-08-11 02:07:04 +00:00
LLVM GN Syncbot c84c5d0520 [gn build] Port f9e58f35e9 2021-08-10 23:45:53 +00:00
LLVM GN Syncbot 93aa1c71d5 [gn build] Port 6f7f5b54c8 2021-08-10 04:47:01 +00:00
LLVM GN Syncbot 2708ccaa9a [gn build] Port 9d982c67ba 2021-08-09 22:10:24 +00:00
LLVM GN Syncbot 772d2093fc [gn build] Port 4ad9ec8a32 2021-08-06 16:59:24 +00:00
Reshabh Sharma 5173854f19 [AMDGPU] Handle functions in llvm's global ctors and dtors list
This patch introduces a new code object metadata field, ".kind"
which is used to add support for init and fini kernels.

HSAStreamer will use function attributes, "device-init" and
"device-fini" to distinguish between init and fini kernels from
the regular kernels and will emit metadata with ".kind" set to
"init" and "fini" respectively.

To reduce the number of init and fini kernels, the ctors and
dtors present in the llvm's global.ctors and global.dtors lists
are called from a single init and fini kernel respectively.

Reviewed by: yaxunl

Differential Revision: https://reviews.llvm.org/D105682
2021-08-06 15:53:33 +05:30
Nico Weber ddb26e2e00 [gn build] manually port 4d293f215d (LLVMDiff lib) 2021-08-05 22:09:02 +02:00
Fangrui Song 7a6482216f [CMake][gn] lldMachO=>lldMachOOld, lldMachO2=>lldMachO
Now that D95204 switched default to new Darwin backend, rename some CMake
targets to match.

Reviewed By: #lld-macho, smeenai, int3

Differential Revision: https://reviews.llvm.org/D107516
2021-08-04 18:52:41 -07:00
Arthur Eubanks 41354942c5 [gn build] Add cfi ignorelist to compiler-rt/lib
So that building the compiler-rt target also copies the cfi ignorelist

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D107411
2021-08-04 11:58:32 -07:00
Reshabh Sharma dce35ef104 Revert "[AMDGPU] Handle functions in llvm's global ctors and dtors list"
This reverts commit d42e70b3d3.
2021-08-04 23:33:31 +05:30
LLVM GN Syncbot 6dc4baf7b6 [gn build] Port ee7d20e846 2021-08-04 17:28:44 +00:00
Fangrui Song 43a43353f7 [gn build] (manually) port ee7d20e846 2021-08-04 10:28:27 -07:00
Reshabh Sharma d42e70b3d3 [AMDGPU] Handle functions in llvm's global ctors and dtors list
This patch introduces a new code object metadata field, ".kind"
which is used to add support for init and fini kernels.

HSAStreamer will use function attributes, "device-init" and
"device-fini" to distinguish between init and fini kernels from
the regular kernels and will emit metadata with ".kind" set to
"init" and "fini" respectively.

To reduce the number of init and fini kernels, the ctors and
dtors present in the llvm's global.ctors and global.dtors lists
are called from a single init and fini kernel respectively.

Reviewed by: yaxunl

Differential Revision: https://reviews.llvm.org/D105682
2021-08-04 19:53:33 +05:30
Vitaly Buka 6538aa8ce9 [NFC][tsan] Rename _inl.h to .inc
Differential Revision: https://reviews.llvm.org/D107319
2021-08-03 09:35:33 -07:00
Paulo Matos d3a0a65bf0 Reland: "[WebAssembly] Add new pass to lower int/ptr conversions of reftypes"
Add new pass LowerRefTypesIntPtrConv to generate debugtrap
instruction for an inttoptr and ptrtoint of a reference type instead
of erroring, since calling these instructions on non-integral pointers
has been since allowed (see ac81cb7e6).

Differential Revision: https://reviews.llvm.org/D107102
2021-08-03 09:20:51 +02:00
Paulo Matos 245f2ee647 Revert "[WebAssembly] Add new pass to lower int/ptr conversions of reftypes"
This reverts commit ce1c59dea6.
2021-08-02 20:12:25 +02:00
Nico Weber 3555880f10 [gn build] (manually) port 5c2b48fdb0 2021-08-02 20:10:04 +02:00
Paulo Matos ce1c59dea6 [WebAssembly] Add new pass to lower int/ptr conversions of reftypes
Add new pass LowerRefTypesIntPtrConv to generate trap
instruction for an inttoptr and ptrtoint of a reference type instead
of erroring, since calling these instructions on non-integral pointers
has been since allowed (see ac81cb7e6).

Differential Revision: https://reviews.llvm.org/D107102
2021-08-02 19:40:00 +02:00
LLVM GN Syncbot c112483fab [gn build] Port 481ad59b9f 2021-07-30 17:57:30 +00:00
Arthur Eubanks ee7c9b8f14 [gn build] Manually add file
Since bot is broken
2021-07-29 10:37:28 -07:00
LLVM GN Syncbot ecd5dc6dcc [gn build] Port 61c35fb0c2 2021-07-29 02:29:22 +00:00
LLVM GN Syncbot 8ddf0b178c [gn build] Port 0f4b41e038 2021-07-28 22:59:12 +00:00
Arthur Eubanks 3143ee4ddf [gn build] Manually port dbed061b 2021-07-28 15:45:30 -07:00
Arthur Eubanks 43a44f1c54 [gn build] Add support for Win/x86 compiler-rt
This allows us to build the x86 profile runtime.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D106972
2021-07-28 14:59:18 -07:00
Tom Stellard 08c766a731 Bump the trunk major version to 14
and clear the release notes.
2021-07-27 21:58:25 -07:00
LLVM GN Syncbot 7809e04e3c [gn build] Port 8a48e6dda9 2021-07-27 23:10:20 +00:00
Nico Weber 3888039403 [gn build] manually port 71909de374 2021-07-27 18:23:28 -04:00
LLVM GN Syncbot df95697db3 [gn build] Port 02077da7e7 2021-07-27 18:41:55 +00:00
LLVM GN Syncbot 66640aa5ae [gn build] Port 2487db1f28 2021-07-27 06:54:07 +00:00
Nico Weber e30293352c [gn build] Kind of port c7b3a91017 (libclang version script)
libclang is only built as static library in the GN build at the
moment, which means we now generate a .exports file form a version
script and then link.exe and ld64 inputs from the .exports file
but don't use the version script, but hey.
2021-07-26 22:12:06 -04:00
LLVM GN Syncbot fcb3bb581b [gn build] Port 6aa9e746eb 2021-07-24 12:03:50 +00:00
LLVM GN Syncbot 698fef3eb6 [gn build] Port 96709823ec 2021-07-24 03:08:02 +00:00
LLVM GN Syncbot d556d71670 [gn build] Port e5d8b93e5a 2021-07-23 16:13:25 +00:00
LLVM GN Syncbot f890d6b892 [gn build] Port 0ad562b48b 2021-07-23 16:13:24 +00:00
LLVM GN Syncbot e7077971f2 [gn build] Port 0118a64934 2021-07-23 07:19:25 +00:00
Nico Weber 4a76bd0e31 [gn build] Allow use_asan=true on macOS
Seems to work.

(I only tried macOS, not iOS, but need to allow both because
the iOS toolchain used to build compiler-rt asserts otherwise.)
2021-07-22 21:38:02 -04:00
Nico Weber 377320fe80 [gn build] Reformat all gn files
Ran `git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format`.
2021-07-22 21:35:35 -04:00
Nico Weber 681107e9f0 [gn build] (manually) port f8c6515554 (libLLVMDWP) 2021-07-22 19:38:50 -04:00
LLVM GN Syncbot 4e0cefc640 [gn build] Port 3959c95deb 2021-07-22 18:41:45 +00:00
Nico Weber fd3823cc82 [gn build] (manually) port 78bda89412 from 2012 because 924d62ca4a added it to check-llvm 2021-07-22 09:11:54 -04:00
LLVM GN Syncbot e2000f2761 [gn build] Port 74fd3cb8cd 2021-07-21 21:45:33 +00:00
LLVM GN Syncbot d81a3cbe8b [gn build] Port 403e67d34d 2021-07-21 00:19:59 +00:00
LLVM GN Syncbot c781eb153b [gn build] Port 808bbc2c47 2021-07-20 21:53:24 +00:00
LLVM GN Syncbot d1438c1bd2 [gn build] Port 05a6d74c48 2021-07-20 20:51:01 +00:00
LLVM GN Syncbot 7cefcd9230 [gn build] Port 1a29403d2f 2021-07-20 15:13:51 +00:00
Nico Weber ce5abfafb5 [gn build] remove stray character in a comment 2021-07-20 10:13:48 -04:00
LLVM GN Syncbot 978c5d8d2a [gn build] Port 2b08f6af62 2021-07-20 12:00:01 +00:00
Nico Weber 9ced84de09 [gn build] (manually) port bc1a2979fc 2021-07-20 06:43:30 -04:00
LLVM GN Syncbot 53942cd4dc [gn build] Port adb55d7c32 2021-07-20 05:51:14 +00:00
Nico Weber 18a8aaee0e [gn build] Fix llvm_build_instrumented_coverage=true builds with goma/rbe 2021-07-19 19:57:02 -04:00
LLVM GN Syncbot 49289bd943 [gn build] Port 08b289867b 2021-07-19 21:33:24 +00:00
LLVM GN Syncbot 42e6cfc81d [gn build] Port 54902e00d1 2021-07-19 19:24:16 +00:00
LLVM GN Syncbot 68dec42e6b [gn build] Port 8b4acb067f 2021-07-19 18:24:11 +00:00
LLVM GN Syncbot e78560f6e8 [gn build] Port 61fa9afe4c 2021-07-19 18:24:10 +00:00
LLVM GN Syncbot d0ed40204d [gn build] Port 6103fdfab4 2021-07-19 18:24:09 +00:00
Haowei Wu 6103fdfab4 [ifs][elfabi] Merge llvm-ifs/elfabi tools
This change merges llvm-elfabi and llvm-ifs tools.

Differential Revision: https://reviews.llvm.org/D100139
2021-07-19 11:23:19 -07:00
Whisperity 73e4b5cfa8 [clang-tidy] Add 'readability-suspicious-call-argument' check
Finds function calls where the call arguments might be provided in an
incorrect order, based on the comparison (via string metrics) of the
parameter names and the argument names against each other.

A diagnostic is emitted if an argument name is similar to a *different*
parameter than the one currently passed to, and it is sufficiently
dissimilar to the one it **is** passed to currently.

False-positive warnings from this check are useful to indicate bad
naming convention issues, even if a swap isn't necessary.
This check does not generate FixIts.

Originally implemented by @varjujan as his Master's Thesis work.
The check was subsequently taken over by @barancsuk who added type
conformity checks to silence false positive matches.
The work by @whisperity involved driving the check's review and fixing
some more bugs in the process.

Reviewed By: aaron.ballman, alexfh

Differential Revision: http://reviews.llvm.org/D20689

Co-authored-by: János Varjú <varjujanos2@gmail.com>
Co-authored-by: Lilla Barancsuk <barancsuklilla@gmail.com>
2021-07-19 10:18:09 +02:00
LLVM GN Syncbot 1daaf1df56 [gn build] Port 0bf4b81d57 2021-07-16 20:32:47 +00:00
Nico Weber 304293d85d [gn build] (semi-manually) port 6a4054ef06 2021-07-16 15:54:13 -04:00
LLVM GN Syncbot b1ffa8fc61 [gn build] Port 766a08df12 2021-07-16 02:23:45 +00:00
Nico Weber 18d8779747 [gn build] port 766a08df12 2021-07-15 22:23:14 -04:00
Ilya Leoshkevich 402fc790eb [TSan] Add SystemZ longjmp support
Implement the interceptor and stack pointer demangling.

Reviewed By: dvyukov

Differential Revision: https://reviews.llvm.org/D105629
2021-07-15 12:18:48 +02:00
LLVM GN Syncbot 9805afdfea [gn build] Port b0d38ad0bc 2021-07-15 07:50:35 +00:00
LLVM GN Syncbot 8b426bdaf1 [gn build] Port b9c3941cd6 2021-07-15 01:12:36 +00:00
Djordje Todorovic df686842bc [RemoveRedundantDebugValues] Add a Pass that removes redundant DBG_VALUEs
This new MIR pass removes redundant DBG_VALUEs.

After the register allocator is done, more precisely, after
the Virtual Register Rewriter, we end up having duplicated
DBG_VALUEs, since some virtual registers are being rewritten
into the same physical register as some of existing DBG_VALUEs.
Each DBG_VALUE should indicate (at least before the LiveDebugValues)
variables assignment, but it is being clobbered for function
parameters during the SelectionDAG since it generates new DBG_VALUEs
after COPY instructions, even though the parameter has no assignment.
For example, if we had a DBG_VALUE $regX as an entry debug value
representing the parameter, and a COPY and after the COPY,
DBG_VALUE $virt_reg, and after the virtregrewrite the $virt_reg gets
rewritten into $regX, we'd end up having redundant DBG_VALUE.

This breaks the definition of the DBG_VALUE since some analysis passes
might be built on top of that premise..., and this patch tries to fix
the MIR with the respect to that.

This first patch performs bacward scan, by trying to detect a sequence of
consecutive DBG_VALUEs, and to remove all DBG_VALUEs describing one
variable but the last one:

For example:

(1) DBG_VALUE $edi, !"var1", ...
(2) DBG_VALUE $esi, !"var2", ...
(3) DBG_VALUE $edi, !"var1", ...
 ...

in this case, we can remove (1).

By combining the forward scan that will be introduced in the next patch
(from this stack), by inspecting the statistics, the RemoveRedundantDebugValues
removes 15032 instructions by using gdb-7.11 as a testbed.

Differential Revision: https://reviews.llvm.org/D105279
2021-07-14 04:29:42 -07:00
LLVM GN Syncbot 90e7f5d259 [gn build] Port c08dabb0f4 2021-07-14 10:49:08 +00:00
Nico Weber aff0954577 [gn build] (manually) merge 462d4de35b 2021-07-14 06:43:23 -04:00
Nico Weber 3ea8860afb [gn build] (manually) port 303ddb60a2 2021-07-13 15:15:38 -04:00
Fangrui Song 46580d43fc [llvm-readobj] Switch command line parsing from llvm::cl to OptTable
Users should generally observe no difference as long as they don't use
unintended option forms. Behavior changes:

* `-t=d` is removed. Use `-t d` instead.
* `--demangle=false` and `--demangle=0` cannot be used. Omit the option or use `--no-demangle`. Other flag-style options don't have `--no-` forms.
* `--help-list` is removed. This is a `cl::` specific option.
* llvm-readobj now supports grouped short options as well.
* `--color` is removed. This is generally not useful (only apply to errors/warnings) but was inherited from Support.

Some adjustment to the canonical forms
(usually from GNU readelf; currently llvm-readobj has too many redundant aliases):

* --dyn-syms is canonical. --dyn-symbols is a hidden alias
* --file-header is canonical. --file-headers is a hidden alias
* --histogram is canonical. --elf-hash-histogram is a hidden alias
* --relocs is canonical. --relocations is a hidden alias
* --section-groups is canonical. --elf-section-groups is a hidden alias

OptTable avoids global option collision if we decide to support multiplexing for binary utilities.

* Most one-dash long options are still supported. `-dt, -sd, -st, -sr` are dropped due to their conflict with grouped short options.
* `--section-mapping=false` (D57365) is strange but is kept for now.
* Many `cl::opt` variables were unnecessarily external. I added `static` whenever appropriate.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D105532
2021-07-12 10:14:42 -07:00
Nico Weber eecd5d0aa8 [gn build] port 0da172b176 more 2021-07-12 08:50:18 -04:00
Nico Weber 0c6fad233a [gn build] (semi-manually) port 0da172b176 2021-07-12 08:15:59 -04:00
Nico Weber c82b96c0a4 [gn build] fix formatting after 9647a6f719 2021-07-09 19:04:46 -04:00
Wouter van Oortmerssen 9647a6f719 [WebAssembly] Added initial type checker to MC Assembler
This to protect against non-sensical instruction sequences being assembled,
which would either cause asserts/crashes further down, or a Wasm module being output that doesn't validate.

Unlike a validator, this type checker is able to give type-errors as part of the parsing process, which makes the assembler much friendlier to be used by humans writing manual input.

Because the MC system is single pass (instructions aren't even stored in MC format, they are directly output) the type checker has to be single pass as well, which means that from now on .globaltype and .functype decls must come before their use. An extra pass is added to Codegen to collect information for this purpose, since AsmPrinter is normally single pass / streaming as well, and would otherwise generate this information on the fly.

A `-no-type-check` flag was added to llvm-mc (and any other tools that take asm input) that surpresses type errors, as a quick escape hatch for tests that were not intended to be type correct.

This is a first version of the type checker that ignores control flow, i.e. it checks that types are correct along the linear path, but not the branch path. This will still catch most errors. Branch checking could be added in the future.

Differential Revision: https://reviews.llvm.org/D104945
2021-07-09 14:07:25 -07:00
Fangrui Song 47db32e542 [llvm-size] Switch command line parsing from llvm::cl to OptTable
Part of https://lists.llvm.org/pipermail/llvm-dev/2021-July/151622.html
"Binary utilities: switch command line parsing from llvm::cl to OptTable"

* `--totals=false` and `--totals=0` cannot be used. Omit the option.
* `--help-list` is removed. This is a `cl::` specific option.

OptTable avoids global option collision if we decide to support multiplexing for binary utilities.

Note: because the tool is simple, and its long options are uncommon, I just drop
the one-dash forms except `-arch <value>` (Darwin style).

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D105598
2021-07-09 10:26:53 -07:00
LLVM GN Syncbot 214f63b272 [gn build] Port 0e09a41b41 2021-07-09 17:14:37 +00:00
Fangrui Song 48de8bb0d3 [llvm-cxxfilt] Switch command line parsing from llvm::cl to OptTable
Similar to D104889. The tool is very simple and its long options are uncommon,
so just drop the one-dash form in this patch.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D105605
2021-07-09 10:10:45 -07:00
LLVM GN Syncbot 87e41cc4b6 [gn build] Port 321c2ea91c 2021-07-08 15:35:54 +00:00