freebsd-src/contrib
Dimitry Andric 2390e2073f Apply clang fix for assertion failure building putty 0.77 on i386
Merge commit 45084eab5e63 from llvm git (by Arthur Eubanks):

  [clang] Fix some clang->llvm type cache invalidation issues

  Take the following as an example

    struct z {
      z (*p)();
    };

    z f();

  When we attempt to get the LLVM type of f, we recurse into z. z itself
  has a function pointer with the same type as f. Given the recursion,
  Clang simply treats z::p as a pointer to an empty struct `{}*`. The
  LLVM type of f is as expected. So we have two different potential
  LLVM types for a given Clang type. If we store one of those into the
  cache, when we access the cache with a different context (e.g. we
  are/aren't recursing on z) we may get an incorrect result. There is some
  attempt to clear the cache in these cases, but it doesn't seem to handle
  all cases.

  This change makes it so we only use the cache when we are not in any
  sort of function context, i.e. `noRecordsBeingLaidOut() &&
  FunctionsBeingProcessed.empty()`, which are the cases where we may
  decide to choose a different LLVM type for a given Clang type. LLVM
  types for builtin types are never recursive so they're always ok.

  This allows us to clear the type cache less often (as seen with the
  removal of one of the calls to `TypeCache.clear()`). We
  still need to clear it when we use a placeholder type then replace it
  later with the final type and other dependent types need to be
  recalculated.

  I've added a check that the cached type matches what we compute. It
  triggered in this test case without the fix. It's currently not
  check-clang clean so it's not on by default for something like expensive
  checks builds.

  This change uncovered another issue where the LLVM types for an argument
  and its local temporary don't match. For example in type-cache-3, when
  expanding z::dc's argument into a temporary alloca, we ConvertType() the
  type of z::p which is `void ({}*)*`, which doesn't match the alloca GEP
  type of `{}*`.

  No noticeable compile time changes:
  https://llvm-compile-time-tracker.com/compare.php?from=3918dd6b8acf8c5886b9921138312d1c638b2937&to=50bdec9836ed40e38ece0657f3058e730adffc4c&stat=instructions

  Fixes #53465.

  Reviewed By: rnk

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

PR:		264318
Reported by:	mandree
MFC after:	3 days

(cherry picked from commit 6a5eebc190)
2022-05-30 20:28:39 +02:00
..
apr apr: Merge r1889604, r1807975 from trunk: 2021-09-13 10:39:43 -04:00
apr-util
atf Import atf 0.22 snapshot ca73d08c3fc1ecffc1f1c97458c31ab82c12bb01 2021-03-17 12:21:06 +00:00
bc contrib/bc: MFC version 5.2.2 2022-03-04 21:19:50 +01:00
bearssl
blacklist
bmake Merge bmake-20220208 2022-02-15 21:37:08 -08:00
bsnmp bsnmp: Fix two typos in error messages 2022-02-02 09:49:53 +01:00
byacc byacc: fix UBSan signed shift range error 2020-09-23 12:54:42 +00:00
bzip2 Remove FREEBSD-vendor files 2021-12-12 19:29:46 -05:00
capsicum-test capsicum-test: Update for O_BENEATH removal 2021-03-17 22:22:50 +00:00
com_err
cortex-strings
dialog
diff Fix macro-redefined warning in gnu/diff for fputc_unlocked 2021-01-19 21:23:25 +00:00
dma dma: limit lines to 998 characters 2022-02-05 11:26:39 -05:00
ee ee(1): Whitespace cleanup 2020-12-10 10:58:30 +00:00
elftoolchain x86: Add a NT_X86_SEGBASES register set. 2022-05-13 09:45:19 -07:00
expat MFC cc68614, ac69e5d, 7ed8e14: Update contrib/expat to 2.4.7. 2022-03-31 21:38:29 -07:00
file file: upgrade to 5.41. 2022-01-17 16:43:58 -08:00
flex contrib/flex: Drop local __dead2 patch 2021-05-11 09:39:29 +01:00
gdtoa
googletest Re-enable disabled googletest-port-test tests after r363820 2020-08-04 02:20:15 +00:00
hyperv/tools
ipfilter ipfilter: Move userland bits to sbin 2022-02-07 05:51:14 -08:00
jemalloc powerpc: enable initial-exec TLS 2022-03-08 01:28:33 +01:00
kyua
ldns
ldns-host
less less: upgrade to v590. 2021-08-02 01:28:42 -07:00
lib9p Import lib9p 9d5aee77bcc1bf0e79b0a3bfefff5fdf2146283c. 2020-10-03 18:52:54 +00:00
libarchive libarchive: import changes from upstream 2022-05-03 14:30:52 +02:00
libbegemot
libc-pwcache
libc-vis vis(3): avoid out-of-bounds stack buffer reads 2021-07-05 10:46:11 +01:00
libcbor Import libcbor at 'contrib/libcbor/' 2022-02-09 16:23:53 -05:00
libcxxrt libcxxrt: Insert padding in __cxa_dependent_exception 2022-04-27 11:29:15 -04:00
libdivsufsort
libedit libedit: vendor import libedit 2021-03-28 2021-05-05 09:21:54 +02:00
libevent
libexecinfo Pull in fix from upstream NetBSD rev. 1.5: 2020-09-21 16:43:38 +00:00
libfido2 libfido2: Address CHERI compatibility 2022-02-09 16:23:53 -05:00
libpcap
libucl Fix build post a040967612. 2021-05-05 10:42:57 +02:00
libxo
llvm-project Apply clang fix for assertion failure building putty 0.77 on i386 2022-05-30 20:28:39 +02:00
lua contrib/lua: update to 5.4.2 2021-01-13 23:56:18 -06:00
lutok
mandoc flua: Add a libjail module 2020-10-24 17:08:59 +00:00
mknod
mtree fts_read: Handle error from a NULL return better. 2020-12-08 23:38:26 +00:00
ncurses ncurses: Apply a tputs() fix from patch 20210403 2021-08-13 21:13:16 -04:00
netbsd-tests time_t is pathological: use %j + cast to print it. 2022-03-02 17:39:34 -06:00
netcat Remove FREEBSD-vendor files 2021-12-12 19:29:46 -05:00
ngatm
ntp ntp: Revert "Disable ntpd stack gap. When ASLR with STACK GAP != 0 ntpd suffers SIGSEGV." 2022-01-03 15:04:05 -08:00
nvi import nvi 2.2.0-3bbdfe4 2021-09-22 12:07:48 +02:00
ofed Make CPU_SET macros compliant with other implementations 2022-01-14 18:17:30 +02:00
one-true-awk awk: remove proctab.c 2021-07-31 08:14:43 -06:00
openbsm close_range: add audit support 2021-03-17 22:22:48 +00:00
opencsd/decoder
openpam Merge upstream r948: fix race condition in openpam_ttyconv(3). 2020-11-19 05:46:59 +00:00
openresolv
opie
pam_modules/pam_passwdqc
pf ftp-proxy: Revert incorrect migration to libpfctl 2021-07-08 08:46:54 +02:00
pjdfstest
pnglite pnglite: should use ntohl 2021-01-12 00:56:35 +02:00
pnpinfo
processor-trace
sendmail Key decleration of union semun on src version 2020-10-26 17:52:28 +00:00
serf serf: Fix the default return value of the BIO control method. 2021-02-08 14:38:59 -08:00
smbfs
sqlite3 sqlite3: Vendor import of sqlite3 3.37.2 2022-02-06 20:58:39 -08:00
subversion Update Subversion to 1.14.1 LTS. See contrib/subversion/CHANGES for a 2021-02-18 21:03:57 +01:00
tcp_wrappers tcp_wrappers: remove duplicate errno declarations 2022-03-22 19:33:33 +01:00
tcpdump pf: Introduce ridentifier 2021-11-26 04:39:05 +01:00
tcsh tcsh: update to version 6.22.04. 2021-06-02 08:33:36 +03:00
telnet Set stdout & stderr unbuffered, so that the "telnet>" prompt 2020-12-29 21:05:48 +00:00
terminus contrib/terminus: update to terminus-font-4.49.1 2022-02-02 17:56:00 +02:00
tnftp
traceroute ping: fix some man pages and tests after r368045 2020-11-26 04:55:02 +00:00
tzcode ctime.3: Add a cross-reference to clock_gettime(2) 2022-03-11 11:05:47 +01:00
tzdata contrib/tzdata: import tzdata 2022a 2022-03-21 23:26:58 +08:00
unbound unbound: Vendor import 1.15.0 2022-03-07 05:32:58 -08:00
unvis
vis
wpa wpa: Correctly call pcap_next_ex() 2022-04-14 06:48:11 -07:00
xz