From owner-svn-src-vendor@FreeBSD.ORG Tue Jan 27 01:39:43 2015 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99C39B58; Tue, 27 Jan 2015 01:39:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6AA5D2EA; Tue, 27 Jan 2015 01:39:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0R1dhb0097296; Tue, 27 Jan 2015 01:39:43 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0R1dhs3097293; Tue, 27 Jan 2015 01:39:43 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201501270139.t0R1dhs3097293@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 27 Jan 2015 01:39:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r277782 - vendor/tcpdump/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jan 2015 01:39:43 -0000 Author: pfg Date: Tue Jan 27 01:39:42 2015 New Revision: 277782 URL: https://svnweb.freebsd.org/changeset/base/277782 Log: Merge some cherry-picked fixes originating in OpenBSD Check whether the version field is available before looking at it. While we're at it, use ND_TCHECK(), rather than a hand-rolled check, to check whether we have the full fixed-length portion of the IPv4 header. commit c67afe913011138a2504ec4d3d423b48e73b12f3 Do more length checking. From OpenBSD. commit d7516761f9c4877bcb05bb6543be3543e165249 Modified: vendor/tcpdump/dist/print-ip.c vendor/tcpdump/dist/print-sl.c Modified: vendor/tcpdump/dist/print-ip.c ============================================================================== --- vendor/tcpdump/dist/print-ip.c Mon Jan 26 23:45:10 2015 (r277781) +++ vendor/tcpdump/dist/print-ip.c Tue Jan 27 01:39:42 2015 (r277782) @@ -529,6 +529,7 @@ ip_print(netdissect_options *ndo, struct protoent *proto; ipds->ip = (const struct ip *)bp; + ND_TCHECK(ipds->ip->ip_vhl); if (IP_V(ipds->ip) != 4) { /* print version if != 4 */ ND_PRINT((ndo, "IP%u ", IP_V(ipds->ip))); if (IP_V(ipds->ip) == 6) @@ -537,10 +538,7 @@ ip_print(netdissect_options *ndo, else if (!ndo->ndo_eflag) ND_PRINT((ndo, "IP ")); - if ((u_char *)(ipds->ip + 1) > ndo->ndo_snapend) { - ND_PRINT((ndo, "%s", tstr)); - return; - } + ND_TCHECK(*ipds->ip); if (length < sizeof (struct ip)) { ND_PRINT((ndo, "truncated-ip %u", length)); return; @@ -669,6 +667,11 @@ ip_print(netdissect_options *ndo, ND_PRINT((ndo, " ip-proto-%d", ipds->ip->ip_p)); } } + return; + +trunc: + ND_PRINT((ndo, "%s", tstr)); + return; } void Modified: vendor/tcpdump/dist/print-sl.c ============================================================================== --- vendor/tcpdump/dist/print-sl.c Mon Jan 26 23:45:10 2015 (r277781) +++ vendor/tcpdump/dist/print-sl.c Tue Jan 27 01:39:42 2015 (r277782) @@ -62,7 +62,7 @@ sl_if_print(netdissect_options *ndo, register u_int length = h->len; register const struct ip *ip; - if (caplen < SLIP_HDRLEN) { + if (caplen < SLIP_HDRLEN || length < SLIP_HDRLEN) { ND_PRINT((ndo, "%s", tstr)); return (caplen); } From owner-svn-src-vendor@FreeBSD.ORG Wed Jan 28 22:55:08 2015 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 62834737; Wed, 28 Jan 2015 22:55:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48384EF0; Wed, 28 Jan 2015 22:55:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0SMt8Nh010949; Wed, 28 Jan 2015 22:55:08 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0SMt7gd010940; Wed, 28 Jan 2015 22:55:07 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201501282255.t0SMt7gd010940@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 28 Jan 2015 22:55:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r277863 - in vendor/amd/dist: . amd amq conf contrib doc fixmount fsinfo hlfsd include libamu mk-amd-map scripts wire-test X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jan 2015 22:55:08 -0000 Author: pfg Date: Wed Jan 28 22:55:06 2015 New Revision: 277863 URL: https://svnweb.freebsd.org/changeset/base/277863 Log: amd: flatten the tree Added: vendor/amd/dist/AUTHORS - copied unchanged from r277862, vendor/amd/dist/contrib/amd/AUTHORS vendor/amd/dist/BUGS - copied unchanged from r277862, vendor/amd/dist/contrib/amd/BUGS vendor/amd/dist/COPYING - copied unchanged from r277862, vendor/amd/dist/contrib/amd/COPYING vendor/amd/dist/ChangeLog - copied unchanged from r277862, vendor/amd/dist/contrib/amd/ChangeLog vendor/amd/dist/FAQ - copied unchanged from r277862, vendor/amd/dist/contrib/amd/FAQ vendor/amd/dist/INSTALL - copied unchanged from r277862, vendor/amd/dist/contrib/amd/INSTALL vendor/amd/dist/MIRRORS.html - copied unchanged from r277862, vendor/amd/dist/contrib/amd/MIRRORS.html vendor/amd/dist/MIRRORS.txt - copied unchanged from r277862, vendor/amd/dist/contrib/amd/MIRRORS.txt vendor/amd/dist/NEWS - copied unchanged from r277862, vendor/amd/dist/contrib/amd/NEWS vendor/amd/dist/README - copied unchanged from r277862, vendor/amd/dist/contrib/amd/README vendor/amd/dist/README.attrcache - copied unchanged from r277862, vendor/amd/dist/contrib/amd/README.attrcache vendor/amd/dist/README.ldap - copied unchanged from r277862, vendor/amd/dist/contrib/amd/README.ldap vendor/amd/dist/README.y2k - copied unchanged from r277862, vendor/amd/dist/contrib/amd/README.y2k vendor/amd/dist/TODO - copied unchanged from r277862, vendor/amd/dist/contrib/amd/TODO vendor/amd/dist/amd/ - copied from r277862, vendor/amd/dist/contrib/amd/amd/ vendor/amd/dist/amq/ - copied from r277862, vendor/amd/dist/contrib/amd/amq/ vendor/amd/dist/aux_conf.h.in - copied unchanged from r277862, vendor/amd/dist/contrib/amd/aux_conf.h.in vendor/amd/dist/bootstrap - copied unchanged from r277862, vendor/amd/dist/contrib/amd/bootstrap vendor/amd/dist/conf/ - copied from r277862, vendor/amd/dist/contrib/amd/conf/ vendor/amd/dist/cvs-server.txt - copied unchanged from r277862, vendor/amd/dist/contrib/amd/cvs-server.txt vendor/amd/dist/doc/ - copied from r277862, vendor/amd/dist/contrib/amd/doc/ vendor/amd/dist/fixmount/ - copied from r277862, vendor/amd/dist/contrib/amd/fixmount/ vendor/amd/dist/fsinfo/ - copied from r277862, vendor/amd/dist/contrib/amd/fsinfo/ vendor/amd/dist/hlfsd/ - copied from r277862, vendor/amd/dist/contrib/amd/hlfsd/ vendor/amd/dist/include/ - copied from r277862, vendor/amd/dist/contrib/amd/include/ vendor/amd/dist/ldap-id.ms - copied unchanged from r277862, vendor/amd/dist/contrib/amd/ldap-id.ms vendor/amd/dist/ldap-id.txt - copied unchanged from r277862, vendor/amd/dist/contrib/amd/ldap-id.txt vendor/amd/dist/ldap.schema - copied unchanged from r277862, vendor/amd/dist/contrib/amd/ldap.schema vendor/amd/dist/libamu/ - copied from r277862, vendor/amd/dist/contrib/amd/libamu/ vendor/amd/dist/mk-amd-map/ - copied from r277862, vendor/amd/dist/contrib/amd/mk-amd-map/ vendor/amd/dist/scripts/ - copied from r277862, vendor/amd/dist/contrib/amd/scripts/ vendor/amd/dist/tasks - copied unchanged from r277862, vendor/amd/dist/contrib/amd/tasks vendor/amd/dist/vers.m4 - copied unchanged from r277862, vendor/amd/dist/contrib/amd/vers.m4 vendor/amd/dist/wire-test/ - copied from r277862, vendor/amd/dist/contrib/amd/wire-test/ Deleted: vendor/amd/dist/contrib/ Copied: vendor/amd/dist/AUTHORS (from r277862, vendor/amd/dist/contrib/amd/AUTHORS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/amd/dist/AUTHORS Wed Jan 28 22:55:06 2015 (r277863, copy of r277862, vendor/amd/dist/contrib/amd/AUTHORS) @@ -0,0 +1,430 @@ +PRIMARY AUTHORS AND MAJOR CONTRIBUTORS TO AM_UTILS: +Original authors of amd were the Berkeley team and especially Jan-Simon +Pendry. Since then many people have contributed patches. + +This file lists the ones who contributed major code changes, in no +particular order, and I thank them all. This is of course not to diminish +the smaller contributes of the many others. Thank you all. + +* Erez Zadok + +The most significant changes were made by Erez Zadok in terms of bug fixes, +ports, and new features added. Erez Zadok is the current maintainer of +am-utils, as of January 1997. + +* Ion Badulescu + +Co-maintainer of am-utils since late 1999: Linux and Solaris autofs support, +Linux NFSv3 support, major code reorganization, etc... + +* Randall S. Winchester + +May 7, 1997: contributed a special version of upl102 that included NFS V.3 +support. Some of the code was contributed by Christos Zoulas +. I (Erez) ported these changes to am-utils. + +September 12, 1997: lots of small prototype cleanups and fixes to numerous +files. + +January 27, 1998: support pid files in the amd.conf file. Provide base name +for hesiod zone files. Always use /etc/amd.conf if exists. + +August 8, 1998: add detection support for NFS V.3 for NetBSD 1.3F. + +February 1, 1998: fixes for NetBSD to better detect its features. + +September 4, 1999: assorted fixes for NetBSD 1.4+. + +* Hannes Reinecke + +Back in 1995, contributed code for linux. A new parser for file system +specific options that only exist under linux. + +* Leif Johansson + +June 22, 1997: minor patch to ensure that systems without an RE library work. + +June 23, 1997: mount options should be properly comma limited. + +July 10, 1997: info_ldap.c and prototype changes to all map _init and _mtime +functions. Contributed scripts/amd2ldif.pl. + +August 4, 1997: info_ldap.c fixes and adding two new amd.conf ldap +variables: ldap_cache_seconds and ldap_cache_maxmem. + +* Andreas Stolcke + +June 22, 1997: patches to ensure that proto= and vers= options work +properly in mount tables and can be overridden. Later on, more code +contribued to optimize the best combination of proto/vers. + +July 4, 1997: patches to get NFS V.3 working under irix5. + +September 9, 1997: initialize all fields of mntent_t structures to 0. + +October 2, 1997: don't log an RPC timeout as an error but only as an info +message. + +December 19, 1997: detected an FMR (Free Memory Read) in amd/mntfs.c, +uninit_mntfs(). + +* Danny Braniss + +July, 6 1997: contributed patches to hesiod on bsdi3. + +* Tom Schmidt + +July 10, 1997: Recommdation to include libgdbm if libc has no dbm_open. +Patches for netgrp(host) command. Mods to aux/config.guess to recognize +sun3. + +January 19, 1998: print correct -l option depending if system supports +syslog and/or syslog facilities. + +January 29, 1998: fix for 0.0.0.0 loopback on SunOS 3.X which defines +IFF_ROUTE instead of IFF_LOOPBACK. + +May 30, 2000: correct logging types for addopts/mergeopts messages. + +* Daniel S. Riley + +July 11, 1997: fixes to DU-4.0 to support string POSIX.1 signals, and struct +sockaddr with sa_len field. + +July 13, 1997: Move amd.conf parsing to before switch_option() on log/debug +options. Minor type wrt "ro" option in libamu/mount_fs.c. Added more +fillers of mnttab options, for acdirmax, acdirmin, acregmax, acregmin, noac, +grpid, nosuid, and actimo. + +August 15, 1998: fix memory leak in processing of /defaults, and avoid +accessing uninitialized memory in osf1. + +* Roman Hodek + +July 23, 1997: Got lots of patches from the Debian Linux folks, who fixed +several generic bugs, and one serious one for Linux. The latter involved +using connected sockets for NFS mounts on kernels 1.3.10 and older. Roman's +work is baed on amd-upl102, and work from Ian Murdock +and Dominik Kubla . + +* Rainer Orth + +August 6, 1997: assorted fixes to support hesiod-1.3, solaris 2.4 (which I +already fixed but did not release yet), and support for $LDFLAGS at +configure/compile time. + +February 24, 1998: lots of patches for ultrix 4.3 port. + +February 28, 1998: lots of documentation fixes! + +January 8, 1999: texi fixes, and more Ultrix 4.3 fixes, among others. + +January 11, 1999: hesiod_isup function. Fix format errors in dlog/plog. +Remove obsolete or unnecessary files/macros. Don't report disabled file +systems. More misc fixes. + +February 3, 1998: don't start autofs listener unless autofs maps were in +use. + +December 10, 1999: assorted fixed and lots of fixes to support in-kernel +mount tables in Solaris 8. + +February 9, 2000: new debug options hrtime (hi-res timer) and xdrtrace. bug +fixes. + +* Jason Thorpe + +August 25, 1997: make amd work when talking to NIS+ servers in NIS +compatibility mode. Fix originally came from Matthieu Herrb +. + +* Chris Metcalf + +August 29, 1997: patch to make amd use FQHN for NFS/RPC authentication, +useful esp. for cross-domain NFS mounts. +September 2, 1997: if plock() succeeded, don't display errno string. + +* Enami Tsugutomo + +September 4, 1997: don't ping remote servers with NFS V.3 always, but V.2, +regardless of client's NFS version. (conf/transp/transp_sockets.c) + +* Dan Riley + +September 19, 1997: make sure that amd works with more secure portmappers +that do not allow forwarding of RPC messages to other services. + +* Wolfgang Rupprecht + +August 10, 1997: netbsd and other bsd systems have a mask flag for +pcfs_args (msdos mount). + +* Christos Zoulas + +September 25, 1997: fix to initialize uid/gid fields of pcfs_args_t on +netbsd. + +October 10, 1997: compile time cleanups of printf()s in hlfsd code. If nfs +server is down or does not support a portmapper call, then mark it down as +version 2, and try again later. + +November 29, 2002: compile fixes for NetBSD, a couple of bug fixes (one +already fixed by maintainers) + +April 12, 2003: support new "unmount" option, useful to timeout removable +local media mounts. + +October 12, 2004: patch to support two new amd.conf options, domain_strip +and auto_attrcache. Patch to cleanup NFS attribute-cache flag computation. +Patch to fix an inconsistency in timeouts in the RPC code between socket and +TLI implementations. Patch to print version string (amd -v) after all +options had been initialized, so we can print domain, host, and hostd. +Linux patch to use umount2(2) if umount(2) fails. + +* Bill Paul + +November 5, 1997: NFS v.3 support for AIX 4.2.1, which does *not* include +headers for this. Bill had to guess at the right structures, field names, +sizes, alignment, etc. + +January 15, 1999: small ldap bug fixes. + +* Stefan Vogel + +November 14, 1997: typo in the subscription instructions to amd-dev. + +* Guntram Wolski + +November 15, 1997: pointed out mismatching documentation for the -o option. + +* Michael Hucka + +January 11, 1997: pointed out reversed definition of NFS mount options vers +and proto. + +* Albert Chin + +January 12, 1998: minor bug in output of amd -H. + +June 23, 2005: assortment of small compile bugs on aix4, and solaris 5/6/7. + +* Thomas Richter + +January 13, 1998: use case insensitive comparisons for variables that need +it (such as all hostname related ones, and more). + +July 20, 1998: don't leak memory in the private version of yp_all (when +vendor yp_all is bad). + +* Fred Korz + +January 30, 1998: minor typo fixed to tftp example in am-utils.texi. + +* Donald Buczek + +March 6, 1998: correctly inherit existing NFS V.3 mounts upon restart. + +March 17, 1998: compare log file name and syslog string with correct length. + +March 20, 1998: do not close stdout in case it gets reused elsewhere and to +allow startup script to redirect it. Set a temporary secure umask(0022) +before writing log file and restore it afterwards. + +* Matthew Crosby + +April 20, 1998: allow arbitrary number of interfaces in wire listing. + +* David O'Brien + +September 4, 1998: bug fix to avoid overrunning hostname buffer, and minor +amd.conf man page typo correction. + +September 22, 1999: use more secure vsnprintf in real_plog(). + +* Danny Rathjens + +October 29, 1998: swap arguments to kill(2) in amd.c. + +* Mike Mitchell + +November 3, 1998: amd/nfs_subr.c (nfsproc_lookup_2_svc): try to avoid a race +condition between unmounting and re-mounting an entry, by increasing the ttl +of a looked up entry before unmounting it. + +* Douglas K. Rand" + +December 3, 1998: case insensitive host name match for nfsl. + +* David Wolfskill +January 28, 1999: don't turn on/off noconn option if it was already in that +state. + +* Jeffrey C Honig +March 14, 1999: clean up more autogenerated files upon "make distclean". + +March 15, 1999: avoid overly verbose NIS warning even on systems that don't +run NIS. On BSD systems, wire.c uses getifaddrs(), sysctl(), IRS routines, +and more fixes. Numerous IP packet security fixes. + +March 16, 1999: documentation typos. new cdfs options. ufs structure +detection for bsdi4. + +September 17, 1999: fixes to expn. + +* Paul Balyoz +March 26, 1999: ensure lostaltmail displays Y2K compliant dates. + +* Jon Peatfield +March 30, 1999: turn off incomplete NFS V.3 support in HPUX 10.20. + +September 22, 1999: safe reloading of maps without first clearing old +copies, and using cached copies if map failed to reload. + +* Peter Breitenlohner +July 24, 1999: patch for linux 2.2.x to work with older libc5 systems, and +nis_isup mis-logic fixes. +December 13, 2001: report typos in scripts/amd.conf.5. + +* Dale Talcott +July 26, 1999: added NFS3 support for AIX mounting. + +* Christophe Kalt +July 14, 1999: add netgrpd() syntax function which uses FQHN. + +* Andrew J. Korty +September 5, 1999: pawd works for type:=nfsl. + +* Nick Williams +September 1, 1999: bug fix for incorrect symlinks when two locations are +requested simultaneously. + +November 1, 1999: fixes to sync maps even if they are set to mapcache:=sync. + +January 19, 2000: fix (and reduce the incidence of) stale file handles when +doing rapid mounts and umounts in succession. + +June 5, 2000: better handling of potential race-conditions during rapid +u/mounts. Correctly update d_drops stats for amq -s. + +* Johann Pfefferl +November 16, 1999: fix to ldap code so repeated calls to string2he don't +corrupt the string passed. + +* Amitha Perera +December 9, 1999: detect all wire() interfaces correctly. + +* Steven Danz +January 25, 2000: allow browsable auto maps. + +* Wolfram Klaus . +November 21, 2000: recognize proplist mnttab flag. + +* Thomas Klausner +November 21, 2000: lots of NetBSD fixes (many of which are generic). + +April 18, 2003: patch to reference am-utils info pages in man page. + +November 28, 2004: small fixes to typos in amd.conf(5) man page. + +* Olaf Kirch +February 1, 2001: important Linux NFS error number mapping fixed + +* Ahmon Dancy +February 9, 2001: Apple Rhapsody/Darwin/OS X port + +* Sebastien Bahloul +July 3, 2001: LDAP fixes and updates to support new APIs + +March 27, 2002: LDAP bug and port to HPUX-11. + +* Philippe Troin +July 12, 2001: Proper handling of GNU getopt, support for optionally +disabling LDAP/Hesiod, fixes for the dev/nodev option on Linux. Texi +documentation fix. + +November 28, 2001: Bug fix. Support "nolock" as an NFS option, not a +generic mount option. + +July 17, 2003: pref:=null core dump fix. libgdbm portability. tcpd/librap +support. And a few other things for the 6.0 branch. + +* Trond Myklebust +January 10, 2002: Proper initialization of the timeo parameter on Linux, TCP +_must_ have a timeout 2 orders of magnitude larger than UDP + +* George Ross +April 29, 2002: Rework of old code, support for wildcards in LDAP queries, +and an FD leak fix. Amd -A support. + +October 21, 2002: ldap_unbind fix for SIGPIPE, and support for LDAPv3 +protocol version parameter (with Tim Colles ). + +* Matthias Scheler +June 14, 2002: patch to use "xlatecookie" NFS mount option. + +* Jun-ichiro itojun Hagino . +June 11, 2002: minor fixes to support NetBSD 1.6A. + +* Sean Fagan +March 14, 2003: detect and use the MNT2_GEN_OPT_AUTOMNTFS mount flag +on OS X / Darwin. + +* Hendrik Scholz +June 9, 2003: mk-amd-map should open temp db file using O_EXCL. + +* Mark Davies +July 14, 2003: define "xlatecookie" mnttab option if not defined (for +NetBSD). Support null hesiod entries if they start with a ".". + +* Eric S. Raymond +December 9, 2003: fix unbalanced [] typo in fsinfo man page. + +* Martin Blapp +July 6, 2004: recognize fields in pcfs_args_t in FreeBSD 5. + +* Dan Nelson +August 2, 2004: pawd to recognize "host" type mounts. + +* Hauke Fath +August 3, 2004: pawd to recognize "linkx" type mounts. + +* Michael van Elst +September 1, 2004: bug fix to avoid race condition in calls to mntctl on +AIX. + +* Jonathan Chen +October 22, 2004: patch/fix to move mlock/mlockall/plock code after the +fork(). +June 29, 2005: core dump going off end of exported_ap[] array. +September 29, 2005: patch/fix for pawd not to go into an infinite loop. +October 25, 2005: patch/fix for pawd to repeatedly resolve path. + +* David Rage +January 17, 2005: prevent Amd from logging 'Read-only filesystem' errors +when the mount point has an ancestor (i.e. '/') that is mounted read-only. + +* Kevin Layer +January 28, 2005: basic instructions how to setup Amd on Mac OS-X. + +* Dan Ottavio +March 2, 2005: new global amd.conf option debug_mtab_file, to set the debug +mtab file when using debug_options=mtab. Default has changed from "./mtab" +to "/tmp/mtab" to avoid security problem. Bug fixed to ensure that Amd +terminates properly even mtab file doesn't exist. + +* Erik Kline +January 3, 2005: implementation of executable maps for Amd. + +* Jim Zajkowski +March 14, 2005: small patch to amd2ldif. + +* Adam Morley +January 27, 2005: synchronize what amd2ldif does vs. what the ldap.schema +expects. + +* Graeme Wilford +July 4, 2005: buffer overflow in pawd. + +* Steve Plite +September 22, 2005: repair reversed meaning of D_AMQ, so amq will unregister +on exit. Copied: vendor/amd/dist/BUGS (from r277862, vendor/amd/dist/contrib/amd/BUGS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/amd/dist/BUGS Wed Jan 28 22:55:06 2015 (r277863, copy of r277862, vendor/amd/dist/contrib/amd/BUGS) @@ -0,0 +1,303 @@ + LIST OF KNOWN BUGS IN AM-UTILS OR OPERATING SYSTEMS + +Note: report am-utils bugs via Bugzilla to https://bugzilla.am-utils.org/ or +by email to the am-utils@am-utils.org mailing list. + + +(1) mips-sgi-irix* + +[1A] known to have flaky NFS V.3 and TCP. Amd tends to hang or spin +infinitely after a few hours or days of use. Users must install recommended +patches from vendor. Patches help, but not all the time. Otherwise avoid +using NFS V.3 and TCP on these systems, by setting + + /defaults opts:=vers=2,proto=udp + +[1B] yp_all() leaks a file descriptor. Eventually amd runs out of file +descriptors and hangs. Am-utils circumvents this by using its own version +of yp_all which uses udp and iterates over NIS maps. The latter isn't as +reliable as yp_all() which uses TCP, but it is better than hanging. + +(I have some reports that older version of hpux-9, with older libc, also +leak file descriptors.) + +[1C] SGI's MIPSpro C compiler on IRIX 6 has the unfortunate habit of +creating code specificially for the machine it runs on. The ABI and ISA +used depend very much on the OS version and compiler release used. This +means that the resulting amd binary won't run on machines different from +the build host, particularly older ones. Older versions of am-utils +enforced the O32 ABI when compiling with cc to work around this, but this +ABI is deprecated in favor of the N32 ABI now, so we use -n32 -mips3 to +ensure that the binaries run on every host capable of running IRIX 6 at +all. If this is not appropriate for you, configure with something like +CC='cc -64' instead to get the desired ABI and ISA. + +(2) alpha-unknown-linux-gnu (RedHat Linux 4.2) + +hasmntopt(mnt, opt) can go into an infinite loop if opt is any substring +of mnt->mnt_opts. Redhat 5.0 does not have this libc bug. Here is an +example program: + +#include +#include +main() +{ + struct mntent mnt; + char *cp; + mnt.mnt_opts = "intr,rw,port=1023,timeo=8,foo=br,retrans=110,indirect,map=/usr/local/AMD/etc/amd.proj,boo"; + cp = hasmntopt(&mnt, "ro"); + printf("cp = %s\n", cp); + exit(0); +} + +It is possible that sufficiently newer version of libc for RH4.2 fix this +problem. + + +(3) mips-dec-ultrix4.3 + +Rainer Orth reports + +[3A] One needs the Kernel Config Files (UDTBIN430) subset installed to +compile am-utils, otherwise essential header files (net/if.h, net/route.h, +rpcsvc/mount.h, rpcsvc/yp_prot.h, rpcsvc/ypclnt.h, sys/proc.h) are +missing. + +[3B] It's probably impossible to build am-utils with DEC C on Ultrix V4.3. +This compiler is pseudo-ANSI only. Maybe the new ANSI C compiler in V4.3A +and beyond will do. I successfully used gcc 2.8.1. + +[3C] You need to build against a recent libhesiod (I used 3.0.2) and +libresolv/lib44bsd (I used BIND 4.9.5-P1). The resolver routines in +libc seem to cause random memory corruption. It is necessary to specify +LIBS=-l44bsd. lib44bsd is a helper library of libresolv used to supply +functions like strdup which are missing on the host system. This isn't +currently autoconfiscated. + +[3D] You need to configure with CONFIG_SHELL=/bin/sh5 /bin/sh5 buildall; +/bin/sh cannot handle the shell functions used in buildall and is both +buggy and slow. + +[3E] At least the gcc 2.7.0 fixincludes-mangled needs a +forward declaration of struct utsname to avoid lots of gcc warnings: + +RCS file: RCS/utsname.h,v +retrieving revision 1.1 +diff -u -r1.1 utsname.h +--- utsname.h 1995/06/19 13:07:01 1.1 ++++ utsname.h 1998/01/27 12:34:26 +@@ -59,6 +59,7 @@ + #ifdef KERNEL + #include "../h/limits.h" + #else /* user mode */ ++struct utsname; + extern int uname _PARAMS((struct utsname *)); + #endif + #define __SYS_NMLN 32 + + +(4) powerpc-ibm-aix4.2.1.0 + +[4A] "Randall S. Winchester" reports that for amd to +start, you need to kill and restart rpc.mountd and possibly also make sure +that nfsd is running. Normally these are not required. + +[4B] "Stefan Vogel" reports that if your amq +executable dump core unexpectedly, then it may be a bug in gcc 2.7.x. +Upgrade to gcc 2.8.x or use IBM's xlC compiler. + +[C] Do not link amd with libnsl. It is buggy and causes amd to core dump +in strlen inside strdup inside svc_register(). + + +(5) *-linux-rh51 (RedHat Linux 5.1) + +There's a UDP file descriptor leak in libnsl in RedHat Linux 5.1. This +library part of glibc2. Am-utils currently declares redhat 5.1 systems as +having a "broken yp_all" and using an internal, slower, leak-free version. +The leak is known to the glibc maintainers and a fix from them is due soon, +but it is not yet in the glibc-2.0.7-19 RPM. + + +(6) rs6000-ibm-aix4.1.x + +A bug in libc results in an amq binary that doesn't work; amq -v dumps core +in xdr_string. There is no known fix (source code or vendor patch) at this +time. (Please let am-utils@am-utils.org know if you know of a fix.) + + +(7) *-aix4.3.2.0 + +The plock() function will pre-reserve all of the memory up to the maximum +listed in the ulimit. If the ulimit is infinite, plock() will try to take +all of the system's memory, and fail with ENOMEM (Not Enough Space). +Normally ulimit may be set to a few gigs of max memory usage, but even that +is too much; Amd doesn't need more than a few megs of resident memory size +(depending on the particular usage, number of maps, etc.) Solution: lower +your ulimit before starting amd. This can be done inside the ctl-amd +script, but be careful not to limit it too low. Alternatively, don't use +plock on aix-4.3: set it to plock=no in amd.conf (which is the default if +you do nothing). + + +(8) *-linux (systems using glibc 2.1, such as RedHat-6.x) + +There's a UDP file descriptor leak in the NIS routines in glibc, especially +those that do yp_bind. Until this is bug fixed, do not set nis_domain in +amd.conf, but let the system pick up the default domain name as set by your +system. That would avoid using the buggy yp_bind routines in libc. + + +(9) *-linux (SuSE systems using unfsd) + +The user-level nfsd (2.2beta44) on older SuSE Linux systems (and possibly +others) dies with a SEGV when amd tries to contact it for access to a volume +that does not exist, or one for which there is no permission to mount. + + +(10) *-*-hpux11 + +If you're using NFSv3, you must install HP patches PHNE_20344 and +PHNE_20371. If you don't, and you try to use amd with NFSv3 over TCP, your +kernel will panic. + + +(11) *-linux* (any system using a 2.2.18+ kernel) + +The Linux kernels don't support Amd's direct mounts very well, leading to +erratic behavior: shares that don't get remounted after the first timeout, +inability to restart Amd because its mount points cannot be unmounted, etc. +There are some kernel patches on the am-utils Web site, which solve these +problems. See http://www.am-utils.org/patches/. + +Later 2.4.x kernels completely disallow the hack amd was using for direct +mounts, so another solution will have to be found. + +Note: the above is for the old-style amd mount_type = nfs. The autofs mounts +don't support direct mounts at all (due to lack of kernel support). + +(12) *-aix5.1.0.0 and *-hpux9* + +/bin/sh is broken and fails to run the configure script properly. You need +to use /bin/ksh instead. The buildall script will do it for you; if for some +reason you need to run configure directly, run it using 'ksh configure' +instead of just 'configure'. + +[12A] *-aix5.2.* + +Apparently there is an NFS client side bug in vmount() which causes amd to +hang when it starts (and tries to NFS-mount itself). According to IBM +engineers, this has to do with partial support code for IPv6: the NFS kernel +code doesn't appear to recognize the sin_family of the amd vmount(), +although amd does the right thing. The bug doesn't appear to be in 5.1 or +4.3.3. A fix from IBM is available, APAR number IY41417. + +A binary built on 4.3.3 will not work on 5.2, because the kernel ABIs have +changed. + +[12C] *-aix* + +It is important that you install bos.net.nfs.adt before configuring and +building am-utils. If you don't, you will get compile-time or +configure-time errors, especially when configure tries to find AIX's +definition of struct nfs_args. + +(13) *-linux and *-darwin6.0 + +Certain linux kernels (2.4.18+ are fine, 2.4.10- are probably bad, those in +between have not been tested) have a bug which causes them to reconnect +broken NFS/TCP connections using unprivileged ports (greater than 1024), +unlike the initial connections which do originate from privileged +ports. This can upset quite a few NFS servers and causes accesses to the +mounted shares to fail with "Operation not permitted" (EPERM). + +The darwin (MacOS X) kernel defaults to using unprivileged ports, but that +can be changed by setting the resvport mount flag (which amd sets by +default). Nonetheless, if a TCP connection breaks, under certain unclear +circumstances the kernel might "forget" about that flag and start using +unprivileged ports, causing the same EPERM error above. + +(14) Solaris + +The line "%option" in *.l files may cause Solaris /usr/ccs/bin/lex to abort +with the error "missing translation value." This is a bug in Solaris lex. + +Moreover, both Solaris yacc and lex produce code that does not pass strict +compilation such as "gcc -Wall -Werror". + +Use GNU Flex and Bison instead. You can download ready-made binaries from +www.sunfreeware.com. Note, however, that sometimes the binaries on +sunfreeware.com don't seem to work, often because they are built against an +older revision of Solaris or build tools. In that case, build a fresh +version of GNU flex and/or bison from the latest stable sources. See +http://www.gnu.org/software/flex/ and http://www.gnu.org/software/bison/. + +(15) Solaris 8 + patch 10899[34]-xx (18 <= xx < 25) or patch 11260[56]-xx + +With this patch, Sun updated the autofs kernel module and automountd +userspace daemon from version 3 to version 4. They also updated the +/usr/include/rpcsvc/autofs_prot.x file, but forgot to regenerate the +autofs_prot.h file. Thus, when amd is compiled, it uses the old header and +thinks it should use autofs version 3, when in fact the kernel now supports +(and expects) only version 4. + +The workaround is to run 'rpcgen -C -h /usr/include/rpcsvc/autofs_prot.x > +/usr/include/rpcsvc/autofs_prot.h' and completely reconfigure and rebuild +am-utils (removing config.cache before running configure). + +The problem is fixed in patch revisions 10899[34]-25 and up. + + +(16) Linux kernel 2.4+ and lofs mounts + +Lofs mounts are not supported by the linux kernel, at all, but since 2.4.0 +the kernel supports a similar type of mount called a bind mount. Its +semantics are closer to those of a hardlink than to those of lofs, and one +of the results is that bind mounts ignore any mount options paseed to them. + +Amd uses bind mounts internally to emulate lofs mounts, which means that +lofs mounts on linux will effectively ignore their mount parameters and +inherit whatever options the original filesystem mounted upon had. + + +(17) autoconf 2.57 + +If you see configure warnings of the following kind: + +configure: WARNING: sys/proc.h: present but cannot be compiled +configure: WARNING: sys/proc.h: check for missing prerequisite headers? +configure: WARNING: sys/proc.h: proceeding with the preprocessor's result +configure: WARNING: ## ------------------------------------ ## +configure: WARNING: ## Report this to bug-autoconf@gnu.org. ## +configure: WARNING: ## ------------------------------------ ## + +please ignore them. They are not real errors, and neither +bug-autoconf@gnu.org nor the am-utils maintainers are interested in hearing +about them. Autoconf simply tries to do more than we need and attempts to +compile each header in isolation, which fails for many system headers. +That's ok, because we only need to know if a header file exists -- we know +how to use it properly ourselves. + +While autoconf does offer a way to specify other files to be included with +the tested header, in order to avoid these warnings, using it would enlarge +the resulting configure script by an order of magnitude, and for no real +gain. Configure is big enough as it is, we don't need any more useless +baggage in it. + +(18) NetBSD 2.0.2, FreeBSD 5.4, OpenBSD 3.7, and quite possibly most other + BSDs and other OSs (as of September 2005) + +Some BSD kernels don't have a way to turn off the NFS attribute cache. They +don't have a 'noac' mount flag, and setting various cache timeout fields in +struct nfs_args doesn't turn off the attribute cache; instead, it sets the +attribute cache timeout to some internal hard-coded default (usually +anywhere from 5-30 seconds). If Amd cannot turn off the NFS attribute +cache, under heavy Amd usage, users could get ESTALE errors from automounted +symlinks, or find that those symlinks point to the wrong place. One +workaround which would minimize this effect is to set auto_attrcache=1 in +your amd.conf, but it doesn't eliminate the problem! The best solutions are +(1) to use Amd in Autofs mode, if it's supported in your OS, and (2) talk to +your OS vendor to support a true "noac" flag. See README.attrcache for more +details. + +Erez & the am-utils team. Copied: vendor/amd/dist/COPYING (from r277862, vendor/amd/dist/contrib/amd/COPYING) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/amd/dist/COPYING Wed Jan 28 22:55:06 2015 (r277863, copy of r277862, vendor/amd/dist/contrib/amd/COPYING) @@ -0,0 +1,37 @@ +Copyright (c) 1997-2006 Erez Zadok +Copyright (c) 1989 Jan-Simon Pendry +Copyright (c) 1989 Imperial College of Science, Technology & Medicine +Copyright (c) 1989 The Regents of the University of California. +All rights reserved. + +This code is derived from software contributed to Berkeley by +Jan-Simon Pendry at Imperial College, London. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgment: + This product includes software developed by the University of + California, Berkeley and its contributors, as well as the Trustees of + Columbia University. +4. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. Copied: vendor/amd/dist/ChangeLog (from r277862, vendor/amd/dist/contrib/amd/ChangeLog) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/amd/dist/ChangeLog Wed Jan 28 22:55:06 2015 (r277863, copy of r277862, vendor/amd/dist/contrib/amd/ChangeLog) @@ -0,0 +1,12025 @@ +2006-05-11 Erez Zadok + + ******************************************************************* + *** Released am-utils-6.1.5 *** + ******************************************************************* + +2006-05-10 Erez Zadok + + * Minor new ports: i386-unknown-freebsd6.1 (RELEASE) + powerpc-apple-darwin8.6.0, and i386-unknown-openbsd3.9. + + * libamu/mount_fs.c (compute_nfs_attrcache_flags): fix signedness + problems on IRIX-6.5. + + * conf/autofs/autofs_solaris_v1.c (xdr_umntrequest): fix + signedness problems on IRIX-6.5. + +2006-05-01 Erez Zadok + + * configure.in: check if libc already includes dbm functionality + (as in FreeBSD 6), then don't bother to check specific libraries + such as libdbm, gdbm, etc. + +2006-04-21 Erez Zadok + + * configure.in: detect G/DBM support via gdbm_compat library + (Debian 3.1). + + * minor new port: powerpc-apple-darwin8.5.0 + +2006-04-20 Erez Zadok + + * scripts/amd.conf-sample, scripts/amd.conf.5, doc/am-utils.texi, + NEWS: document new nfs_allow_any_interface parameter. + + * include/am_compat.h (INADDR_LOOPBACK): define INADDR_LOOPBACK if + not defined, since some systems don't have it. + +2006-04-20 Nick Williams + + * libamu/wire.c (is_interface_local): new boolena function to + determine if address represents any of the local interfaces. + (getwire): more properly check if address equals INADDR_LOOPBACK, + not if IFF_LOOPBACK is not (the latter isn't as correct). + + * include/am_utils.h: extern for new is_interface_local() function. + + * conf/transp/transp_{sockets,tli}.c: don't define INADDR_LOOPBACK + here but in am_compat.h + + * amd/nfs_prot_svc.c (nfs_program_2): if + nfs_allow_any_interface=yes, then allow NFS packets from any local + interface (not just 127.0.0.1). + + * amd/conf.c (gopt_nfs_allow_any_interface): implement the new + amd.conf parameter nfs_allow_any_interface. + + * amd/amd.h (CFM_NFS_ANY_INTERFACE): define new global flag when + al interfaces are acceptable for local NFS packets. + +2006-04-18 Christos Zoulas + + * amd/opts.c: Add support for optionally specifying the hostname + to match against the netgroup in the netgrp and netgrpd selectors. + +2006-04-16 Erez Zadok + + * libamu/mtab.c (hasmntval): fix inverted meaning of error from + hasmntvalerr(). + +2006-04-14 Erez Zadok + + * libamu/mount_fs.c (compute_nfs_attrcache_flags): use new + hasmntvalerr() function to set attribute cache values only if they + were set (regardless whether they were set to zero or a non-zero + value). Before, we were unable to distinguish between an error to + parse an option, and a user who actually wanted to set an + attribute-cache value to 0. This now fixes an important + performance bug that Amd was turning off the attribute caches even + for regular (non-automounter) NFS mounts. + + * libamu/mtab.c (hasmntvalerr): new function to set the value of + an option into an integer, but ONLY if that options was set and + parsed correctly. This function returns 1 on error, 0 on success + (instead of always setting the option value to 0). + (hasmntval): wrapper function around hasmntvalerr, which maintains + backwards compatibility (always sets option value to 0, even on + error to parse the option). + + * amd/nfs_subr.c (fh_to_mp3): use long int printf format for + fhh_pid. + +2006-04-05 Christos Zoulas + + * amd/amfs_generic.c (amfs_lookup_mntfs): fix use-after-free bug + (Coverity). + +2006-03-27 Erez Zadok + + * doc/am-utils.texi, scripts/{amd.conf.5,amd.conf-sample}: + document new nfs_retransmit_counter_toplvl and + nfs_retry_interval_toplvl global amd.conf parameters. + + * amd/conf.c (gopt_nfs_retransmit_counter_toplvl, + (gopt_nfs_retry_interval_toplvl): parse amd.conf + nfs_retransmit_counter_toplvl and nfs_retry_interval_toplvl global + parameters. + + * amd/amfs_toplvl.c (amfs_toplvl_mount): support setting toplvl + timeo/retrans parameters for Amd's toplvl mounts, separately from + all other UDP or NFS mounts. + + * amd/amd.h: define a new timeo/retrans parameter for toplvl + mounts. + +2006-03-22 Erez Zadok + + * minor new port: i386-pc-linux-suse10.1 (beta 8). + +2006-03-21 Christos Zoulas + + * amd/am_ops.c (merge_opts): Remove useless check found by + Coverity; xmalloc never returns NULL. + +2006-03-21 Erez Zadok + + * minor new ports: i386-pc-linux-fc5. + + * amd/info_ldap.c: as of Linux Fedora Core 5 (which comes with + openldap-2.3.9), the ldap.h headers deprecate several functions + used in this file, such as ldap_unbind. You get compile errors + about missing extern definitions. Those externs are still in + , but surrounded by an ifdef LDAP_DEPRECATED. I am + turning on that ifdef at the top of info_ldap.c, under the + assumption that the functions may be deprecated, but they still + work for this (older?) version of the LDAP API. It gets am-utils + to compile, but it is not clear if it will work perfectly. + + * libamu/xdr_func.c (xdr_am_mountres3_ok), amq/amq_xdr.c + (xdr_amq_mount_tree, xdr_amq_mount_tree_p, + xdr_amq_mount_info_list, xdr_amq_mount_tree_list), amq/amq.c + (show_mti), amd/amq_subr.c (xdr_amq_setopt, xdr_amq_mount_subtree, + xdr_amq_mount_tree, xdr_amq_mount_tree_list, xdr_amq_mount_tree), + libamu/xdr_func.c (xdr_am_mountres3_ok): use casing magic to stop + GCC-4.1 from complaining about "dereferencing type-punned pointer + will break strict-aliasing rules" here (but not elsewhere). + +2006-03-20 Christos Zoulas + + * libamu/wire.c: avoid potential dereferencing of a NULL pointer + (Coverity). + + * hlfsd/homedir.c (delay): remove unnecessary check for NULL + pointer (Coverity). + + * fsinfo/fsi_analyze.c (analyze_dkmounts, analyze_mounts, + analyze_mounts): avoid potential dereferencing of a NULL pointer + (Coverity). + + * conf/transp/transp_sockets.c (create_amq_service): avoid + potential dereferencing of a NULL pointer (Coverity). + + * amd/sched.c (sigchld): properly check for the end of the waiting + process list (Coverity). + + * amd/mapc.c (mapc_create): initialize 'modify' to zero (Coverity). + + * amd/autil.c (amfs_mkcacheref, am_unmounted): avoid potential + dereferencing of a NULL pointer (Coverity). + + * amd/amfs_generic.c (amfs_lookup_mntfs): free def_opts before + reusing it (memory leak bug detected by Coverity). + (amfs_bgmount): avoid potential dereferencing of a NULL pointer + (Coverity). + + * amd/am_ops.c (merge_opts): no need to check if newstr is NULL + (bug detected by Coverity). + +2006-03-08 Ion Badulescu + + * amd/nfs_subr.c (mp_to_fh): fixed old-style filehandles--the pid + comparison was failing. + +2006-03-08 Erez Zadok + + * configure.in: properly test for either or + (unfortunately, Autoconf will map both names to the + same $ac_cv_* variable name). Some systems support one header or + another. Patch inspired by work Debian did. + +2006-02-10 Erez Zadok + + ******************************************************************* + *** Released am-utils-6.1.4 *** + ******************************************************************* + +2006-01-04 Erez Zadok + + * doc/am-utils.texi (auto_attrcache Parameter): revise discussion + to mention pros and cons of turning on/off this parameter, + including impact on Amd's performance, and ways to improve + performance while minimizing the window of vulnerability in which + kernel may return the wrong (cached) attributes. + +2006-01-02 Erez Zadok + + * updated copyright year to 2006 on all files. + +2005-12-20 Erez Zadok + + * include/am_utils.h, conf/transp/transp_tli.c (amu_svc_register, + register_autofs_service): use a consistent prototype for the + dispatch function of the autofs service de/registration functions. + +2005-12-03 Erez Zadok + + * minor new ports: i386-unknown-netbsdelf2.1, + i386-unknown-netbsdelf3.0 (RELEASE), and i386-unknown-openbsd3.8. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@FreeBSD.ORG Wed Jan 28 23:22:43 2015 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 54B941EF; Wed, 28 Jan 2015 23:22:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4047F27B; Wed, 28 Jan 2015 23:22:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0SNMhpj025446; Wed, 28 Jan 2015 23:22:43 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0SNMhDU025445; Wed, 28 Jan 2015 23:22:43 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201501282322.t0SNMhDU025445@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 28 Jan 2015 23:22:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r277866 - vendor/amd/dist/amd X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jan 2015 23:22:43 -0000 Author: pfg Date: Wed Jan 28 23:22:42 2015 New Revision: 277866 URL: https://svnweb.freebsd.org/changeset/base/277866 Log: avoid possible null pointer deref (coverity) author Christos Zoulas Wed, 17 Sep 2008 15:07:20 -0500 (20:07 +0000) committer Christos Zoulas Wed, 17 Sep 2008 15:07:20 -0500 (20:07 +0000) commit d414de481f6efe52455c19f64e911d0db34d185a Modified: vendor/amd/dist/amd/amfs_generic.c Modified: vendor/amd/dist/amd/amfs_generic.c ============================================================================== --- vendor/amd/dist/amd/amfs_generic.c Wed Jan 28 23:13:12 2015 (r277865) +++ vendor/amd/dist/amd/amfs_generic.c Wed Jan 28 23:22:42 2015 (r277866) @@ -1113,7 +1113,7 @@ amfs_generic_mount_child(am_node *new_mp new_mp->am_transp = (SVCXPRT *) xmalloc(sizeof(SVCXPRT)); *(new_mp->am_transp) = *current_transp; } - if (error && (new_mp->am_mnt->mf_ops == &amfs_error_ops)) + if (error && new_mp->am_mnt && (new_mp->am_mnt->mf_ops == &amfs_error_ops)) new_mp->am_error = error; if (new_mp->am_error > 0) From owner-svn-src-vendor@FreeBSD.ORG Thu Jan 29 01:55:26 2015 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B728FD; Thu, 29 Jan 2015 01:55:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 765DB6E5; Thu, 29 Jan 2015 01:55:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0T1tQuv098870; Thu, 29 Jan 2015 01:55:26 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0T1tPin098866; Thu, 29 Jan 2015 01:55:25 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201501290155.t0T1tPin098866@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 29 Jan 2015 01:55:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r277870 - in vendor/amd/dist: amd hlfsd X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jan 2015 01:55:26 -0000 Author: pfg Date: Thu Jan 29 01:55:24 2015 New Revision: 277870 URL: https://svnweb.freebsd.org/changeset/base/277870 Log: Fix compile warnings for gcc-4.4.x author Christos Zoulas Mon, 26 Oct 2009 12:27:43 -0500 (13:27 -0400) committer Christos Zoulas Mon, 26 Oct 2009 12:27:43 -0500 (13:27 -0400) commit e6301006ef97d31745f9ffbb17c58cb39d18c6aa (partial) Modified: vendor/amd/dist/amd/amfs_program.c vendor/amd/dist/amd/readdir.c vendor/amd/dist/hlfsd/homedir.c vendor/amd/dist/hlfsd/stubs.c Modified: vendor/amd/dist/amd/amfs_program.c ============================================================================== --- vendor/amd/dist/amd/amfs_program.c Thu Jan 29 01:28:39 2015 (r277869) +++ vendor/amd/dist/amd/amfs_program.c Thu Jan 29 01:55:24 2015 (r277870) @@ -147,10 +147,12 @@ amfs_program_exec(char *info) (void) fclose(stdout); if (!logfp) logfp = stderr; /* initialize before possible first use */ - (void) dup(fileno(logfp)); + if (dup(fileno(logfp)) == -1) + return errno; if (fileno(logfp) != fileno(stderr)) { (void) fclose(stderr); - (void) dup(fileno(logfp)); + if (dup(fileno(logfp)) == -1) + return errno; } /* Modified: vendor/amd/dist/amd/readdir.c ============================================================================== --- vendor/amd/dist/amd/readdir.c Thu Jan 29 01:28:39 2015 (r277869) +++ vendor/amd/dist/amd/readdir.c Thu Jan 29 01:55:24 2015 (r277870) @@ -63,6 +63,7 @@ static int key_already_in_chain(char *ke static nfsentry *make_entry_chain(am_node *mp, const nfsentry *current_chain, int fully_browsable); static int amfs_readdir_browsable(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep, u_int count, int fully_browsable); +static const u_int dotdotcookie = DOT_DOT_COOKIE; /**************************************************************************** *** FUNCTIONS *** @@ -178,8 +179,9 @@ make_entry_chain(am_node *mp, const nfse /* we have space. put entry in next cell */ ++last_cookie; - chain[num_entries].ne_fileid = (u_int) last_cookie; - *(u_int *) chain[num_entries].ne_cookie = (u_int) last_cookie; + chain[num_entries].ne_fileid = last_cookie; + (void)memcpy(chain[num_entries].ne_cookie, &last_cookie, + sizeof(last_cookie)); chain[num_entries].ne_name = key; if (num_entries < max_entries - 1) { /* link to next one */ chain[num_entries].ne_nextentry = &chain[num_entries + 1]; @@ -253,7 +255,7 @@ amfs_readdir_browsable(am_node *mp, nfsc ep[0].ne_fileid = mp->am_gen; ep[0].ne_name = "."; ep[0].ne_nextentry = &ep[1]; - *(u_int *) ep[0].ne_cookie = 0; + (void)memset(ep[0].ne_cookie, 0, sizeof(u_int)); /* construct ".." */ if (mp->am_parent) @@ -300,9 +302,12 @@ amfs_readdir_browsable(am_node *mp, nfsc nfsentry *ne; for (j = 0, ne = te; ne; ne = ne->ne_nextentry) plog(XLOG_DEBUG, "gen2 key %4d \"%s\"", j++, ne->ne_name); - for (j = 0, ne = ep; ne; ne = ne->ne_nextentry) + for (j = 0, ne = ep; ne; ne = ne->ne_nextentry) { + u_int cookie; + (void)memcpy(&cookie, ne->ne_cookie, sizeof(cookie)); plog(XLOG_DEBUG, "gen2+ key %4d \"%s\" fi=%d ck=%d", - j++, ne->ne_name, ne->ne_fileid, *(u_int *)ne->ne_cookie); + j++, ne->ne_name, ne->ne_fileid, cookie); + } plog(XLOG_DEBUG, "EOF is %d", dp->dl_eof); } return 0; @@ -412,7 +417,7 @@ amfs_generic_readdir(am_node *mp, nfscoo ep[0].ne_fileid = mp->am_gen; ep[0].ne_name = "."; ep[0].ne_nextentry = &ep[1]; - *(u_int *) ep[0].ne_cookie = 0; + (void)memset(ep[0].ne_cookie, 0, sizeof(u_int)); /* construct ".." */ if (mp->am_parent) @@ -429,9 +434,12 @@ amfs_generic_readdir(am_node *mp, nfscoo if (amuDebug(D_READDIR)) { nfsentry *ne; int j; - for (j = 0, ne = ep; ne; ne = ne->ne_nextentry) + for (j = 0, ne = ep; ne; ne = ne->ne_nextentry) { + u_int cookie; + (void)memcpy(&cookie, ne->ne_cookie, sizeof(cookie)); plog(XLOG_DEBUG, "gen1 key %4d \"%s\" fi=%d ck=%d", - j++, ne->ne_name, ne->ne_fileid, *(u_int *)ne->ne_cookie); + j++, ne->ne_name, ne->ne_fileid, cookie); + } } return 0; } @@ -460,9 +468,9 @@ amfs_generic_readdir(am_node *mp, nfscoo am_node *xp_next = next_nonerror_node(xp->am_osib); if (xp_next) { - *(u_int *) ep->ne_cookie = xp_next->am_gen; + (void)memcpy(ep->ne_cookie, &xp_next->am_gen, sizeof(xp_next->am_gen)); } else { - *(u_int *) ep->ne_cookie = DOT_DOT_COOKIE; + (void)memcpy(ep->ne_cookie, &dotdotcookie, sizeof(dotdotcookie)); dp->dl_eof = TRUE; } @@ -488,9 +496,12 @@ amfs_generic_readdir(am_node *mp, nfscoo if (amuDebug(D_READDIR)) { nfsentry *ne; int j; - for (j=0,ne=ep; ne; ne=ne->ne_nextentry) + for (j=0,ne=ep; ne; ne=ne->ne_nextentry) { + u_int cookie; + (void)memcpy(&cookie, ne->ne_cookie, sizeof(cookie)); plog(XLOG_DEBUG, "gen2 key %4d \"%s\" fi=%d ck=%d", - j++, ne->ne_name, ne->ne_fileid, *(u_int *)ne->ne_cookie); + j++, ne->ne_name, ne->ne_fileid, cookie); + } } return 0; } Modified: vendor/amd/dist/hlfsd/homedir.c ============================================================================== --- vendor/amd/dist/hlfsd/homedir.c Thu Jan 29 01:28:39 2015 (r277869) +++ vendor/amd/dist/hlfsd/homedir.c Thu Jan 29 01:55:24 2015 (r277870) @@ -492,9 +492,10 @@ readent: /* read records */ buf[0] = '\0'; - fgets(buf, 256, passwd_fp); + if (fgets(buf, 256, passwd_fp) == NULL) + return NULL; passwd_line++; - if (!buf || buf[0] == '\0') + if (buf[0] == '\0') goto readent; /* read user name */ Modified: vendor/amd/dist/hlfsd/stubs.c ============================================================================== --- vendor/amd/dist/hlfsd/stubs.c Thu Jan 29 01:28:39 2015 (r277869) +++ vendor/amd/dist/hlfsd/stubs.c Thu Jan 29 01:55:24 2015 (r277870) @@ -164,8 +164,7 @@ nfsproc_getattr_2_svc(am_nfs_fh *argp, s if (gid != hlfs_gid) { res.ns_status = NFSERR_STALE; } else { - memset((char *) &uid, 0, sizeof(int)); - uid = *(u_int *) argp->fh_data; + (void)memcpy(&uid, argp->fh_data, sizeof(uid)); if (plt_search(uid) != (uid2home_t *) NULL) { res.ns_status = NFS_OK; un_fattr.na_fileid = uid; @@ -282,8 +281,8 @@ nfsproc_lookup_2_svc(nfsdiropargs *argp, } else { /* entry found and gid is permitted */ un_fattr.na_fileid = untab[idx].uid; res.dr_u.dr_drok_u.drok_attributes = un_fattr; - memset((char *) &un_fhandle, 0, sizeof(am_nfs_fh)); - *(u_int *) un_fhandle.fh_data = (u_int) untab[idx].uid; + memset(&un_fhandle, 0, sizeof(un_fhandle)); + memcpy(un_fhandle.fh_data, &untab[idx].uid, sizeof(untab[idx].uid)); xstrlcpy((char *) &un_fhandle.fh_data[sizeof(int)], untab[idx].username, sizeof(am_nfs_fh) - sizeof(int)); @@ -338,8 +337,7 @@ nfsproc_readlink_2_svc(am_nfs_fh *argp, } if (groupid == hlfs_gid) { - memset((char *) &userid, 0, sizeof(int)); - userid = *(u_int *) argp->fh_data; + memcpy(&userid, argp->fh_data, sizeof(userid)); username = (char *) &argp->fh_data[sizeof(int)]; if (!(res.rlr_u.rlr_data_u = mailbox(userid, username))) return (nfsreadlinkres *) NULL; From owner-svn-src-vendor@FreeBSD.ORG Sat Jan 31 16:26:22 2015 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 715A5860; Sat, 31 Jan 2015 16:26:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D4E8E4A; Sat, 31 Jan 2015 16:26:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0VGQMgc062418; Sat, 31 Jan 2015 16:26:22 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0VGQLqs062416; Sat, 31 Jan 2015 16:26:21 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201501311626.t0VGQLqs062416@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 31 Jan 2015 16:26:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r277981 - vendor/tcpdump/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Jan 2015 16:26:22 -0000 Author: pfg Date: Sat Jan 31 16:26:21 2015 New Revision: 277981 URL: https://svnweb.freebsd.org/changeset/base/277981 Log: Upstream fixes for issues found with afl (Issue #417). - Fix length checking. Check both the captured length and the on-the-wire length (the latter *should* be greater than or equal to the former, but that's not guaranteed). Add some additional length checks, so neither caplen nor length underflow. If we stop dissecting because the packet is too short, return 1, not 0, as we've "dissected" what we can; 0 means "this is LLC+SNAP with an OUI of 0 and an unknown Ethertype". commit: 743bcecdc92f88b118ec7aac4f68b606601205cc - Clean up length checks. Check only the amount of length that matters at any given point; yes, this means we do multiple checks, but so it goes. We don't need to check for LLC+SNAP - llc_print() does that for us. We do, however, need to check to make sure we can safely skip the Fore header. commit: 5c65e7532fa16308e01299988852b0dc5b027559 Modified: vendor/tcpdump/dist/print-atm.c vendor/tcpdump/dist/print-llc.c Modified: vendor/tcpdump/dist/print-atm.c ============================================================================== --- vendor/tcpdump/dist/print-atm.c Sat Jan 31 15:50:19 2015 (r277980) +++ vendor/tcpdump/dist/print-atm.c Sat Jan 31 16:26:21 2015 (r277981) @@ -165,7 +165,7 @@ atm_if_print(netdissect_options *ndo, uint32_t llchdr; u_int hdrlen = 0; - if (caplen < 8) { + if (caplen < 1 || length < 1) { ND_PRINT((ndo, "%s", tstr)); return (caplen); } @@ -179,6 +179,15 @@ atm_if_print(netdissect_options *ndo, } /* + * Must have at least a DSAP, an SSAP, and the first byte of the + * control field. + */ + if (caplen < 3 || length < 3) { + ND_PRINT((ndo, "%s", tstr)); + return (caplen); + } + + /* * Extract the presumed LLC header into a variable, for quick * testing. * Then check for a header that's neither a header for a SNAP @@ -205,6 +214,10 @@ atm_if_print(netdissect_options *ndo, * packets? If so, could it be changed to use a * new DLT_IEEE802_6 value if we added it? */ + if (caplen < 20 || length < 20) { + ND_PRINT((ndo, "%s", tstr)); + return (caplen); + } if (ndo->ndo_eflag) ND_PRINT((ndo, "%08x%08x %08x%08x ", EXTRACT_32BITS(p), Modified: vendor/tcpdump/dist/print-llc.c ============================================================================== --- vendor/tcpdump/dist/print-llc.c Sat Jan 31 15:50:19 2015 (r277980) +++ vendor/tcpdump/dist/print-llc.c Sat Jan 31 16:26:21 2015 (r277981) @@ -151,10 +151,10 @@ llc_print(netdissect_options *ndo, const *extracted_ethertype = 0; - if (caplen < 3) { + if (caplen < 3 || length < 3) { ND_PRINT((ndo, "[|llc]")); ND_DEFAULTPRINT((u_char *)p, caplen); - return(0); + return (1); } dsap_field = *p; @@ -177,10 +177,10 @@ llc_print(netdissect_options *ndo, const * The control field in I and S frames is * 2 bytes... */ - if (caplen < 4) { + if (caplen < 4 || length < 4) { ND_PRINT((ndo, "[|llc]")); ND_DEFAULTPRINT((u_char *)p, caplen); - return(0); + return (1); } /* @@ -240,6 +240,11 @@ llc_print(netdissect_options *ndo, const if (ssap == LLCSAP_IP && dsap == LLCSAP_IP && control == LLC_UI) { + if (caplen < 4 || length < 4) { + ND_PRINT((ndo, "[|llc]")); + ND_DEFAULTPRINT((u_char *)p, caplen); + return (1); + } ip_print(ndo, p+4, length-4); return (1); } @@ -368,6 +373,8 @@ snap_print(netdissect_options *ndo, cons register int ret; ND_TCHECK2(*p, 5); + if (caplen < 5 || length < 5) + goto trunc; orgcode = EXTRACT_24BITS(p); et = EXTRACT_16BITS(p + 3); From owner-svn-src-vendor@FreeBSD.ORG Sat Jan 31 19:27:34 2015 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B24129CF; Sat, 31 Jan 2015 19:27:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99CC2B4; Sat, 31 Jan 2015 19:27:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0VJRYLQ048321; Sat, 31 Jan 2015 19:27:34 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0VJRTt5048292; Sat, 31 Jan 2015 19:27:29 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201501311927.t0VJRTt5048292@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 31 Jan 2015 19:27:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r277992 - in vendor/llvm/dist: docs include/llvm/IR include/llvm/MC include/llvm/Transforms/Utils lib/Analysis lib/CodeGen lib/CodeGen/AsmPrinter lib/IR lib/MC lib/Support lib/Target/AA... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Jan 2015 19:27:34 -0000 Author: dim Date: Sat Jan 31 19:27:28 2015 New Revision: 277992 URL: https://svnweb.freebsd.org/changeset/base/277992 Log: Vendor import of llvm RELEASE_360/rc2 tag r227651 (effectively, 3.6.0 RC2): https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_360/rc2@227651 Added: vendor/llvm/dist/test/Analysis/ScalarEvolution/nw-sub-is-not-nw-add.ll vendor/llvm/dist/test/Bindings/llvm-c/add_named_metadata_operand.ll vendor/llvm/dist/test/Bindings/llvm-c/set_metadata.ll vendor/llvm/dist/test/CodeGen/AArch64/ghc-cc.ll vendor/llvm/dist/test/CodeGen/ARM/2015-01-21-thumbv4t-ldstr-opt.ll vendor/llvm/dist/test/CodeGen/R600/misaligned-load.ll vendor/llvm/dist/test/CodeGen/R600/scratch-buffer.ll vendor/llvm/dist/test/DebugInfo/Mips/fn-call-line.ll vendor/llvm/dist/test/MC/ARM/pr22395.s (contents, props changed) vendor/llvm/dist/test/Transforms/IndVarSimplify/pr22222.ll vendor/llvm/dist/tools/llvm-c-test/metadata.c (contents, props changed) Deleted: vendor/llvm/dist/test/MC/MachO/AArch64/mergeable.s vendor/llvm/dist/test/MC/MachO/x86_64-mergeable.s Modified: vendor/llvm/dist/docs/ReleaseNotes.rst vendor/llvm/dist/include/llvm/IR/LegacyPassManagers.h vendor/llvm/dist/include/llvm/MC/MCAsmBackend.h vendor/llvm/dist/include/llvm/MC/MCAssembler.h vendor/llvm/dist/include/llvm/MC/MCMachObjectWriter.h vendor/llvm/dist/include/llvm/MC/MCObjectWriter.h vendor/llvm/dist/include/llvm/Transforms/Utils/SimplifyLibCalls.h vendor/llvm/dist/lib/Analysis/ScalarEvolution.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfUnit.cpp vendor/llvm/dist/lib/CodeGen/MachineFunctionPass.cpp vendor/llvm/dist/lib/IR/Core.cpp vendor/llvm/dist/lib/IR/LegacyPassManager.cpp vendor/llvm/dist/lib/MC/ELFObjectWriter.cpp vendor/llvm/dist/lib/MC/MCAsmInfoDarwin.cpp vendor/llvm/dist/lib/MC/MCAssembler.cpp vendor/llvm/dist/lib/MC/MachObjectWriter.cpp vendor/llvm/dist/lib/MC/WinCOFFObjectWriter.cpp vendor/llvm/dist/lib/Support/Triple.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64CallingConvention.td vendor/llvm/dist/lib/Target/AArch64/AArch64FastISel.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64FrameLowering.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64ISelLowering.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64RegisterInfo.cpp vendor/llvm/dist/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp vendor/llvm/dist/lib/Target/AArch64/MCTargetDesc/AArch64MachObjectWriter.cpp vendor/llvm/dist/lib/Target/ARM/ARMLoadStoreOptimizer.cpp vendor/llvm/dist/lib/Target/ARM/AsmParser/ARMAsmParser.cpp vendor/llvm/dist/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonRemoveSZExtArgs.cpp vendor/llvm/dist/lib/Target/Mips/Mips16ISelLowering.cpp vendor/llvm/dist/lib/Target/Mips/Mips32r6InstrInfo.td vendor/llvm/dist/lib/Target/Mips/MipsISelLowering.cpp vendor/llvm/dist/lib/Target/Mips/MipsISelLowering.h vendor/llvm/dist/lib/Target/NVPTX/NVPTXAllocaHoisting.h vendor/llvm/dist/lib/Target/NVPTX/NVPTXLowerAggrCopies.h vendor/llvm/dist/lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp vendor/llvm/dist/lib/Target/R600/AMDGPU.h vendor/llvm/dist/lib/Target/R600/AMDGPU.td vendor/llvm/dist/lib/Target/R600/AMDGPUAsmPrinter.cpp vendor/llvm/dist/lib/Target/R600/AMDGPUISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/R600/AMDGPUISelLowering.cpp vendor/llvm/dist/lib/Target/R600/AMDGPUInstrInfo.cpp vendor/llvm/dist/lib/Target/R600/AMDGPUInstrInfo.h vendor/llvm/dist/lib/Target/R600/AMDGPUMCInstLower.cpp vendor/llvm/dist/lib/Target/R600/AMDGPUMCInstLower.h vendor/llvm/dist/lib/Target/R600/AMDGPUSubtarget.cpp vendor/llvm/dist/lib/Target/R600/AMDGPUSubtarget.h vendor/llvm/dist/lib/Target/R600/MCTargetDesc/AMDGPUAsmBackend.cpp vendor/llvm/dist/lib/Target/R600/SIDefines.h vendor/llvm/dist/lib/Target/R600/SIISelLowering.cpp vendor/llvm/dist/lib/Target/R600/SIInstrFormats.td vendor/llvm/dist/lib/Target/R600/SIInstrInfo.cpp vendor/llvm/dist/lib/Target/R600/SIInstrInfo.h vendor/llvm/dist/lib/Target/R600/SIInstrInfo.td vendor/llvm/dist/lib/Target/R600/SIInstructions.td vendor/llvm/dist/lib/Target/R600/SIMachineFunctionInfo.h vendor/llvm/dist/lib/Target/R600/SIPrepareScratchRegs.cpp vendor/llvm/dist/lib/Target/R600/SIRegisterInfo.cpp vendor/llvm/dist/lib/Target/R600/SIRegisterInfo.h vendor/llvm/dist/lib/Target/R600/SIShrinkInstructions.cpp vendor/llvm/dist/lib/Target/R600/VIInstructions.td vendor/llvm/dist/lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.cpp vendor/llvm/dist/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp vendor/llvm/dist/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp vendor/llvm/dist/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCalls.cpp vendor/llvm/dist/lib/Transforms/Scalar/GVN.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopInstSimplify.cpp vendor/llvm/dist/lib/Transforms/Utils/LowerSwitch.cpp vendor/llvm/dist/lib/Transforms/Utils/SimplifyIndVar.cpp vendor/llvm/dist/lib/Transforms/Utils/SimplifyLibCalls.cpp vendor/llvm/dist/lib/Transforms/Utils/SymbolRewriter.cpp vendor/llvm/dist/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp vendor/llvm/dist/test/CodeGen/AArch64/arm64-platform-reg.ll vendor/llvm/dist/test/CodeGen/Mips/fcmp.ll vendor/llvm/dist/test/CodeGen/R600/basic-loop.ll vendor/llvm/dist/test/CodeGen/R600/ctpop.ll vendor/llvm/dist/test/CodeGen/R600/ctpop64.ll vendor/llvm/dist/test/CodeGen/R600/ds_read2st64.ll vendor/llvm/dist/test/CodeGen/R600/fp_to_sint.ll vendor/llvm/dist/test/CodeGen/R600/hsa.ll vendor/llvm/dist/test/CodeGen/R600/si-triv-disjoint-mem-access.ll vendor/llvm/dist/test/CodeGen/SPARC/2008-10-10-InlineAsmMemoryOperand.ll vendor/llvm/dist/test/CodeGen/SPARC/inlineasm.ll vendor/llvm/dist/test/CodeGen/SPARC/mult-alt-generic-sparc.ll vendor/llvm/dist/test/DebugInfo/X86/decl-derived-member.ll vendor/llvm/dist/test/MC/ELF/relocation-386.s vendor/llvm/dist/test/MC/MachO/x86_64-symbols.s vendor/llvm/dist/test/SymbolRewriter/rewrite.ll vendor/llvm/dist/test/SymbolRewriter/rewrite.map vendor/llvm/dist/test/Transforms/GVN/edge.ll vendor/llvm/dist/test/Transforms/IndVarSimplify/strengthen-overflow.ll vendor/llvm/dist/test/Transforms/InstCombine/call-cast-target.ll vendor/llvm/dist/test/Transforms/InstCombine/memcpy_chk-1.ll vendor/llvm/dist/test/Transforms/InstCombine/memmove_chk-1.ll vendor/llvm/dist/test/Transforms/InstCombine/memset_chk-1.ll vendor/llvm/dist/test/Transforms/InstCombine/stpcpy_chk-1.ll vendor/llvm/dist/test/Transforms/InstCombine/strcpy_chk-1.ll vendor/llvm/dist/test/Transforms/InstCombine/strncpy_chk-1.ll vendor/llvm/dist/test/tools/gold/emit-llvm.ll vendor/llvm/dist/tools/gold/gold-plugin.cpp vendor/llvm/dist/tools/llvm-c-test/CMakeLists.txt vendor/llvm/dist/tools/llvm-c-test/llvm-c-test.h vendor/llvm/dist/tools/llvm-c-test/main.c vendor/llvm/dist/unittests/ADT/TripleTest.cpp vendor/llvm/dist/unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp Modified: vendor/llvm/dist/docs/ReleaseNotes.rst ============================================================================== --- vendor/llvm/dist/docs/ReleaseNotes.rst Sat Jan 31 19:18:09 2015 (r277991) +++ vendor/llvm/dist/docs/ReleaseNotes.rst Sat Jan 31 19:27:28 2015 (r277992) @@ -102,6 +102,282 @@ enable handling of case (3). .. _discussions: http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-May/073235.html +Metadata is not a Value +----------------------- + +Metadata nodes (``!{...}``) and strings (``!"..."``) are no longer values. +They have no use-lists, no type, cannot RAUW, and cannot be function-local. + +Bridges between Value and Metadata +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +LLVM intrinsics can reference metadata using the ``metadata`` type, and +metadata nodes can reference constant values. + +Function-local metadata is limited to direct arguments to LLVM intrinsics. + +Metadata is typeless +^^^^^^^^^^^^^^^^^^^^ + +The following old IR: + +.. code-block:: llvm + + @g = global i32 0 + + define void @foo(i32 %v) { + entry: + call void @llvm.md(metadata !{i32 %v}) + call void @llvm.md(metadata !{i32* @global}) + call void @llvm.md(metadata !0) + call void @llvm.md(metadata !{metadata !"string"}) + call void @llvm.md(metadata !{metadata !{metadata !1, metadata !"string"}}) + ret void, !bar !1, !baz !2 + } + + declare void @llvm.md(metadata) + + !0 = metadata !{metadata !1, metadata !2, metadata !3, metadata !"some string"} + !1 = metadata !{metadata !2, null, metadata !"other", i32* @global, i32 7} + !2 = metadata !{} + +should now be written as: + +.. code-block:: llvm + + @g = global i32 0 + + define void @foo(i32 %v) { + entry: + call void @llvm.md(metadata i32 %v) ; The only legal place for function-local + ; metadata. + call void @llvm.md(metadata i32* @global) + call void @llvm.md(metadata !0) + call void @llvm.md(metadata !{!"string"}) + call void @llvm.md(metadata !{!{!1, !"string"}}) + ret void, !bar !1, !baz !2 + } + + declare void @llvm.md(metadata) + + !0 = !{!1, !2, !3, !"some string"} + !1 = !{!2, null, !"other", i32* @global, i32 7} + !2 = !{} + +Distinct metadata nodes +^^^^^^^^^^^^^^^^^^^^^^^ + +Metadata nodes can opt-out of uniquing, using the keyword ``distinct``. +Distinct nodes are still owned by the context, but are stored in a side table, +and not uniqued. + +In LLVM 3.5, metadata nodes would drop uniquing if an operand changed to +``null`` during optimizations. This is no longer true. However, if an operand +change causes a uniquing collision, they become ``distinct``. Unlike LLVM 3.5, +where serializing to assembly or bitcode would re-unique the nodes, they now +remain ``distinct``. + +The following IR: + +.. code-block:: llvm + + !named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8} + + !0 = !{} + !1 = !{} + !2 = distinct !{} + !3 = distinct !{} + !4 = !{!0} + !5 = distinct !{!0} + !6 = !{!4, !{}, !5} + !7 = !{!{!0}, !0, !5} + !8 = distinct !{!{!0}, !0, !5} + +is equivalent to the following: + +.. code-block:: llvm + + !named = !{!0, !0, !1, !2, !3, !4, !5, !5, !6} + + !0 = !{} + !1 = distinct !{} + !2 = distinct !{} + !3 = !{!0} + !4 = distinct !{!0} + !5 = !{!3, !0, !4} + !6 = distinct !{!3, !0, !4} + +Constructing cyclic graphs +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +During graph construction, if a metadata node transitively references a forward +declaration, the node itself is considered "unresolved" until the forward +declaration resolves. An unresolved node can RAUW itself to support uniquing. +Nodes automatically resolve once all their operands have resolved. + +However, cyclic graphs prevent the nodes from resolving. An API client that +constructs a cyclic graph must call ``resolveCycles()`` to resolve nodes in the +cycle. + +To save self-references from that burden, self-referencing nodes are implicitly +``distinct``. So the following IR: + +.. code-block:: llvm + + !named = !{!0, !1, !2, !3, !4} + + !0 = !{!0} + !1 = !{!1} + !2 = !{!2, !1} + !3 = !{!2, !1} + !4 = !{!2, !1} + +is equivalent to: + +.. code-block:: llvm + + !named = !{!0, !1, !2, !3, !3} + + !0 = distinct !{!0} + !1 = distinct !{!1} + !2 = distinct !{!2, !1} + !3 = !{!2, !1} + +MDLocation (aka DebugLoc aka DILocation) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +There's a new first-class metadata construct called ``MDLocation`` (to be +followed in subsequent releases by others). It's used for the locations +referenced by ``!dbg`` metadata attachments. + +For example, if an old ``!dbg`` attachment looked like this: + +.. code-block:: llvm + + define i32 @foo(i32 %a, i32 %b) { + entry: + %add = add i32 %a, %b, !dbg !0 + ret %add, !dbg !1 + } + + !0 = metadata !{i32 10, i32 3, metadata !2, metadata !1) + !1 = metadata !{i32 20, i32 7, metadata !3) + !2 = metadata !{...} + !3 = metadata !{...} + +the new attachment looks like this: + +.. code-block:: llvm + + define i32 @foo(i32 %a, i32 %b) { + entry: + %add = add i32 %a, %b, !dbg !0 + ret %add, !dbg !1 + } + + !0 = !MDLocation(line: 10, column: 3, scope: !2, inlinedAt: !1) + !1 = !MDLocation(line: 20, column: 7, scope: !3) + !2 = !{...} + !3 = !{...} + +The fields are named, can be reordered, and have sane defaults if left out +(although ``scope:`` is required). + + +Alias syntax change +----------------------- + +The syntax for aliases is now closer to what is used for global variables + +.. code-block:: llvm + + @a = weak global ... + @b = weak alias ... + +The order of the ``alias`` keyword and the linkage was swapped before. + +The old JIT has been removed +---------------------------- + +All users should transition to MCJIT. + + +object::Binary doesn't owns the file buffer +------------------------------------------- + +It is now just a wrapper, which simplifies using object::Binary with other +users of the underlying file. + +IR in object files is now supported +----------------------------------- + +Regular object files can contain IR in a section named ``.llvmbc``. + + +The gold plugin has been rewritten +---------------------------------- + +It is now implemented directly on top of lib/Linker instead of ``lib/LTO``. +The API of ``lib/LTO`` is sufficiently different from gold's view of the +linking process that some cases could not be conveniently implemented. + +The new implementation is also lazier and has a ``save-temps`` option. + + +Change in the representation of lazy loaded funcs +------------------------------------------------- + +Lazy loaded functions are now represented is a way that ``isDeclaration`` +returns the correct answer even before reading the body. + + +The opt option -std-compile-opts was removed +-------------------------------------------- + +It was effectively an alias of -O3. + + +Python 2.7 is now required +-------------------------- + +This was done to simplify compatibility with python 3. + +The leak detector has been removed +---------------------------------- + +In practice tools like asan and valgrind were finding way more bugs than +the old leak detector, so it was removed. + + +New comdat syntax +----------------- + +The syntax of comdats was changed to + +.. code-block:: llvm + + $c = comdat any + @g = global i32 0, comdat($c) + @c = global i32 0, comdat + +The version without the parentheses is a syntatic sugar for a comdat with +the same name as the global. + + +Diagnotic infrastructure used by lib/Linker and lib/Bitcode +----------------------------------------------------------- + +These libraries now use the diagnostic handler to print errors and warnings. +This provides better error messages and simpler error handling. + + +The PreserveSource linker mode was removed +------------------------------------------ + +It was fairly broken and was removed. + + + Changes to the ARM Backend -------------------------- @@ -237,8 +513,35 @@ An exciting aspect of LLVM is that it is a lot of other language and tools projects. This section lists some of the projects that have already been updated to work with LLVM 3.6. -* A project +Portable Computing Language (pocl) +---------------------------------- +In addition to producing an easily portable open source OpenCL +implementation, another major goal of `pocl `_ +is improving performance portability of OpenCL programs with +compiler optimizations, reducing the need for target-dependent manual +optimizations. An important part of pocl is a set of LLVM passes used to +statically parallelize multiple work-items with the kernel compiler, even in +the presence of work-group barriers. This enables static parallelization of +the fine-grained static concurrency in the work groups in multiple ways. + +TTA-based Co-design Environment (TCE) +------------------------------------- + +`TCE `_ is a toolset for designing customized +exposed datapath processors based on the Transport triggered +architecture (TTA). + +The toolset provides a complete co-design flow from C/C++ +programs down to synthesizable VHDL/Verilog and parallel program binaries. +Processor customization points include the register files, function units, +supported operations, and the interconnection network. + +TCE uses Clang and LLVM for C/C++/OpenCL C language support, target independent +optimizations and also for parts of code generation. It generates +new LLVM-based code generators "on the fly" for the designed processors and +loads them in to the compiler backend as runtime libraries to avoid +per-target recompilation of larger parts of the compiler chain. Additional Information ====================== Modified: vendor/llvm/dist/include/llvm/IR/LegacyPassManagers.h ============================================================================== --- vendor/llvm/dist/include/llvm/IR/LegacyPassManagers.h Sat Jan 31 19:18:09 2015 (r277991) +++ vendor/llvm/dist/include/llvm/IR/LegacyPassManagers.h Sat Jan 31 19:27:28 2015 (r277992) @@ -195,6 +195,9 @@ public: /// then return NULL. Pass *findAnalysisPass(AnalysisID AID); + /// Retrieve the PassInfo for an analysis. + const PassInfo *findAnalysisPassInfo(AnalysisID AID) const; + /// Find analysis usage information for the pass P. AnalysisUsage *findAnalysisUsage(Pass *P); @@ -251,6 +254,12 @@ private: SmallVector ImmutablePasses; DenseMap AnUsageMap; + + /// Collection of PassInfo objects found via analysis IDs and in this top + /// level manager. This is used to memoize queries to the pass registry. + /// FIXME: This is an egregious hack because querying the pass registry is + /// either slow or racy. + mutable DenseMap AnalysisPassInfos; }; Modified: vendor/llvm/dist/include/llvm/MC/MCAsmBackend.h ============================================================================== --- vendor/llvm/dist/include/llvm/MC/MCAsmBackend.h Sat Jan 31 19:18:09 2015 (r277991) +++ vendor/llvm/dist/include/llvm/MC/MCAsmBackend.h Sat Jan 31 19:27:28 2015 (r277992) @@ -61,6 +61,12 @@ public: /// markers. If not, data region directives will be ignored. bool hasDataInCodeSupport() const { return HasDataInCodeSupport; } + /// doesSectionRequireSymbols - Check whether the given section requires that + /// all symbols (even temporaries) have symbol table entries. + virtual bool doesSectionRequireSymbols(const MCSection &Section) const { + return false; + } + /// @name Target Fixup Interfaces /// @{ Modified: vendor/llvm/dist/include/llvm/MC/MCAssembler.h ============================================================================== --- vendor/llvm/dist/include/llvm/MC/MCAssembler.h Sat Jan 31 19:18:09 2015 (r277991) +++ vendor/llvm/dist/include/llvm/MC/MCAssembler.h Sat Jan 31 19:27:28 2015 (r277992) @@ -11,7 +11,6 @@ #define LLVM_MC_MCASSEMBLER_H #include "llvm/ADT/DenseMap.h" -#include "llvm/ADT/DenseSet.h" #include "llvm/ADT/PointerIntPair.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallString.h" @@ -882,8 +881,6 @@ private: iplist Symbols; - DenseSet LocalsUsedInReloc; - /// The map of sections to their associated assembler backend data. // // FIXME: Avoid this indirection? @@ -983,9 +980,6 @@ private: MCFragment &F, const MCFixup &Fixup); public: - void addLocalUsedInReloc(const MCSymbol &Sym); - bool isLocalUsedInReloc(const MCSymbol &Sym) const; - /// Compute the effective fragment size assuming it is laid out at the given /// \p SectionAddress and \p FragmentOffset. uint64_t computeFragmentSize(const MCAsmLayout &Layout, Modified: vendor/llvm/dist/include/llvm/MC/MCMachObjectWriter.h ============================================================================== --- vendor/llvm/dist/include/llvm/MC/MCMachObjectWriter.h Sat Jan 31 19:18:09 2015 (r277991) +++ vendor/llvm/dist/include/llvm/MC/MCMachObjectWriter.h Sat Jan 31 19:27:28 2015 (r277992) @@ -68,10 +68,12 @@ public: /// @name API /// @{ - virtual void RecordRelocation(MachObjectWriter *Writer, MCAssembler &Asm, + virtual void RecordRelocation(MachObjectWriter *Writer, + const MCAssembler &Asm, const MCAsmLayout &Layout, const MCFragment *Fragment, - const MCFixup &Fixup, MCValue Target, + const MCFixup &Fixup, + MCValue Target, uint64_t &FixedValue) = 0; /// @} @@ -95,14 +97,8 @@ class MachObjectWriter : public MCObject /// @name Relocation Data /// @{ - struct RelAndSymbol { - const MCSymbolData *Sym; - MachO::any_relocation_info MRE; - RelAndSymbol(const MCSymbolData *Sym, const MachO::any_relocation_info &MRE) - : Sym(Sym), MRE(MRE) {} - }; - - llvm::DenseMap> Relocations; + llvm::DenseMap > Relocations; llvm::DenseMap IndirectSymBase; /// @} @@ -217,15 +213,9 @@ public: // - Input errors, where something cannot be correctly encoded. 'as' allows // these through in many cases. - // Add a relocation to be output in the object file. At the time this is - // called, the symbol indexes are not know, so if the relocation refers - // to a symbol it should be passed as \p RelSymbol so that it can be updated - // afterwards. If the relocation doesn't refer to a symbol, nullptr should be - // used. - void addRelocation(const MCSymbolData *RelSymbol, const MCSectionData *SD, + void addRelocation(const MCSectionData *SD, MachO::any_relocation_info &MRE) { - RelAndSymbol P(RelSymbol, MRE); - Relocations[SD].push_back(P); + Relocations[SD].push_back(MRE); } void RecordScatteredRelocation(const MCAssembler &Asm, @@ -241,7 +231,7 @@ public: const MCFixup &Fixup, MCValue Target, uint64_t &FixedValue); - void RecordRelocation(MCAssembler &Asm, const MCAsmLayout &Layout, + void RecordRelocation(const MCAssembler &Asm, const MCAsmLayout &Layout, const MCFragment *Fragment, const MCFixup &Fixup, MCValue Target, bool &IsPCRel, uint64_t &FixedValue) override; Modified: vendor/llvm/dist/include/llvm/MC/MCObjectWriter.h ============================================================================== --- vendor/llvm/dist/include/llvm/MC/MCObjectWriter.h Sat Jan 31 19:18:09 2015 (r277991) +++ vendor/llvm/dist/include/llvm/MC/MCObjectWriter.h Sat Jan 31 19:27:28 2015 (r277992) @@ -76,10 +76,12 @@ public: /// post layout binding. The implementation is responsible for storing /// information about the relocation so that it can be emitted during /// WriteObject(). - virtual void RecordRelocation(MCAssembler &Asm, const MCAsmLayout &Layout, + virtual void RecordRelocation(const MCAssembler &Asm, + const MCAsmLayout &Layout, const MCFragment *Fragment, const MCFixup &Fixup, MCValue Target, - bool &IsPCRel, uint64_t &FixedValue) = 0; + bool &IsPCRel, + uint64_t &FixedValue) = 0; /// \brief Check whether the difference (A - B) between two symbol /// references is fully resolved. Modified: vendor/llvm/dist/include/llvm/Transforms/Utils/SimplifyLibCalls.h ============================================================================== --- vendor/llvm/dist/include/llvm/Transforms/Utils/SimplifyLibCalls.h Sat Jan 31 19:18:09 2015 (r277991) +++ vendor/llvm/dist/include/llvm/Transforms/Utils/SimplifyLibCalls.h Sat Jan 31 19:27:28 2015 (r277992) @@ -17,6 +17,7 @@ #include "llvm/ADT/StringRef.h" #include "llvm/IR/IRBuilder.h" +#include "llvm/Target/TargetLibraryInfo.h" namespace llvm { class Value; @@ -53,8 +54,10 @@ private: Value *optimizeMemCpyChk(CallInst *CI, IRBuilder<> &B); Value *optimizeMemMoveChk(CallInst *CI, IRBuilder<> &B); Value *optimizeMemSetChk(CallInst *CI, IRBuilder<> &B); - Value *optimizeStrCpyChk(CallInst *CI, IRBuilder<> &B); - Value *optimizeStrNCpyChk(CallInst *CI, IRBuilder<> &B); + + // Str/Stp cpy are similar enough to be handled in the same functions. + Value *optimizeStrpCpyChk(CallInst *CI, IRBuilder<> &B, LibFunc::Func Func); + Value *optimizeStrpNCpyChk(CallInst *CI, IRBuilder<> &B, LibFunc::Func Func); /// \brief Checks whether the call \p CI to a fortified libcall is foldable /// to the non-fortified version. Modified: vendor/llvm/dist/lib/Analysis/ScalarEvolution.cpp ============================================================================== --- vendor/llvm/dist/lib/Analysis/ScalarEvolution.cpp Sat Jan 31 19:18:09 2015 (r277991) +++ vendor/llvm/dist/lib/Analysis/ScalarEvolution.cpp Sat Jan 31 19:27:28 2015 (r277992) @@ -3154,8 +3154,9 @@ const SCEV *ScalarEvolution::getMinusSCE if (LHS == RHS) return getConstant(LHS->getType(), 0); - // X - Y --> X + -Y - return getAddExpr(LHS, getNegativeSCEV(RHS), Flags); + // X - Y --> X + -Y. + // X -(nsw || nuw) Y --> X + -Y. + return getAddExpr(LHS, getNegativeSCEV(RHS)); } /// getTruncateOrZeroExtend - Return a SCEV corresponding to a conversion of the @@ -3461,12 +3462,10 @@ const SCEV *ScalarEvolution::createNodeF if (isKnownPositive(getMinusSCEV(getSCEV(GEP), Ptr))) Flags = setFlags(Flags, SCEV::FlagNUW); } - } else if (const SubOperator *OBO = - dyn_cast(BEValueV)) { - if (OBO->hasNoUnsignedWrap()) - Flags = setFlags(Flags, SCEV::FlagNUW); - if (OBO->hasNoSignedWrap()) - Flags = setFlags(Flags, SCEV::FlagNSW); + + // We cannot transfer nuw and nsw flags from subtraction + // operations -- sub nuw X, Y is not the same as add nuw X, -Y + // for instance. } const SCEV *StartVal = getSCEV(StartValueV); Modified: vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfUnit.cpp ============================================================================== --- vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfUnit.cpp Sat Jan 31 19:18:09 2015 (r277991) +++ vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfUnit.cpp Sat Jan 31 19:27:28 2015 (r277992) @@ -626,10 +626,7 @@ static uint64_t getBaseTypeSize(DwarfDeb DIType BaseType = DD->resolve(Ty.getTypeDerivedFrom()); - // If this type is not derived from any type or the type is a declaration then - // take conservative approach. - if (!BaseType.isValid() || BaseType.isForwardDecl()) - return Ty.getSizeInBits(); + assert(BaseType.isValid()); // If this is a derived type, go ahead and get the base type, unless it's a // reference then it's just the size of the field. Pointer types have no need @@ -1473,7 +1470,7 @@ void DwarfUnit::constructMemberDIE(DIE & uint64_t FieldSize = getBaseTypeSize(DD, DT); uint64_t OffsetInBytes; - if (Size != FieldSize) { + if (FieldSize && Size != FieldSize) { // Handle bitfield, assume bytes are 8 bits. addUInt(MemberDie, dwarf::DW_AT_byte_size, None, FieldSize/8); addUInt(MemberDie, dwarf::DW_AT_bit_size, None, Size); Modified: vendor/llvm/dist/lib/CodeGen/MachineFunctionPass.cpp ============================================================================== --- vendor/llvm/dist/lib/CodeGen/MachineFunctionPass.cpp Sat Jan 31 19:18:09 2015 (r277991) +++ vendor/llvm/dist/lib/CodeGen/MachineFunctionPass.cpp Sat Jan 31 19:27:28 2015 (r277992) @@ -11,11 +11,19 @@ // //===----------------------------------------------------------------------===// -#include "llvm/IR/Function.h" +#include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/Analysis/AliasAnalysis.h" +#include "llvm/Analysis/DominanceFrontier.h" +#include "llvm/Analysis/IVUsers.h" +#include "llvm/Analysis/LoopInfo.h" +#include "llvm/Analysis/LoopInfo.h" +#include "llvm/Analysis/MemoryDependenceAnalysis.h" +#include "llvm/Analysis/ScalarEvolution.h" #include "llvm/CodeGen/MachineFunctionAnalysis.h" -#include "llvm/CodeGen/MachineFunctionPass.h" #include "llvm/CodeGen/Passes.h" +#include "llvm/CodeGen/StackProtector.h" +#include "llvm/IR/Dominators.h" +#include "llvm/IR/Function.h" using namespace llvm; Pass *MachineFunctionPass::createPrinterPass(raw_ostream &O, @@ -43,15 +51,13 @@ void MachineFunctionPass::getAnalysisUsa // because CodeGen overloads that to mean preserving the MachineBasicBlock // CFG in addition to the LLVM IR CFG. AU.addPreserved(); - AU.addPreserved("scalar-evolution"); - AU.addPreserved("iv-users"); - AU.addPreserved("memdep"); - AU.addPreserved("live-values"); - AU.addPreserved("domtree"); - AU.addPreserved("domfrontier"); - AU.addPreserved("loops"); - AU.addPreserved("lda"); - AU.addPreserved("stack-protector"); + AU.addPreserved(); + AU.addPreserved(); + AU.addPreserved(); + AU.addPreserved(); + AU.addPreserved(); + AU.addPreserved(); + AU.addPreserved(); FunctionPass::getAnalysisUsage(AU); } Modified: vendor/llvm/dist/lib/IR/Core.cpp ============================================================================== --- vendor/llvm/dist/lib/IR/Core.cpp Sat Jan 31 19:18:09 2015 (r277991) +++ vendor/llvm/dist/lib/IR/Core.cpp Sat Jan 31 19:27:28 2015 (r277992) @@ -563,9 +563,23 @@ LLVMValueRef LLVMGetMetadata(LLVMValueRe return nullptr; } -void LLVMSetMetadata(LLVMValueRef Inst, unsigned KindID, LLVMValueRef MD) { - MDNode *N = - MD ? cast(unwrap(MD)->getMetadata()) : nullptr; +// MetadataAsValue uses a canonical format which strips the actual MDNode for +// MDNode with just a single constant value, storing just a ConstantAsMetadata +// This undoes this canonicalization, reconstructing the MDNode. +static MDNode *extractMDNode(MetadataAsValue *MAV) { + Metadata *MD = MAV->getMetadata(); + assert((isa(MD) || isa(MD)) && + "Expected a metadata node or a canonicalized constant"); + + if (MDNode *N = dyn_cast(MD)) + return N; + + return MDNode::get(MAV->getContext(), MD); +} + +void LLVMSetMetadata(LLVMValueRef Inst, unsigned KindID, LLVMValueRef Val) { + MDNode *N = Val ? extractMDNode(unwrap(Val)) : nullptr; + unwrap(Inst)->setMetadata(KindID, N); } @@ -795,7 +809,7 @@ void LLVMAddNamedMetadataOperand(LLVMMod return; if (!Val) return; - N->addOperand(cast(unwrap(Val)->getMetadata())); + N->addOperand(extractMDNode(unwrap(Val))); } /*--.. Operations on scalar constants ......................................--*/ Modified: vendor/llvm/dist/lib/IR/LegacyPassManager.cpp ============================================================================== --- vendor/llvm/dist/lib/IR/LegacyPassManager.cpp Sat Jan 31 19:18:09 2015 (r277991) +++ vendor/llvm/dist/lib/IR/LegacyPassManager.cpp Sat Jan 31 19:27:28 2015 (r277992) @@ -600,8 +600,7 @@ void PMTopLevelManager::schedulePass(Pas // If P is an analysis pass and it is available then do not // generate the analysis again. Stale analysis info should not be // available at this point. - const PassInfo *PI = - PassRegistry::getPassRegistry()->getPassInfo(P->getPassID()); + const PassInfo *PI = findAnalysisPassInfo(P->getPassID()); if (PI && PI->isAnalysis() && findAnalysisPass(P->getPassID())) { delete P; return; @@ -619,7 +618,7 @@ void PMTopLevelManager::schedulePass(Pas Pass *AnalysisPass = findAnalysisPass(*I); if (!AnalysisPass) { - const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(*I); + const PassInfo *PI = findAnalysisPassInfo(*I); if (!PI) { // Pass P is not in the global PassRegistry @@ -716,8 +715,7 @@ Pass *PMTopLevelManager::findAnalysisPas return *I; // If Pass not found then check the interfaces implemented by Immutable Pass - const PassInfo *PassInf = - PassRegistry::getPassRegistry()->getPassInfo(PI); + const PassInfo *PassInf = findAnalysisPassInfo(PI); assert(PassInf && "Expected all immutable passes to be initialized"); const std::vector &ImmPI = PassInf->getInterfacesImplemented(); @@ -731,6 +729,17 @@ Pass *PMTopLevelManager::findAnalysisPas return nullptr; } +const PassInfo *PMTopLevelManager::findAnalysisPassInfo(AnalysisID AID) const { + const PassInfo *&PI = AnalysisPassInfos[AID]; + if (!PI) + PI = PassRegistry::getPassRegistry()->getPassInfo(AID); + else + assert(PI == PassRegistry::getPassRegistry()->getPassInfo(AID) && + "The pass info pointer changed for an analysis ID!"); + + return PI; +} + // Print passes managed by this top level manager. void PMTopLevelManager::dumpPasses() const { @@ -759,8 +768,7 @@ void PMTopLevelManager::dumpArguments() dbgs() << "Pass Arguments: "; for (SmallVectorImpl::const_iterator I = ImmutablePasses.begin(), E = ImmutablePasses.end(); I != E; ++I) - if (const PassInfo *PI = - PassRegistry::getPassRegistry()->getPassInfo((*I)->getPassID())) { + if (const PassInfo *PI = findAnalysisPassInfo((*I)->getPassID())) { assert(PI && "Expected all immutable passes to be initialized"); if (!PI->isAnalysisGroup()) dbgs() << " -" << PI->getPassArgument(); @@ -824,7 +832,7 @@ void PMDataManager::recordAvailableAnaly // This pass is the current implementation of all of the interfaces it // implements as well. - const PassInfo *PInf = PassRegistry::getPassRegistry()->getPassInfo(PI); + const PassInfo *PInf = TPM->findAnalysisPassInfo(PI); if (!PInf) return; const std::vector &II = PInf->getInterfacesImplemented(); for (unsigned i = 0, e = II.size(); i != e; ++i) @@ -957,7 +965,7 @@ void PMDataManager::freePass(Pass *P, St } AnalysisID PI = P->getPassID(); - if (const PassInfo *PInf = PassRegistry::getPassRegistry()->getPassInfo(PI)) { + if (const PassInfo *PInf = TPM->findAnalysisPassInfo(PI)) { // Remove the pass itself (if it is not already removed). AvailableAnalysis.erase(PI); @@ -1037,7 +1045,7 @@ void PMDataManager::add(Pass *P, bool Pr for (SmallVectorImpl::iterator I = ReqAnalysisNotAvailable.begin(), E = ReqAnalysisNotAvailable.end() ;I != E; ++I) { - const PassInfo *PI = PassRegistry::getPassRegistry()->getPassInfo(*I); + const PassInfo *PI = TPM->findAnalysisPassInfo(*I); Pass *AnalysisPass = PI->createPass(); this->addLowerLevelRequiredPass(P, AnalysisPass); } @@ -1142,7 +1150,7 @@ void PMDataManager::dumpPassArguments() PMD->dumpPassArguments(); else if (const PassInfo *PI = - PassRegistry::getPassRegistry()->getPassInfo((*I)->getPassID())) + TPM->findAnalysisPassInfo((*I)->getPassID())) if (!PI->isAnalysisGroup()) dbgs() << " -" << PI->getPassArgument(); } @@ -1218,7 +1226,7 @@ void PMDataManager::dumpAnalysisUsage(St dbgs() << (const void*)P << std::string(getDepth()*2+3, ' ') << Msg << " Analyses:"; for (unsigned i = 0; i != Set.size(); ++i) { if (i) dbgs() << ','; - const PassInfo *PInf = PassRegistry::getPassRegistry()->getPassInfo(Set[i]); + const PassInfo *PInf = TPM->findAnalysisPassInfo(Set[i]); if (!PInf) { // Some preserved passes, such as AliasAnalysis, may not be initialized by // all drivers. @@ -1658,8 +1666,8 @@ void MPPassManager::addLowerLevelRequire OnTheFlyManagers[P] = FPP; } - const PassInfo * RequiredPassPI = - PassRegistry::getPassRegistry()->getPassInfo(RequiredPass->getPassID()); + const PassInfo *RequiredPassPI = + TPM->findAnalysisPassInfo(RequiredPass->getPassID()); Pass *FoundPass = nullptr; if (RequiredPassPI && RequiredPassPI->isAnalysis()) { Modified: vendor/llvm/dist/lib/MC/ELFObjectWriter.cpp ============================================================================== --- vendor/llvm/dist/lib/MC/ELFObjectWriter.cpp Sat Jan 31 19:18:09 2015 (r277991) +++ vendor/llvm/dist/lib/MC/ELFObjectWriter.cpp Sat Jan 31 19:27:28 2015 (r277992) @@ -219,7 +219,7 @@ class ELFObjectWriter : public MCObjectW const MCSymbolData *SD, uint64_t C, unsigned Type) const; - void RecordRelocation(MCAssembler &Asm, const MCAsmLayout &Layout, + void RecordRelocation(const MCAssembler &Asm, const MCAsmLayout &Layout, const MCFragment *Fragment, const MCFixup &Fixup, MCValue Target, bool &IsPCRel, uint64_t &FixedValue) override; @@ -789,11 +789,13 @@ static const MCSymbol *getWeakRef(const return nullptr; } -void ELFObjectWriter::RecordRelocation(MCAssembler &Asm, +void ELFObjectWriter::RecordRelocation(const MCAssembler &Asm, const MCAsmLayout &Layout, const MCFragment *Fragment, - const MCFixup &Fixup, MCValue Target, - bool &IsPCRel, uint64_t &FixedValue) { + const MCFixup &Fixup, + MCValue Target, + bool &IsPCRel, + uint64_t &FixedValue) { const MCSectionData *FixupSection = Fragment->getParent(); uint64_t C = Target.getConstant(); uint64_t FixupOffset = Layout.getFragmentOffset(Fragment) + Fixup.getOffset(); Modified: vendor/llvm/dist/lib/MC/MCAsmInfoDarwin.cpp ============================================================================== --- vendor/llvm/dist/lib/MC/MCAsmInfoDarwin.cpp Sat Jan 31 19:18:09 2015 (r277991) +++ vendor/llvm/dist/lib/MC/MCAsmInfoDarwin.cpp Sat Jan 31 19:27:28 2015 (r277992) @@ -27,7 +27,22 @@ bool MCAsmInfoDarwin::isSectionAtomizabl // contain. // Sections holding 2 byte strings require symbols in order to be atomized. // There is no dedicated section for 4 byte strings. - if (SMO.getType() == MachO::S_CSTRING_LITERALS) + if (SMO.getKind().isMergeable1ByteCString()) + return false; + + if (SMO.getSegmentName() == "__TEXT" && + SMO.getSectionName() == "__objc_classname" && + SMO.getType() == MachO::S_CSTRING_LITERALS) + return false; + + if (SMO.getSegmentName() == "__TEXT" && + SMO.getSectionName() == "__objc_methname" && + SMO.getType() == MachO::S_CSTRING_LITERALS) + return false; + + if (SMO.getSegmentName() == "__TEXT" && + SMO.getSectionName() == "__objc_methtype" && + SMO.getType() == MachO::S_CSTRING_LITERALS) return false; if (SMO.getSegmentName() == "__DATA" && SMO.getSectionName() == "__cfstring") Modified: vendor/llvm/dist/lib/MC/MCAssembler.cpp ============================================================================== --- vendor/llvm/dist/lib/MC/MCAssembler.cpp Sat Jan 31 19:18:09 2015 (r277991) +++ vendor/llvm/dist/lib/MC/MCAssembler.cpp Sat Jan 31 19:27:28 2015 (r277992) @@ -425,16 +425,6 @@ bool MCAssembler::isThumbFunc(const MCSy return true; } -void MCAssembler::addLocalUsedInReloc(const MCSymbol &Sym) { - assert(Sym.isTemporary()); - LocalsUsedInReloc.insert(&Sym); -} - -bool MCAssembler::isLocalUsedInReloc(const MCSymbol &Sym) const { - assert(Sym.isTemporary()); - return LocalsUsedInReloc.count(&Sym); -} - bool MCAssembler::isSymbolLinkerVisible(const MCSymbol &Symbol) const { // Non-temporary labels should always be visible to the linker. if (!Symbol.isTemporary()) @@ -444,10 +434,8 @@ bool MCAssembler::isSymbolLinkerVisible( if (!Symbol.isInSection()) return false; - if (isLocalUsedInReloc(Symbol)) - return true; - - return false; + // Otherwise, check if the section requires symbols even for temporary labels. + return getBackend().doesSectionRequireSymbols(Symbol.getSection()); } const MCSymbolData *MCAssembler::getAtom(const MCSymbolData *SD) const { Modified: vendor/llvm/dist/lib/MC/MachObjectWriter.cpp ============================================================================== --- vendor/llvm/dist/lib/MC/MachObjectWriter.cpp Sat Jan 31 19:18:09 2015 (r277991) +++ vendor/llvm/dist/lib/MC/MachObjectWriter.cpp Sat Jan 31 19:27:28 2015 (r277992) @@ -448,11 +448,14 @@ void MachObjectWriter::WriteLinkerOption assert(OS.tell() - Start == Size); } -void MachObjectWriter::RecordRelocation(MCAssembler &Asm, + +void MachObjectWriter::RecordRelocation(const MCAssembler &Asm, const MCAsmLayout &Layout, const MCFragment *Fragment, - const MCFixup &Fixup, MCValue Target, - bool &IsPCRel, uint64_t &FixedValue) { + const MCFixup &Fixup, + MCValue Target, + bool &IsPCRel, + uint64_t &FixedValue) { TargetObjectWriter->RecordRelocation(this, Asm, Layout, Fragment, Fixup, Target, FixedValue); } @@ -613,22 +616,6 @@ void MachObjectWriter::ComputeSymbolTabl ExternalSymbolData[i].SymbolData->setIndex(Index++); for (unsigned i = 0, e = UndefinedSymbolData.size(); i != e; ++i) UndefinedSymbolData[i].SymbolData->setIndex(Index++); - - for (const MCSectionData &SD : Asm) { - std::vector &Relocs = Relocations[&SD]; - for (RelAndSymbol &Rel : Relocs) { - if (!Rel.Sym) - continue; - - // Set the Index and the IsExtern bit. - unsigned Index = Rel.Sym->getIndex(); - assert(isInt<24>(Index)); - if (IsLittleEndian) - Rel.MRE.r_word1 = (Rel.MRE.r_word1 & (-1 << 24)) | Index | (1 << 27); - else - Rel.MRE.r_word1 = (Rel.MRE.r_word1 & 0xff) | Index << 8 | (1 << 4); - } - } } void MachObjectWriter::computeSectionAddresses(const MCAssembler &Asm, @@ -675,6 +662,10 @@ void MachObjectWriter::ExecutePostLayout // Mark symbol difference expressions in variables (from .set or = directives) // as absolute. markAbsoluteVariableSymbols(Asm, Layout); + + // Compute symbol table information and bind symbol indices. + ComputeSymbolTable(Asm, LocalSymbolData, ExternalSymbolData, + UndefinedSymbolData); } bool MachObjectWriter:: @@ -758,10 +749,6 @@ IsSymbolRefDifferenceFullyResolvedImpl(c void MachObjectWriter::WriteObject(MCAssembler &Asm, const MCAsmLayout &Layout) { - // Compute symbol table information and bind symbol indices. - ComputeSymbolTable(Asm, LocalSymbolData, ExternalSymbolData, - UndefinedSymbolData); - unsigned NumSections = Asm.size(); const MCAssembler::VersionMinInfoType &VersionInfo = Layout.getAssembler().getVersionMinInfo(); @@ -852,7 +839,7 @@ void MachObjectWriter::WriteObject(MCAss uint64_t RelocTableEnd = SectionDataStart + SectionDataFileSize; for (MCAssembler::const_iterator it = Asm.begin(), ie = Asm.end(); it != ie; ++it) { - std::vector &Relocs = Relocations[it]; + std::vector &Relocs = Relocations[it]; unsigned NumRelocs = Relocs.size(); uint64_t SectionStart = SectionDataStart + getSectionAddress(it); WriteSection(Asm, Layout, *it, SectionStart, RelocTableEnd, NumRelocs); @@ -946,10 +933,10 @@ void MachObjectWriter::WriteObject(MCAss ie = Asm.end(); it != ie; ++it) { // Write the section relocation entries, in reverse order to match 'as' // (approximately, the exact algorithm is more complicated than this). - std::vector &Relocs = Relocations[it]; + std::vector &Relocs = Relocations[it]; for (unsigned i = 0, e = Relocs.size(); i != e; ++i) { - Write32(Relocs[e - i - 1].MRE.r_word0); - Write32(Relocs[e - i - 1].MRE.r_word1); + Write32(Relocs[e - i - 1].r_word0); + Write32(Relocs[e - i - 1].r_word1); } } Modified: vendor/llvm/dist/lib/MC/WinCOFFObjectWriter.cpp ============================================================================== --- vendor/llvm/dist/lib/MC/WinCOFFObjectWriter.cpp Sat Jan 31 19:18:09 2015 (r277991) +++ vendor/llvm/dist/lib/MC/WinCOFFObjectWriter.cpp Sat Jan 31 19:27:28 2015 (r277992) @@ -175,7 +175,7 @@ public: const MCFragment &FB, bool InSet, bool IsPCRel) const override; - void RecordRelocation(MCAssembler &Asm, const MCAsmLayout &Layout, + void RecordRelocation(const MCAssembler &Asm, const MCAsmLayout &Layout, const MCFragment *Fragment, const MCFixup &Fixup, MCValue Target, bool &IsPCRel, uint64_t &FixedValue) override; @@ -661,9 +661,13 @@ bool WinCOFFObjectWriter::IsSymbolRefDif InSet, IsPCRel); } -void WinCOFFObjectWriter::RecordRelocation( - MCAssembler &Asm, const MCAsmLayout &Layout, const MCFragment *Fragment, - const MCFixup &Fixup, MCValue Target, bool &IsPCRel, uint64_t &FixedValue) { +void WinCOFFObjectWriter::RecordRelocation(const MCAssembler &Asm, + const MCAsmLayout &Layout, + const MCFragment *Fragment, + const MCFixup &Fixup, + MCValue Target, + bool &IsPCRel, + uint64_t &FixedValue) { assert(Target.getSymA() && "Relocation must reference a symbol!"); const MCSymbol &Symbol = Target.getSymA()->getSymbol(); Modified: vendor/llvm/dist/lib/Support/Triple.cpp ============================================================================== --- vendor/llvm/dist/lib/Support/Triple.cpp Sat Jan 31 19:18:09 2015 (r277991) +++ vendor/llvm/dist/lib/Support/Triple.cpp Sat Jan 31 19:27:28 2015 (r277992) @@ -246,13 +246,21 @@ static Triple::ArchType parseARMArch(Str if (ArchName.startswith("armv")) { offset = 3; - arch = Triple::arm; + if (ArchName.endswith("eb")) { + arch = Triple::armeb; + ArchName = ArchName.substr(0, ArchName.size() - 2); + } else + arch = Triple::arm; } else if (ArchName.startswith("armebv")) { offset = 5; arch = Triple::armeb; } else if (ArchName.startswith("thumbv")) { offset = 5; - arch = Triple::thumb; + if (ArchName.endswith("eb")) { + arch = Triple::thumbeb; + ArchName = ArchName.substr(0, ArchName.size() - 2); + } else + arch = Triple::thumb; } else if (ArchName.startswith("thumbebv")) { offset = 7; arch = Triple::thumbeb; @@ -271,6 +279,8 @@ static Triple::ArchType parseARMArch(Str } static Triple::ArchType parseArch(StringRef ArchName) { + Triple::ArchType ARMArch(parseARMArch(ArchName)); + return StringSwitch(ArchName) .Cases("i386", "i486", "i586", "i686", Triple::x86) // FIXME: Do we need to support these? @@ -280,9 +290,10 @@ static Triple::ArchType parseArch(String .Cases("powerpc64", "ppu", Triple::ppc64) .Case("powerpc64le", Triple::ppc64le) .Case("xscale", Triple::arm) - .StartsWith("arm", parseARMArch(ArchName)) - .StartsWith("thumb", parseARMArch(ArchName)) - .StartsWith("aarch64", parseARMArch(ArchName)) + .Case("xscaleeb", Triple::armeb) + .StartsWith("arm", ARMArch) + .StartsWith("thumb", ARMArch) + .StartsWith("aarch64", ARMArch) .Case("msp430", Triple::msp430) .Cases("mips", "mipseb", "mipsallegrex", Triple::mips) .Cases("mipsel", "mipsallegrexel", Triple::mipsel) @@ -379,6 +390,9 @@ static Triple::ObjectFormatType parseFor } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@FreeBSD.ORG Sat Jan 31 19:28:42 2015 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 482ECAFB; Sat, 31 Jan 2015 19:28:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1AA08BC; Sat, 31 Jan 2015 19:28:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0VJSfOR048537; Sat, 31 Jan 2015 19:28:41 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0VJSfSq048536; Sat, 31 Jan 2015 19:28:41 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201501311928.t0VJSfSq048536@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 31 Jan 2015 19:28:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r277993 - vendor/llvm/llvm-release_360-r227651 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Jan 2015 19:28:42 -0000 Author: dim Date: Sat Jan 31 19:28:41 2015 New Revision: 277993 URL: https://svnweb.freebsd.org/changeset/base/277993 Log: Tag llvm tags/RELEASE_360/rc2 r227651 (effectively, 3.6.0 RC2). Added: vendor/llvm/llvm-release_360-r227651/ - copied from r277992, vendor/llvm/dist/ From owner-svn-src-vendor@FreeBSD.ORG Sat Jan 31 19:29:07 2015 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9346CC1B; Sat, 31 Jan 2015 19:29:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7AFF4C0; Sat, 31 Jan 2015 19:29:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0VJT7dQ048668; Sat, 31 Jan 2015 19:29:07 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0VJT0dO048628; Sat, 31 Jan 2015 19:29:00 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201501311929.t0VJT0dO048628@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 31 Jan 2015 19:29:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r277994 - in vendor/clang/dist: docs include/clang/Basic include/clang/Driver include/clang/Sema lib/Basic lib/CodeGen lib/Driver lib/Sema lib/Tooling test/CodeGen test/CodeGenCXX test/... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Jan 2015 19:29:07 -0000 Author: dim Date: Sat Jan 31 19:28:59 2015 New Revision: 277994 URL: https://svnweb.freebsd.org/changeset/base/277994 Log: Vendor import of clang RELEASE_360/rc2 tag r227651 (effectively, 3.6.0 RC2): https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_360/rc2@227651 Added: vendor/clang/dist/test/Driver/aarch64-fixed-x18.c (contents, props changed) vendor/clang/dist/test/Modules/Inputs/System/usr/include/malloc.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/System/usr/include/stdlib.h (contents, props changed) Deleted: vendor/clang/dist/test/Sema/attr-flag-enum.c vendor/clang/dist/test/SemaCXX/attr-flag-enum-reject.cpp Modified: vendor/clang/dist/docs/ReleaseNotes.rst vendor/clang/dist/include/clang/Basic/Attr.td vendor/clang/dist/include/clang/Basic/AttrDocs.td vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td vendor/clang/dist/include/clang/Driver/Options.td vendor/clang/dist/include/clang/Sema/AttributeList.h vendor/clang/dist/include/clang/Sema/Sema.h vendor/clang/dist/include/clang/Sema/SemaInternal.h vendor/clang/dist/lib/Basic/Targets.cpp vendor/clang/dist/lib/CodeGen/CGDecl.cpp vendor/clang/dist/lib/CodeGen/CGDeclCXX.cpp vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp vendor/clang/dist/lib/CodeGen/ItaniumCXXABI.cpp vendor/clang/dist/lib/CodeGen/MicrosoftCXXABI.cpp vendor/clang/dist/lib/Driver/Tools.cpp vendor/clang/dist/lib/Driver/Tools.h vendor/clang/dist/lib/Sema/SemaChecking.cpp vendor/clang/dist/lib/Sema/SemaDecl.cpp vendor/clang/dist/lib/Sema/SemaDeclAttr.cpp vendor/clang/dist/lib/Sema/SemaExpr.cpp vendor/clang/dist/lib/Sema/SemaExprCXX.cpp vendor/clang/dist/lib/Sema/SemaLookup.cpp vendor/clang/dist/lib/Sema/SemaStmt.cpp vendor/clang/dist/lib/Sema/SemaStmtAsm.cpp vendor/clang/dist/lib/Tooling/ArgumentsAdjusters.cpp vendor/clang/dist/test/CodeGen/ms-declspecs.c vendor/clang/dist/test/CodeGenCXX/cxx11-exception-spec.cpp vendor/clang/dist/test/CodeGenCXX/dllexport-members.cpp vendor/clang/dist/test/CodeGenCXX/dllexport.cpp vendor/clang/dist/test/CodeGenCXX/dllimport.cpp vendor/clang/dist/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp vendor/clang/dist/test/CodeGenCXX/ms-integer-static-data-members-exported.cpp vendor/clang/dist/test/CodeGenCXX/ms-integer-static-data-members.cpp vendor/clang/dist/test/CodeGenCXX/split-stacks.cpp vendor/clang/dist/test/CodeGenCXX/static-init.cpp vendor/clang/dist/test/Driver/linux-ld.c vendor/clang/dist/test/Driver/netbsd.c vendor/clang/dist/test/FixIt/typo-location-bugs.cpp vendor/clang/dist/test/Modules/compiler_builtins.m vendor/clang/dist/test/Preprocessor/init.c vendor/clang/dist/test/Preprocessor/stdint.c vendor/clang/dist/test/Sema/atomic-ops.c vendor/clang/dist/test/Sema/inline-asm-validate-x86.c vendor/clang/dist/test/Sema/typo-correction.c vendor/clang/dist/test/SemaCXX/typo-correction-delayed.cpp vendor/clang/dist/utils/TableGen/ClangAttrEmitter.cpp Modified: vendor/clang/dist/docs/ReleaseNotes.rst ============================================================================== --- vendor/clang/dist/docs/ReleaseNotes.rst Sat Jan 31 19:28:41 2015 (r277993) +++ vendor/clang/dist/docs/ReleaseNotes.rst Sat Jan 31 19:28:59 2015 (r277994) @@ -12,7 +12,7 @@ Written by the `LLVM Team `_. + `_. Introduction ============ @@ -53,9 +53,11 @@ Major New Features __has_declspec_attribute, this allows for more precise coverage of attribute syntax querying. +- clang-format now supports formatting Java code. + Improvements to Clang's diagnostics -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +----------------------------------- Clang's diagnostics are constantly being improved to catch more issues, explain them more clearly, and provide more accurate source information @@ -68,6 +70,21 @@ New Compiler Flags The option .... +The __EXCEPTIONS macro +---------------------- +``__EXCEPTIONS`` is now defined when landing pads are emitted, not when c++ exceptions are enabled. The two can be different in Objective-C files: If C++ exceptions are disabled but Objective-C exceptions are enabled, landing pads will be emitted. Clang 3.6 is switching the behavior of ``__EXCEPTIONS``. Clang 3.5 confusingly changed the behavior of ``has_feature(cxx_exceptions)``, which used to be set if landing pads were emitted, but is now set if C++ exceptions are enabled. So there are 3 cases: + +Clang before 3.5: + ``__EXCEPTIONS`` is set if C++ exceptions are enabled, ``cxx_exceptions`` enabled if C++ or ObjC exceptions are enabled + +Clang 3.5: + ``__EXCEPTIONS`` is set if C++ exceptions are enabled, ``cxx_exceptions`` enabled if C++ exceptions are enabled + +Clang 3.6: + ``__EXCEPTIONS`` is set if C++ or ObjC exceptions are enabled, ``cxx_exceptions`` enabled if C++ exceptions are enabled + +To reliably test if C++ exceptions are enabled, use ``__EXCEPTIONS && __has_feature(cxx_exceptions)``, else things won't work in all versions of clang in Objective-C++ files. + New Pragmas in Clang ----------------------- @@ -77,7 +94,9 @@ Clang now supports the ... Windows Support --------------- -Clang's support for building native Windows programs ... +- Many, many bug fixes + +- Basic support for DWARF debug information in COFF files C Language Changes in Clang @@ -93,7 +112,11 @@ C11 Feature Support C++ Language Changes in Clang ----------------------------- -- ... +- Clang now supports putting identical constructors and destructors in + the C5/D5 comdat, reducing code duplication. + +- Clang will put individual ``.init_array/.ctors`` sections in + comdats, reducing code duplication and speeding up startup. C++11 Feature Support ^^^^^^^^^^^^^^^^^^^^^ Modified: vendor/clang/dist/include/clang/Basic/Attr.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/Attr.td Sat Jan 31 19:28:41 2015 (r277993) +++ vendor/clang/dist/include/clang/Basic/Attr.td Sat Jan 31 19:28:59 2015 (r277994) @@ -224,14 +224,12 @@ class SubjectList subj string CustomDiag = customDiag; } -class LangOpt { +class LangOpt { string Name = name; - bit Negated = negated; } def MicrosoftExt : LangOpt<"MicrosoftExt">; def Borland : LangOpt<"Borland">; def CUDA : LangOpt<"CUDA">; -def COnly : LangOpt<"CPlusPlus", 1>; // Defines targets for target-specific attributes. The list of strings should // specify architectures for which the target applies, based off the ArchType @@ -709,25 +707,6 @@ def MinSize : InheritableAttr { let Documentation = [Undocumented]; } -def FlagEnum : InheritableAttr { - let Spellings = [GNU<"flag_enum">]; - let Subjects = SubjectList<[Enum]>; - let Documentation = [FlagEnumDocs]; - let LangOpts = [COnly]; - let AdditionalMembers = [{ -private: - llvm::APInt FlagBits; -public: - llvm::APInt &getFlagBits() { - return FlagBits; - } - - const llvm::APInt &getFlagBits() const { - return FlagBits; - } -}]; -} - def Flatten : InheritableAttr { let Spellings = [GCC<"flatten">]; let Subjects = SubjectList<[Function], ErrorDiag>; Modified: vendor/clang/dist/include/clang/Basic/AttrDocs.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/AttrDocs.td Sat Jan 31 19:28:41 2015 (r277993) +++ vendor/clang/dist/include/clang/Basic/AttrDocs.td Sat Jan 31 19:28:59 2015 (r277994) @@ -1196,16 +1196,6 @@ behavior of the program is undefined. }]; } -def FlagEnumDocs : Documentation { - let Category = DocCatType; - let Content = [{ -This attribute can be added to an enumerator to signal to the compiler that it -is intended to be used as a flag type. This will cause the compiler to assume -that the range of the type includes all of the values that you can get by -manipulating bits of the enumerator when issuing warnings. - }]; -} - def MSInheritanceDocs : Documentation { let Category = DocCatType; let Heading = "__single_inhertiance, __multiple_inheritance, __virtual_inheritance"; Modified: vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td Sat Jan 31 19:28:41 2015 (r277993) +++ vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td Sat Jan 31 19:28:59 2015 (r277994) @@ -190,7 +190,6 @@ def OverloadedShiftOpParentheses: DiagGr def DanglingElse: DiagGroup<"dangling-else">; def DanglingField : DiagGroup<"dangling-field">; def DistributedObjectModifiers : DiagGroup<"distributed-object-modifiers">; -def FlagEnum : DiagGroup<"flag-enum">; def InfiniteRecursion : DiagGroup<"infinite-recursion">; def GNUImaginaryConstant : DiagGroup<"gnu-imaginary-constant">; def IgnoredQualifiers : DiagGroup<"ignored-qualifiers">; Modified: vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Sat Jan 31 19:28:41 2015 (r277993) +++ vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Sat Jan 31 19:28:59 2015 (r277994) @@ -2236,7 +2236,7 @@ def warn_attribute_wrong_decl_type : War "%0 attribute only applies to %select{functions|unions|" "variables and functions|functions and methods|parameters|" "functions, methods and blocks|functions, methods, and classes|" - "functions, methods, and parameters|classes|enums|variables|methods|" + "functions, methods, and parameters|classes|variables|methods|" "variables, functions and labels|fields and global variables|structs|" "variables and typedefs|thread-local variables|" "variables and fields|variables, data members and tag types|" @@ -4059,9 +4059,6 @@ def ext_enum_too_large : ExtWarn< def ext_enumerator_increment_too_large : ExtWarn< "incremented enumerator value %0 is not representable in the " "largest integer type">, InGroup; -def warn_flag_enum_constant_out_of_range : Warning< - "enumeration value %0 is out of range of flags in enumeration type %1">, - InGroup; def warn_illegal_constant_array_size : Extension< "size of static array must be an integer constant expression">; @@ -6162,6 +6159,8 @@ let CategoryName = "Inline Assembly Issu "invalid lvalue in asm input for constraint '%0'">; def err_asm_invalid_input_constraint : Error< "invalid input constraint '%0' in asm">; + def err_asm_immediate_expected : Error<"constraint '%0' expects " + "an integer constant expression">; def err_asm_invalid_type_in_input : Error< "invalid type %0 in asm input for constraint '%1'">; def err_asm_tying_incompatible_types : Error< Modified: vendor/clang/dist/include/clang/Driver/Options.td ============================================================================== --- vendor/clang/dist/include/clang/Driver/Options.td Sat Jan 31 19:28:41 2015 (r277993) +++ vendor/clang/dist/include/clang/Driver/Options.td Sat Jan 31 19:28:59 2015 (r277994) @@ -1209,6 +1209,8 @@ def mfix_cortex_a53_835769 : Flag<["-"], def mno_fix_cortex_a53_835769 : Flag<["-"], "mno-fix-cortex-a53-835769">, Group, HelpText<"Don't workaround Cortex-A53 erratum 835769 (AArch64 only)">; +def ffixed_x18 : Flag<["-"], "ffixed-x18">, Group, + HelpText<"Reserve the x18 register (AArch64 only)">; def mvsx : Flag<["-"], "mvsx">, Group; def mno_vsx : Flag<["-"], "mno-vsx">, Group; Modified: vendor/clang/dist/include/clang/Sema/AttributeList.h ============================================================================== --- vendor/clang/dist/include/clang/Sema/AttributeList.h Sat Jan 31 19:28:41 2015 (r277993) +++ vendor/clang/dist/include/clang/Sema/AttributeList.h Sat Jan 31 19:28:59 2015 (r277994) @@ -822,7 +822,6 @@ enum AttributeDeclKind { ExpectedFunctionMethodOrClass, ExpectedFunctionMethodOrParameter, ExpectedClass, - ExpectedEnum, ExpectedVariable, ExpectedMethod, ExpectedVariableFunctionOrLabel, Modified: vendor/clang/dist/include/clang/Sema/Sema.h ============================================================================== --- vendor/clang/dist/include/clang/Sema/Sema.h Sat Jan 31 19:28:41 2015 (r277993) +++ vendor/clang/dist/include/clang/Sema/Sema.h Sat Jan 31 19:28:59 2015 (r277994) @@ -7971,12 +7971,6 @@ public: Expr *SrcExpr, AssignmentAction Action, bool *Complained = nullptr); - /// IsValueInFlagEnum - Determine if a value is allowed as part of a flag - /// enum. If AllowMask is true, then we also allow the complement of a valid - /// value, to be used as a mask. - bool IsValueInFlagEnum(const EnumDecl *ED, const llvm::APInt &Val, - bool AllowMask) const; - /// DiagnoseAssignmentEnum - Warn if assignment to enum is a constant /// integer not in the range of enum values. void DiagnoseAssignmentEnum(QualType DstType, QualType SrcType, Modified: vendor/clang/dist/include/clang/Sema/SemaInternal.h ============================================================================== --- vendor/clang/dist/include/clang/Sema/SemaInternal.h Sat Jan 31 19:28:41 2015 (r277993) +++ vendor/clang/dist/include/clang/Sema/SemaInternal.h Sat Jan 31 19:28:59 2015 (r277994) @@ -101,7 +101,7 @@ public: DeclContext *MemberContext, bool EnteringContext) : Typo(TypoName.getName().getAsIdentifierInfo()), CurrentTCIndex(0), - SemaRef(SemaRef), S(S), + SavedTCIndex(0), SemaRef(SemaRef), S(S), SS(SS ? llvm::make_unique(*SS) : nullptr), CorrectionValidator(std::move(CCC)), MemberContext(MemberContext), Result(SemaRef, TypoName, LookupKind), @@ -187,6 +187,17 @@ public: CurrentTCIndex >= ValidatedCorrections.size(); } + /// \brief Save the current position in the correction stream (overwriting any + /// previously saved position). + void saveCurrentPosition() { + SavedTCIndex = CurrentTCIndex; + } + + /// \brief Restore the saved position in the correction stream. + void restoreSavedPosition() { + CurrentTCIndex = SavedTCIndex; + } + ASTContext &getContext() const { return SemaRef.Context; } const LookupResult &getLookupResult() const { return Result; } @@ -267,6 +278,7 @@ private: SmallVector ValidatedCorrections; size_t CurrentTCIndex; + size_t SavedTCIndex; Sema &SemaRef; Scope *S; Modified: vendor/clang/dist/lib/Basic/Targets.cpp ============================================================================== --- vendor/clang/dist/lib/Basic/Targets.cpp Sat Jan 31 19:28:41 2015 (r277993) +++ vendor/clang/dist/lib/Basic/Targets.cpp Sat Jan 31 19:28:59 2015 (r277994) @@ -5901,6 +5901,8 @@ public: : MipsTargetInfoBase(Triple, "o32", "mips32r2") { SizeType = UnsignedInt; PtrDiffType = SignedInt; + Int64Type = SignedLongLong; + IntMaxType = Int64Type; MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 32; } bool setABI(const std::string &Name) override { @@ -5922,6 +5924,8 @@ public: Builder.defineMacro("__mips_isa_rev", "1"); else if (CPUStr == "mips32r2") Builder.defineMacro("__mips_isa_rev", "2"); + else if (CPUStr == "mips32r6") + Builder.defineMacro("__mips_isa_rev", "6"); if (ABI == "o32") { Builder.defineMacro("__mips_o32"); @@ -6028,6 +6032,8 @@ public: PointerWidth = PointerAlign = 64; SizeType = UnsignedLong; PtrDiffType = SignedLong; + Int64Type = SignedLong; + IntMaxType = Int64Type; } void setN32ABITypes() { @@ -6035,6 +6041,8 @@ public: PointerWidth = PointerAlign = 32; SizeType = UnsignedInt; PtrDiffType = SignedInt; + Int64Type = SignedLongLong; + IntMaxType = Int64Type; } bool setABI(const std::string &Name) override { @@ -6065,6 +6073,8 @@ public: Builder.defineMacro("__mips_isa_rev", "1"); else if (CPUStr == "mips64r2") Builder.defineMacro("__mips_isa_rev", "2"); + else if (CPUStr == "mips64r6") + Builder.defineMacro("__mips_isa_rev", "6"); if (ABI == "n32") { Builder.defineMacro("__mips_n32"); Modified: vendor/clang/dist/lib/CodeGen/CGDecl.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CGDecl.cpp Sat Jan 31 19:28:41 2015 (r277993) +++ vendor/clang/dist/lib/CodeGen/CGDecl.cpp Sat Jan 31 19:28:59 2015 (r277994) @@ -206,9 +206,6 @@ llvm::Constant *CodeGenModule::getOrCrea GV->setAlignment(getContext().getDeclAlign(&D).getQuantity()); setGlobalVisibility(GV, &D); - if (supportsCOMDAT() && GV->isWeakForLinker()) - GV->setComdat(TheModule.getOrInsertComdat(GV->getName())); - if (D.getTLSKind()) setTLSMode(GV, D); Modified: vendor/clang/dist/lib/CodeGen/CGDeclCXX.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CGDeclCXX.cpp Sat Jan 31 19:28:41 2015 (r277993) +++ vendor/clang/dist/lib/CodeGen/CGDeclCXX.cpp Sat Jan 31 19:28:59 2015 (r277994) @@ -267,7 +267,15 @@ void CodeGenModule::EmitPointerToInitFun addUsedGlobal(PtrArray); // If the GV is already in a comdat group, then we have to join it. - if (llvm::Comdat *C = GV->getComdat()) + llvm::Comdat *C = GV->getComdat(); + + // LinkOnce and Weak linkage are lowered down to a single-member comdat group. + // Make an explicit group so we can join it. + if (!C && (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage())) { + C = TheModule.getOrInsertComdat(GV->getName()); + GV->setComdat(C); + } + if (C) PtrArray->setComdat(C); } Modified: vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp Sat Jan 31 19:28:41 2015 (r277993) +++ vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp Sat Jan 31 19:28:59 2015 (r277994) @@ -1928,31 +1928,6 @@ void CodeGenModule::MaybeHandleStaticInE R.first->second = nullptr; } -static bool shouldBeInCOMDAT(CodeGenModule &CGM, const Decl &D) { - if (!CGM.supportsCOMDAT()) - return false; - - if (D.hasAttr()) - return true; - - GVALinkage Linkage; - if (auto *VD = dyn_cast(&D)) - Linkage = CGM.getContext().GetGVALinkageForVariable(VD); - else - Linkage = CGM.getContext().GetGVALinkageForFunction(cast(&D)); - - switch (Linkage) { - case GVA_Internal: - case GVA_AvailableExternally: - case GVA_StrongExternal: - return false; - case GVA_DiscardableODR: - case GVA_StrongODR: - return true; - } - llvm_unreachable("No such linkage"); -} - void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) { llvm::Constant *Init = nullptr; QualType ASTTy = D->getType(); @@ -2096,9 +2071,6 @@ void CodeGenModule::EmitGlobalVarDefinit setTLSMode(GV, *D); } - if (shouldBeInCOMDAT(*this, *D)) - GV->setComdat(TheModule.getOrInsertComdat(GV->getName())); - // Emit the initializer function if necessary. if (NeedsGlobalCtor || NeedsGlobalDtor) EmitCXXGlobalVarDeclInitFunc(D, GV, NeedsGlobalCtor); @@ -2433,9 +2405,6 @@ void CodeGenModule::EmitGlobalFunctionDe MaybeHandleStaticInExternC(D, Fn); - if (shouldBeInCOMDAT(*this, *D)) - Fn->setComdat(TheModule.getOrInsertComdat(Fn->getName())); - CodeGenFunction(*this).GenerateCode(D, Fn, FI); setFunctionDefinitionAttributes(D, Fn); Modified: vendor/clang/dist/lib/CodeGen/ItaniumCXXABI.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/ItaniumCXXABI.cpp Sat Jan 31 19:28:41 2015 (r277993) +++ vendor/clang/dist/lib/CodeGen/ItaniumCXXABI.cpp Sat Jan 31 19:28:59 2015 (r277994) @@ -1711,12 +1711,11 @@ void ItaniumCXXABI::EmitGuardedInit(Code // The ABI says: It is suggested that it be emitted in the same COMDAT group // as the associated data object - llvm::Comdat *C = var->getComdat(); - if (!D.isLocalVarDecl() && C) { + if (!D.isLocalVarDecl() && var->isWeakForLinker() && CGM.supportsCOMDAT()) { + llvm::Comdat *C = CGM.getModule().getOrInsertComdat(var->getName()); guard->setComdat(C); + var->setComdat(C); CGF.CurFn->setComdat(C); - } else if (CGM.supportsCOMDAT() && guard->isWeakForLinker()) { - guard->setComdat(CGM.getModule().getOrInsertComdat(guard->getName())); } CGM.setStaticLocalDeclGuardAddress(&D, guard); Modified: vendor/clang/dist/lib/CodeGen/MicrosoftCXXABI.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/MicrosoftCXXABI.cpp Sat Jan 31 19:28:41 2015 (r277993) +++ vendor/clang/dist/lib/CodeGen/MicrosoftCXXABI.cpp Sat Jan 31 19:28:59 2015 (r277994) @@ -1534,6 +1534,12 @@ llvm::Function *MicrosoftCXXABI::EmitVir CGM.SetLLVMFunctionAttributes(MD, FnInfo, ThunkFn); CGM.SetLLVMFunctionAttributesForDefinition(MD, ThunkFn); + // Add the "thunk" attribute so that LLVM knows that the return type is + // meaningless. These thunks can be used to call functions with differing + // return types, and the caller is required to cast the prototype + // appropriately to extract the correct value. + ThunkFn->addFnAttr("thunk"); + // These thunks can be compared, so they are not unnamed. ThunkFn->setUnnamedAddr(false); @@ -1829,10 +1835,18 @@ void MicrosoftCXXABI::EmitThreadLocalIni llvm::Function *F = CXXThreadLocalInits[I]; // If the GV is already in a comdat group, then we have to join it. - if (llvm::Comdat *C = GV->getComdat()) + llvm::Comdat *C = GV->getComdat(); + + // LinkOnce and Weak linkage are lowered down to a single-member comdat + // group. + // Make an explicit group so we can join it. + if (!C && (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage())) { + C = CGM.getModule().getOrInsertComdat(GV->getName()); + GV->setComdat(C); AddToXDU(F)->setComdat(C); - else + } else { NonComdatInits.push_back(F); + } } if (!NonComdatInits.empty()) { Modified: vendor/clang/dist/lib/Driver/Tools.cpp ============================================================================== --- vendor/clang/dist/lib/Driver/Tools.cpp Sat Jan 31 19:28:41 2015 (r277993) +++ vendor/clang/dist/lib/Driver/Tools.cpp Sat Jan 31 19:28:59 2015 (r277994) @@ -958,6 +958,11 @@ void Clang::AddAArch64TargetArgs(const A if (A->getOption().matches(options::OPT_mno_global_merge)) CmdArgs.push_back("-mno-global-merge"); } + + if (Args.hasArg(options::OPT_ffixed_x18)) { + CmdArgs.push_back("-backend-option"); + CmdArgs.push_back("-aarch64-reserve-x18"); + } } // Get CPU and ABI names. They are not independent @@ -5418,6 +5423,20 @@ const char *arm::getLLVMArchSuffixForARM .Default(""); } +void arm::appendEBLinkFlags(const ArgList &Args, ArgStringList &CmdArgs, const llvm::Triple &Triple) { + if (Args.hasArg(options::OPT_r)) + return; + + StringRef Suffix = getLLVMArchSuffixForARM(getARMCPUForMArch(Args, Triple)); + const char *LinkFlag = llvm::StringSwitch(Suffix) + .Cases("v4", "v4t", "v5", "v5e", nullptr) + .Cases("v6", "v6t2", nullptr) + .Default("--be8"); + + if (LinkFlag) + CmdArgs.push_back(LinkFlag); +} + bool mips::hasMipsAbiArg(const ArgList &Args, const char *Value) { Arg *A = Args.getLastArg(options::OPT_mabi_EQ); return A && (A->getValue() == StringRef(Value)); @@ -6881,6 +6900,7 @@ void netbsd::Link::ConstructJob(Compilat break; case llvm::Triple::armeb: case llvm::Triple::thumbeb: + arm::appendEBLinkFlags(Args, CmdArgs, getToolChain().getTriple()); CmdArgs.push_back("-m"); switch (getToolChain().getTriple().getEnvironment()) { case llvm::Triple::EABI: @@ -7431,6 +7451,10 @@ void gnutools::Link::ConstructJob(Compil if (Args.hasArg(options::OPT_s)) CmdArgs.push_back("-s"); + if (ToolChain.getArch() == llvm::Triple::armeb || + ToolChain.getArch() == llvm::Triple::thumbeb) + arm::appendEBLinkFlags(Args, CmdArgs, getToolChain().getTriple()); + for (const auto &Opt : ToolChain.ExtraOpts) CmdArgs.push_back(Opt.c_str()); Modified: vendor/clang/dist/lib/Driver/Tools.h ============================================================================== --- vendor/clang/dist/lib/Driver/Tools.h Sat Jan 31 19:28:41 2015 (r277993) +++ vendor/clang/dist/lib/Driver/Tools.h Sat Jan 31 19:28:59 2015 (r277994) @@ -228,6 +228,8 @@ namespace arm { const char* getARMCPUForMArch(const llvm::opt::ArgList &Args, const llvm::Triple &Triple); const char* getLLVMArchSuffixForARM(StringRef CPU); + + void appendEBLinkFlags(const llvm::opt::ArgList &Args, ArgStringList &CmdArgs, const llvm::Triple &Triple); } namespace mips { Modified: vendor/clang/dist/lib/Sema/SemaChecking.cpp ============================================================================== --- vendor/clang/dist/lib/Sema/SemaChecking.cpp Sat Jan 31 19:28:41 2015 (r277993) +++ vendor/clang/dist/lib/Sema/SemaChecking.cpp Sat Jan 31 19:28:59 2015 (r277994) @@ -1340,6 +1340,11 @@ ExprResult Sema::SemaAtomicOpsOverloaded << IsC11 << Ptr->getType() << Ptr->getSourceRange(); return ExprError(); } + if (IsC11 && ValType->isPointerType() && + RequireCompleteType(Ptr->getLocStart(), ValType->getPointeeType(), + diag::err_incomplete_type)) { + return ExprError(); + } } else if (IsN && !ValType->isIntegerType() && !ValType->isPointerType()) { // For __atomic_*_n operations, the value type must be a scalar integral or // pointer type which is 1, 2, 4, 8 or 16 bytes in length. Modified: vendor/clang/dist/lib/Sema/SemaDecl.cpp ============================================================================== --- vendor/clang/dist/lib/Sema/SemaDecl.cpp Sat Jan 31 19:28:41 2015 (r277993) +++ vendor/clang/dist/lib/Sema/SemaDecl.cpp Sat Jan 31 19:28:59 2015 (r277994) @@ -8828,11 +8828,12 @@ void Sema::AddInitializerToDecl(Decl *Re }); if (Res.isInvalid()) { VDecl->setInvalidDecl(); - return; - } - if (Res.get() != Args[Idx]) + } else if (Res.get() != Args[Idx]) { Args[Idx] = Res.get(); + } } + if (VDecl->isInvalidDecl()) + return; InitializationSequence InitSeq(*this, Entity, Kind, Args); ExprResult Result = InitSeq.Perform(*this, Entity, Kind, Args, &DclT); @@ -13519,49 +13520,6 @@ static void CheckForDuplicateEnumValues( } } -bool -Sema::IsValueInFlagEnum(const EnumDecl *ED, const llvm::APInt &Val, - bool AllowMask) const { - FlagEnumAttr *FEAttr = ED->getAttr(); - assert(FEAttr && "looking for value in non-flag enum"); - - llvm::APInt FlagMask = ~FEAttr->getFlagBits(); - unsigned Width = FlagMask.getBitWidth(); - - // We will try a zero-extended value for the regular check first. - llvm::APInt ExtVal = Val.zextOrSelf(Width); - - // A value is in a flag enum if either its bits are a subset of the enum's - // flag bits (the first condition) or we are allowing masks and the same is - // true of its complement (the second condition). When masks are allowed, we - // allow the common idiom of ~(enum1 | enum2) to be a valid enum value. - // - // While it's true that any value could be used as a mask, the assumption is - // that a mask will have all of the insignificant bits set. Anything else is - // likely a logic error. - if (!(FlagMask & ExtVal)) - return true; - - if (AllowMask) { - // Try a one-extended value instead. This can happen if the enum is wider - // than the constant used, in C with extensions to allow for wider enums. - // The mask will still have the correct behaviour, so we give the user the - // benefit of the doubt. - // - // FIXME: This heuristic can cause weird results if the enum was extended - // to a larger type and is signed, because then bit-masks of smaller types - // that get extended will fall out of range (e.g. ~0x1u). We currently don't - // detect that case and will get a false positive for it. In most cases, - // though, it can be fixed by making it a signed type (e.g. ~0x1), so it may - // be fine just to accept this as a warning. - ExtVal |= llvm::APInt::getHighBitsSet(Width, Width - Val.getBitWidth()); - if (!(FlagMask & ~ExtVal)) - return true; - } - - return false; -} - void Sema::ActOnEnumBody(SourceLocation EnumLoc, SourceLocation LBraceLoc, SourceLocation RBraceLoc, Decl *EnumDeclX, ArrayRef Elements, @@ -13647,8 +13605,10 @@ void Sema::ActOnEnumBody(SourceLocation BestPromotionType = Context.getPromotedIntegerType(BestType); else BestPromotionType = BestType; - - BestWidth = Context.getIntWidth(BestType); + // We don't need to set BestWidth, because BestType is going to be the type + // of the enumerators, but we do anyway because otherwise some compilers + // warn that it might be used uninitialized. + BestWidth = CharWidth; } else if (NumNegativeBits) { // If there is a negative value, figure out the smallest integer type (of @@ -13713,15 +13673,10 @@ void Sema::ActOnEnumBody(SourceLocation } } - FlagEnumAttr *FEAttr = Enum->getAttr(); - if (FEAttr) - FEAttr->getFlagBits() = llvm::APInt(BestWidth, 0); - // Loop over all of the enumerator constants, changing their types to match - // the type of the enum if needed. If we have a flag type, we also prepare the - // FlagBits cache. - for (auto *D : Elements) { - auto *ECD = cast_or_null(D); + // the type of the enum if needed. + for (unsigned i = 0, e = Elements.size(); i != e; ++i) { + EnumConstantDecl *ECD = cast_or_null(Elements[i]); if (!ECD) continue; // Already issued a diagnostic. // Standard C says the enumerators have int type, but we allow, as an @@ -13751,7 +13706,7 @@ void Sema::ActOnEnumBody(SourceLocation // enum-specifier, each enumerator has the type of its // enumeration. ECD->setType(EnumType); - goto flagbits; + continue; } else { NewTy = BestType; NewWidth = BestWidth; @@ -13778,32 +13733,8 @@ void Sema::ActOnEnumBody(SourceLocation ECD->setType(EnumType); else ECD->setType(NewTy); - -flagbits: - // Check to see if we have a constant with exactly one bit set. Note that x - // & (x - 1) will be nonzero if and only if x has more than one bit set. - if (FEAttr) { - llvm::APInt ExtVal = InitVal.zextOrSelf(BestWidth); - if (ExtVal != 0 && !(ExtVal & (ExtVal - 1))) { - FEAttr->getFlagBits() |= ExtVal; - } - } - } - - if (FEAttr) { - for (Decl *D : Elements) { - EnumConstantDecl *ECD = cast_or_null(D); - if (!ECD) continue; // Already issued a diagnostic. - - llvm::APSInt InitVal = ECD->getInitVal(); - if (InitVal != 0 && !IsValueInFlagEnum(Enum, InitVal, true)) - Diag(ECD->getLocation(), diag::warn_flag_enum_constant_out_of_range) - << ECD << Enum; - } } - - Enum->completeDefinition(BestType, BestPromotionType, NumPositiveBits, NumNegativeBits); Modified: vendor/clang/dist/lib/Sema/SemaDeclAttr.cpp ============================================================================== --- vendor/clang/dist/lib/Sema/SemaDeclAttr.cpp Sat Jan 31 19:28:41 2015 (r277993) +++ vendor/clang/dist/lib/Sema/SemaDeclAttr.cpp Sat Jan 31 19:28:59 2015 (r277994) @@ -4395,9 +4395,6 @@ static void ProcessDeclAttribute(Sema &S case AttributeList::AT_OptimizeNone: handleOptimizeNoneAttr(S, D, Attr); break; - case AttributeList::AT_FlagEnum: - handleSimpleAttribute(S, D, Attr); - break; case AttributeList::AT_Flatten: handleSimpleAttribute(S, D, Attr); break; Modified: vendor/clang/dist/lib/Sema/SemaExpr.cpp ============================================================================== --- vendor/clang/dist/lib/Sema/SemaExpr.cpp Sat Jan 31 19:28:41 2015 (r277993) +++ vendor/clang/dist/lib/Sema/SemaExpr.cpp Sat Jan 31 19:28:59 2015 (r277994) @@ -4762,12 +4762,8 @@ Sema::BuildResolvedCallExpr(Expr *Fn, Na VK_RValue, RParenLoc); // Bail out early if calling a builtin with custom typechecking. - if (BuiltinID && Context.BuiltinInfo.hasCustomTypechecking(BuiltinID)) { - ExprResult Res = CorrectDelayedTyposInExpr(TheCall); - if (!Res.isUsable() || !isa(Res.get())) - return Res; - return CheckBuiltinFunctionCall(FDecl, BuiltinID, cast(Res.get())); - } + if (BuiltinID && Context.BuiltinInfo.hasCustomTypechecking(BuiltinID)) + return CheckBuiltinFunctionCall(FDecl, BuiltinID, TheCall); retry: const FunctionType *FuncT; @@ -5785,15 +5781,6 @@ QualType Sema::CheckConditionalOperands( ExprObjectKind &OK, SourceLocation QuestionLoc) { - if (!getLangOpts().CPlusPlus) { - // C cannot handle TypoExpr nodes on either side of a binop because it - // doesn't handle dependent types properly, so make sure any TypoExprs have - // been dealt with before checking the operands. - ExprResult CondResult = CorrectDelayedTyposInExpr(Cond); - if (!CondResult.isUsable()) return QualType(); - Cond = CondResult; - } - ExprResult LHSResult = CheckPlaceholderExpr(LHS.get()); if (!LHSResult.isUsable()) return QualType(); LHS = LHSResult; @@ -6173,6 +6160,15 @@ ExprResult Sema::ActOnConditionalOp(Sour SourceLocation ColonLoc, Expr *CondExpr, Expr *LHSExpr, Expr *RHSExpr) { + if (!getLangOpts().CPlusPlus) { + // C cannot handle TypoExpr nodes in the condition because it + // doesn't handle dependent types properly, so make sure any TypoExprs have + // been dealt with before checking the operands. + ExprResult CondResult = CorrectDelayedTyposInExpr(CondExpr); + if (!CondResult.isUsable()) return ExprError(); + CondExpr = CondResult.get(); + } + // If this is the gnu "x ?: y" extension, analyze the types as though the LHS // was the condition. OpaqueValueExpr *opaqueValue = nullptr; @@ -9457,6 +9453,18 @@ static void checkObjCPointerIntrospectio } } +static NamedDecl *getDeclFromExpr(Expr *E) { + if (!E) + return nullptr; + if (auto *DRE = dyn_cast(E)) + return DRE->getDecl(); + if (auto *ME = dyn_cast(E)) + return ME->getMemberDecl(); + if (auto *IRE = dyn_cast(E)) + return IRE->getDecl(); + return nullptr; +} + /// CreateBuiltinBinOp - Creates a new built-in binary operation with /// operator @p Opc at location @c TokLoc. This routine only supports /// built-in operations; ActOnBinOp handles overloaded operators. @@ -9494,7 +9502,13 @@ ExprResult Sema::CreateBuiltinBinOp(Sour // doesn't handle dependent types properly, so make sure any TypoExprs have // been dealt with before checking the operands. LHS = CorrectDelayedTyposInExpr(LHSExpr); - RHS = CorrectDelayedTyposInExpr(RHSExpr); + RHS = CorrectDelayedTyposInExpr(RHSExpr, [Opc, LHS](Expr *E) { + if (Opc != BO_Assign) + return ExprResult(E); + // Avoid correcting the RHS to the same Expr as the LHS. + Decl *D = getDeclFromExpr(E); + return (D && D == getDeclFromExpr(LHS.get())) ? ExprError() : E; + }); if (!LHS.isUsable() || !RHS.isUsable()) return ExprError(); } Modified: vendor/clang/dist/lib/Sema/SemaExprCXX.cpp ============================================================================== --- vendor/clang/dist/lib/Sema/SemaExprCXX.cpp Sat Jan 31 19:28:41 2015 (r277993) +++ vendor/clang/dist/lib/Sema/SemaExprCXX.cpp Sat Jan 31 19:28:59 2015 (r277994) @@ -6143,12 +6143,6 @@ public: ExprResult TransformLambdaExpr(LambdaExpr *E) { return Owned(E); } - ExprResult TransformOpaqueValueExpr(OpaqueValueExpr *E) { - if (Expr *SE = E->getSourceExpr()) - return TransformExpr(SE); - return BaseTransform::TransformOpaqueValueExpr(E); - } - ExprResult Transform(Expr *E) { ExprResult Res; while (true) { @@ -6168,15 +6162,18 @@ public: while (!AmbiguousTypoExprs.empty()) { auto TE = AmbiguousTypoExprs.back(); auto Cached = TransformCache[TE]; - AmbiguousTypoExprs.pop_back(); + auto &State = SemaRef.getTypoExprState(TE); + State.Consumer->saveCurrentPosition(); TransformCache.erase(TE); if (!TryTransform(E).isInvalid()) { - SemaRef.getTypoExprState(TE).Consumer->resetCorrectionStream(); + State.Consumer->resetCorrectionStream(); TransformCache.erase(TE); Res = ExprError(); break; - } else - TransformCache[TE] = Cached; + } + AmbiguousTypoExprs.remove(TE); + State.Consumer->restoreSavedPosition(); + TransformCache[TE] = Cached; } // Ensure that all of the TypoExprs within the current Expr have been found. @@ -6235,8 +6232,12 @@ ExprResult Sema::CorrectDelayedTyposInEx if (E && !ExprEvalContexts.empty() && ExprEvalContexts.back().NumTypos && (E->isTypeDependent() || E->isValueDependent() || E->isInstantiationDependent())) { + auto TyposInContext = ExprEvalContexts.back().NumTypos; + assert(TyposInContext < ~0U && "Recursive call of CorrectDelayedTyposInExpr"); + ExprEvalContexts.back().NumTypos = ~0U; auto TyposResolved = DelayedTypos.size(); auto Result = TransformTypos(*this, Filter).Transform(E); + ExprEvalContexts.back().NumTypos = TyposInContext; TyposResolved -= DelayedTypos.size(); if (Result.isInvalid() || Result.get() != E) { ExprEvalContexts.back().NumTypos -= TyposResolved; Modified: vendor/clang/dist/lib/Sema/SemaLookup.cpp ============================================================================== --- vendor/clang/dist/lib/Sema/SemaLookup.cpp Sat Jan 31 19:28:41 2015 (r277993) +++ vendor/clang/dist/lib/Sema/SemaLookup.cpp Sat Jan 31 19:28:59 2015 (r277994) @@ -3587,7 +3587,7 @@ retry_lookup: QualifiedResults.push_back(Candidate); break; } - Candidate.setCorrectionRange(TempSS, Result.getLookupNameInfo()); + Candidate.setCorrectionRange(SS.get(), Result.getLookupNameInfo()); return true; } return false; Modified: vendor/clang/dist/lib/Sema/SemaStmt.cpp ============================================================================== --- vendor/clang/dist/lib/Sema/SemaStmt.cpp Sat Jan 31 19:28:41 2015 (r277993) +++ vendor/clang/dist/lib/Sema/SemaStmt.cpp Sat Jan 31 19:28:59 2015 (r277994) @@ -687,39 +687,26 @@ static void checkCaseValue(Sema &S, Sour } } -typedef SmallVector, 64> EnumValsTy; - /// Returns true if we should emit a diagnostic about this case expression not /// being a part of the enum used in the switch controlling expression. -static bool ShouldDiagnoseSwitchCaseNotInEnum(const Sema &S, +static bool ShouldDiagnoseSwitchCaseNotInEnum(const ASTContext &Ctx, const EnumDecl *ED, - const Expr *CaseExpr, - EnumValsTy::iterator &EI, - EnumValsTy::iterator &EIEnd, - const llvm::APSInt &Val) { - bool FlagType = ED->hasAttr(); - - if (const DeclRefExpr *DRE = - dyn_cast(CaseExpr->IgnoreParenImpCasts())) { + const Expr *CaseExpr) { + // Don't warn if the 'case' expression refers to a static const variable of + // the enum type. + CaseExpr = CaseExpr->IgnoreParenImpCasts(); + if (const DeclRefExpr *DRE = dyn_cast(CaseExpr)) { if (const VarDecl *VD = dyn_cast(DRE->getDecl())) { + if (!VD->hasGlobalStorage()) + return true; QualType VarType = VD->getType(); - QualType EnumType = S.Context.getTypeDeclType(ED); - if (VD->hasGlobalStorage() && VarType.isConstQualified() && - S.Context.hasSameUnqualifiedType(EnumType, VarType)) + if (!VarType.isConstQualified()) + return true; + QualType EnumType = Ctx.getTypeDeclType(ED); + if (Ctx.hasSameUnqualifiedType(EnumType, VarType)) return false; } } - - if (FlagType) { - return !S.IsValueInFlagEnum(ED, Val, false); - } else { - while (EI != EIEnd && EI->first < Val) - EI++; - - if (EI != EIEnd && EI->first == Val) - return false; - } - return true; } @@ -1059,6 +1046,8 @@ Sema::ActOnFinishSwitchStmt(SourceLocati // If switch has default case, then ignore it. if (!CaseListIsErroneous && !HasConstantCond && ET) { const EnumDecl *ED = ET->getDecl(); + typedef SmallVector, 64> + EnumValsTy; EnumValsTy EnumVals; // Gather all enum values, set their type and sort them, @@ -1069,48 +1058,57 @@ Sema::ActOnFinishSwitchStmt(SourceLocati EnumVals.push_back(std::make_pair(Val, EDI)); } std::stable_sort(EnumVals.begin(), EnumVals.end(), CmpEnumVals); - auto EI = EnumVals.begin(), EIEnd = + EnumValsTy::iterator EIend = std::unique(EnumVals.begin(), EnumVals.end(), EqEnumVals); // See which case values aren't in enum. + EnumValsTy::const_iterator EI = EnumVals.begin(); for (CaseValsTy::const_iterator CI = CaseVals.begin(); - CI != CaseVals.end(); CI++) { - Expr *CaseExpr = CI->second->getLHS(); - if (ShouldDiagnoseSwitchCaseNotInEnum(*this, ED, CaseExpr, EI, EIEnd, - CI->first)) - Diag(CaseExpr->getExprLoc(), diag::warn_not_in_enum) - << CondTypeBeforePromotion; + CI != CaseVals.end(); CI++) { + while (EI != EIend && EI->first < CI->first) + EI++; + if (EI == EIend || EI->first > CI->first) { + Expr *CaseExpr = CI->second->getLHS(); + if (ShouldDiagnoseSwitchCaseNotInEnum(Context, ED, CaseExpr)) + Diag(CaseExpr->getExprLoc(), diag::warn_not_in_enum) + << CondTypeBeforePromotion; + } } - // See which of case ranges aren't in enum EI = EnumVals.begin(); for (CaseRangesTy::const_iterator RI = CaseRanges.begin(); - RI != CaseRanges.end(); RI++) { - Expr *CaseExpr = RI->second->getLHS(); - if (ShouldDiagnoseSwitchCaseNotInEnum(*this, ED, CaseExpr, EI, EIEnd, - RI->first)) - Diag(CaseExpr->getExprLoc(), diag::warn_not_in_enum) - << CondTypeBeforePromotion; + RI != CaseRanges.end() && EI != EIend; RI++) { + while (EI != EIend && EI->first < RI->first) + EI++; + + if (EI == EIend || EI->first != RI->first) { + Expr *CaseExpr = RI->second->getLHS(); + if (ShouldDiagnoseSwitchCaseNotInEnum(Context, ED, CaseExpr)) + Diag(CaseExpr->getExprLoc(), diag::warn_not_in_enum) + << CondTypeBeforePromotion; + } llvm::APSInt Hi = RI->second->getRHS()->EvaluateKnownConstInt(Context); AdjustAPSInt(Hi, CondWidth, CondIsSigned); - - CaseExpr = RI->second->getRHS(); - if (ShouldDiagnoseSwitchCaseNotInEnum(*this, ED, CaseExpr, EI, EIEnd, - Hi)) - Diag(CaseExpr->getExprLoc(), diag::warn_not_in_enum) - << CondTypeBeforePromotion; + while (EI != EIend && EI->first < Hi) + EI++; + if (EI == EIend || EI->first != Hi) { + Expr *CaseExpr = RI->second->getRHS(); + if (ShouldDiagnoseSwitchCaseNotInEnum(Context, ED, CaseExpr)) + Diag(CaseExpr->getExprLoc(), diag::warn_not_in_enum) + << CondTypeBeforePromotion; + } } // Check which enum vals aren't in switch - auto CI = CaseVals.begin(); - auto RI = CaseRanges.begin(); + CaseValsTy::const_iterator CI = CaseVals.begin(); + CaseRangesTy::const_iterator RI = CaseRanges.begin(); bool hasCasesNotInSwitch = false; SmallVector UnhandledNames; - for (EI = EnumVals.begin(); EI != EIEnd; EI++){ + for (EI = EnumVals.begin(); EI != EIend; EI++){ // Drop unneeded case values while (CI != CaseVals.end() && CI->first < EI->first) CI++; @@ -1197,37 +1195,30 @@ Sema::DiagnoseAssignmentEnum(QualType Ds llvm::APSInt RhsVal = SrcExpr->EvaluateKnownConstInt(Context); AdjustAPSInt(RhsVal, DstWidth, DstIsSigned); const EnumDecl *ED = ET->getDecl(); - - if (ED->hasAttr()) { - if (!IsValueInFlagEnum(ED, RhsVal, true)) - Diag(SrcExpr->getExprLoc(), diag::warn_not_in_enum_assignment) + typedef SmallVector, 64> + EnumValsTy; + EnumValsTy EnumVals; + + // Gather all enum values, set their type and sort them, + // allowing easier comparison with rhs constant. + for (auto *EDI : ED->enumerators()) { + llvm::APSInt Val = EDI->getInitVal(); + AdjustAPSInt(Val, DstWidth, DstIsSigned); + EnumVals.push_back(std::make_pair(Val, EDI)); + } + if (EnumVals.empty()) + return; + std::stable_sort(EnumVals.begin(), EnumVals.end(), CmpEnumVals); + EnumValsTy::iterator EIend = + std::unique(EnumVals.begin(), EnumVals.end(), EqEnumVals); + + // See which values aren't in the enum. + EnumValsTy::const_iterator EI = EnumVals.begin(); + while (EI != EIend && EI->first < RhsVal) + EI++; + if (EI == EIend || EI->first != RhsVal) { + Diag(SrcExpr->getExprLoc(), diag::warn_not_in_enum_assignment) << DstType.getUnqualifiedType(); - } else { - typedef SmallVector, 64> - EnumValsTy; - EnumValsTy EnumVals; - - // Gather all enum values, set their type and sort them, - // allowing easier comparison with rhs constant. - for (auto *EDI : ED->enumerators()) { - llvm::APSInt Val = EDI->getInitVal(); - AdjustAPSInt(Val, DstWidth, DstIsSigned); - EnumVals.push_back(std::make_pair(Val, EDI)); - } - if (EnumVals.empty()) - return; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@FreeBSD.ORG Sat Jan 31 19:29:29 2015 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 41C91D3B; Sat, 31 Jan 2015 19:29:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 146BCC5; Sat, 31 Jan 2015 19:29:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0VJTSjH048780; Sat, 31 Jan 2015 19:29:28 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0VJTSjb048779; Sat, 31 Jan 2015 19:29:28 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201501311929.t0VJTSjb048779@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 31 Jan 2015 19:29:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r277995 - vendor/clang/clang-release_360-r227651 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Jan 2015 19:29:29 -0000 Author: dim Date: Sat Jan 31 19:29:28 2015 New Revision: 277995 URL: https://svnweb.freebsd.org/changeset/base/277995 Log: Tag clang tags/RELEASE_360/rc2 r227651 (effectively, 3.6.0 RC2). Added: vendor/clang/clang-release_360-r227651/ - copied from r277994, vendor/clang/dist/ From owner-svn-src-vendor@FreeBSD.ORG Sat Jan 31 23:14:25 2015 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E59B81DD; Sat, 31 Jan 2015 23:14:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D13E1897; Sat, 31 Jan 2015 23:14:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0VNEPeS063487; Sat, 31 Jan 2015 23:14:25 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0VNEP7B063486; Sat, 31 Jan 2015 23:14:25 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201501312314.t0VNEP7B063486@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 31 Jan 2015 23:14:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r278013 - vendor/libcxxrt/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Jan 2015 23:14:26 -0000 Author: dim Date: Sat Jan 31 23:14:24 2015 New Revision: 278013 URL: https://svnweb.freebsd.org/changeset/base/278013 Log: Import libcxxrt master 1cb607e89f6135bbc10f3d3b6fba1f983e258dcc. Interesting fixes: 1cb607e Correct gcc version check for __cxa_begin_catch() declaration with or without throw() Modified: vendor/libcxxrt/dist/exception.cc Modified: vendor/libcxxrt/dist/exception.cc ============================================================================== --- vendor/libcxxrt/dist/exception.cc Sat Jan 31 23:12:29 2015 (r278012) +++ vendor/libcxxrt/dist/exception.cc Sat Jan 31 23:14:24 2015 (r278013) @@ -673,7 +673,7 @@ static _Unwind_Reason_Code trace(struct * If the failure happened by falling off the end of the stack without finding * a handler, prints a back trace before aborting. */ -#if __GNUC__ > 3 && __GNUC_MINOR__ > 2 +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) extern "C" void *__cxa_begin_catch(void *e) throw(); #else extern "C" void *__cxa_begin_catch(void *e); @@ -1189,7 +1189,7 @@ BEGIN_PERSONALITY_FUNCTION(__gxx_persona * pointer to the caught exception, which is either the adjusted pointer (for * C++ exceptions) of the unadjusted pointer (for foreign exceptions). */ -#if __GNUC__ > 3 && __GNUC_MINOR__ > 2 +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) extern "C" void *__cxa_begin_catch(void *e) throw() #else extern "C" void *__cxa_begin_catch(void *e) From owner-svn-src-vendor@FreeBSD.ORG Sat Jan 31 23:16:12 2015 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 79142318; Sat, 31 Jan 2015 23:16:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A6898AC; Sat, 31 Jan 2015 23:16:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0VNGCUG063781; Sat, 31 Jan 2015 23:16:12 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0VNGCr1063780; Sat, 31 Jan 2015 23:16:12 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201501312316.t0VNGCr1063780@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 31 Jan 2015 23:16:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r278014 - vendor/libcxxrt/2014-12-31-1cb607e89f6135bbc10f3d3b6fba1f983e258dcc X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Jan 2015 23:16:12 -0000 Author: dim Date: Sat Jan 31 23:16:11 2015 New Revision: 278014 URL: https://svnweb.freebsd.org/changeset/base/278014 Log: Tag libcxxrt master 1cb607e89f6135bbc10f3d3b6fba1f983e258dcc. Added: vendor/libcxxrt/2014-12-31-1cb607e89f6135bbc10f3d3b6fba1f983e258dcc/ - copied from r278013, vendor/libcxxrt/dist/