Commit Graph

59937 Commits

Author SHA1 Message Date
Alexey Samsonov fbe54696cc Add -target flag to Clang invocations in this test.
ASan may not be supported for the default target triple.

llvm-svn: 246795
2015-09-03 19:11:42 +00:00
Manuel Klimek e0495d987c [libclang] Return deduced type for auto type, not the one written in the source.
It used to work, but was accidentally broken by r179769.
The issue with decayed types was fixed by r190796.
So this patch partially reverts r179769, and adds more tests.

This also fixes PR 18669.

Patch by Sergey Kalinichev.

llvm-svn: 246778
2015-09-03 16:11:10 +00:00
Alexandros Lamprineas a448f04697 Implement ACLE 2.0 macros of chapters 6.4 and 6.5 for [ARM] and [Aarch64] targets.
Differential Revision: http://reviews.llvm.org/D12244

Change-Id: Iffd4e822c15e18668fe8868278230ff232ef50aa
llvm-svn: 246768
2015-09-03 14:40:57 +00:00
Daniel Sanders 4f7cd2398b [mips] Added support for choosing between traps and breaks in the integrated assembler macros.
Summary: The command line options for these are -Wa,--trap and -Wa,--break.

Patch by Scott Egerton.

Reviewers: vkalintiris, dsanders

Subscribers: llvm-commits

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

llvm-svn: 246765
2015-09-03 12:58:39 +00:00
Oliver Stannard dc2854c2f1 [ARM] Allow passing/returning of __fp16 arguments
The ACLE (ARM C Language Extensions) 2.0 allows the __fp16 type to be
used as a functon argument or return type (ACLE 1.1 did not).

The current public release of the AAPCS (2.09) states that __fp16 values
should be converted to single-precision before being passed or returned,
but AAPCS 2.10 (to be released shortly) changes this, so that they are
passed in the least-significant 16 bits of either a GPR (for base AAPCS)
or a single-precision register (for AAPCS-VFP). This does not change how
arguments are passed if they get passed on the stack.

This patch brings clang up to compliance with the latest versions of
both of these specs.

We can now set the __ARM_FP16_ARGS ACLE predefine, and we have always
been able to set the __ARM_FP16_FORMAT_IEEE predefine (we do not support
the alternative format).

llvm-svn: 246764
2015-09-03 12:40:58 +00:00
Oliver Stannard 9253f00d13 Revert 246755 as it breaks buildbots
Original commit message:
[ARM] Allow passing/returning of __fp16 arguments

The ACLE (ARM C Language Extensions) 2.0 allows the __fp16 type to be
used as a functon argument or return type (ACLE 1.1 did not).

The current public release of the AAPCS (2.09) states that __fp16 values
should be converted to single-precision before being passed or returned,
but AAPCS 2.10 (to be released shortly) changes this, so that they are
passed in the least-significant 16 bits of either a GPR (for base AAPCS)
or a single-precision register (for AAPCS-VFP). This does not change how
arguments are passed if they get passed on the stack.

This patch brings clang up to compliance with the latest versions of
both of these specs.

We can now set the __ARM_FP16_ARGS ACLE predefine, and we have always
been able to set the __ARM_FP16_FORMAT_IEEE predefine (we do not support
the alternative format).

llvm-svn: 246760
2015-09-03 11:46:24 +00:00
Alexey Bataev b500101e1c [OPENMP] Fix for http://llvm.org/PR24687: ICE on compilation of R package TPmsm.
Fixed capturing of VLAs in 'private' clause of the OpenMP directives.

llvm-svn: 246757
2015-09-03 10:21:46 +00:00
Oliver Stannard ee0286201c [ARM] Allow passing/returning of __fp16 arguments
The ACLE (ARM C Language Extensions) 2.0 allows the __fp16 type to be
used as a functon argument or return type (ACLE 1.1 did not).

The current public release of the AAPCS (2.09) states that __fp16 values
should be converted to single-precision before being passed or returned,
but AAPCS 2.10 (to be released shortly) changes this, so that they are
passed in the least-significant 16 bits of either a GPR (for base AAPCS)
or a single-precision register (for AAPCS-VFP). This does not change how
arguments are passed if they get passed on the stack.

This patch brings clang up to compliance with the latest versions of
both of these specs.

We can now set the __ARM_FP16_ARGS ACLE predefine, and we have always
been able to set the __ARM_FP16_FORMAT_IEEE predefine (we do not support
the alternative format).

llvm-svn: 246755
2015-09-03 09:34:53 +00:00
Alexey Bataev 7371aa365c [OPENMP 4.1] Codegen for extended format of 'if' clause.
Fixed codegen for extended format of 'if' clauses with special 'directive-name-modifier' + ast-print tests for extended format of 'if' clause.

llvm-svn: 246748
2015-09-03 08:45:56 +00:00
Alexey Bataev 6b8046addf [OPENMP 4.1] Parsing/sema analysis for extended format of 'if' clause.
OpenMP 4.1 added special 'directive-name-modifier' to the 'if' clause.
Format of 'if' clause is as follows:
```
if([ directive-name-modifier :] scalar-logical-expression)
```

The restriction rules are also changed.
1. If any 'if' clause on the directive includes a 'directive-name-modifier' then all 'if' clauses on the directive must include a 'directive-name-modifier'.
2. At most one 'if' clause without a 'directive-name-modifier' can appear on the directive.
3. At most one 'if' clause with some particular 'directive-name-modifier' can appear on the directive.

'directive-name-modifier' is important for combined directives and allows to separate conditions in 'if' clause for simple sub-directives in combined directive. This 'directive-name-modifier' identifies the sub-directive to which this 'if' clause must be applied.

llvm-svn: 246747
2015-09-03 07:23:48 +00:00
Douglas Katzman 1a050c8aca Remove inadvertent debug output from prior change.
llvm-svn: 246715
2015-09-02 21:18:10 +00:00
Douglas Katzman 7f43af57db Use new utility function to clean leading junk from pathnames. NFC
llvm-svn: 246714
2015-09-02 21:14:53 +00:00
Anton Yartsev 9550590711 [analyzer] Refactoring: bring together scan-build options and environment variables.
Full list of changes:
- all scan-build command-line arguments are now kept in %Options hash.
- most of environment variables scan-build operates with are stored in %EnvVars hash.
- moved processing of command-line arguments to the ProcessArgs subroutine.

llvm-svn: 246710
2015-09-02 21:01:59 +00:00
Eric Christopher 86fdc85181 Migrate the target attribute parsing code to returning an instance
every time it's called rather than attempting to cache the result.
It's unlikely to be called frequently and the overhead of using
it in the first place is already factored out.

llvm-svn: 246706
2015-09-02 20:40:12 +00:00
Sean Silva 0df0391fb6 [modules] Tighten up this test a bit.
llvm-svn: 246702
2015-09-02 20:16:09 +00:00
Eric Christopher 54f29bc2cd Update comment for AdditionalMembers with a note to avoid using
additional data members in attributes as they'll leak and provide
some guidance as to where they should be allocated if necessary.

llvm-svn: 246701
2015-09-02 20:13:41 +00:00
Ivan Krasin 4c3f237edb Do not include default sanitizer blacklists into -M/-MM/-MD/-MMD output.
Summary:
Do not include default sanitizer blacklists into -M/-MM/-MD/-MMD output.

Introduce a frontend option -fdepfile-entry, and only insert them
for the user-defined sanitizer blacklists. In frontend, grab ExtraDeps
from -fdepfile-entry, instead of -fsanitize-blacklist.

Reviewers: rsmith, pcc

Subscribers: cfe-commits

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

llvm-svn: 246700
2015-09-02 20:02:38 +00:00
Sanjay Patel a24296b459 add __builtin_unpredictable and convert to metadata
This patch depends on r246688 (D12341).

The goal is to make LLVM generate different code for these functions for a target that
has cheap branches (see PR23827 for more details):

int foo();

int normal(int x, int y, int z) {
   if (x != 0 && y != 0) return foo();
   return 1;
}

int crazy(int x, int y) {
   if (__builtin_unpredictable(x != 0 && y != 0)) return foo();
   return 1;
}

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

llvm-svn: 246699
2015-09-02 20:01:30 +00:00
Richard Smith f8c3255843 [modules] Don't waste time reading in the names the module file writer gave to blocks. We don't need these names, and decoding the corresponding bitcode has a significant cost.
llvm-svn: 246680
2015-09-02 17:45:54 +00:00
David Majnemer b33cd908d4 [MS ABI] Number unnamed TagDecls which aren't externally visible
TagDecls (structs, enums, etc.) may have the same name for linkage
purposes of one another; to disambiguate, we add a number to the mangled
named.  However, we didn't do this if the TagDecl has a pseudo-name for
linkage purposes (it was defined alongside a DeclaratorDecl or a
TypeNameDecl).

This fixes PR24651.

llvm-svn: 246659
2015-09-02 15:50:38 +00:00
Benjamin Kramer 9b81903607 [OpenMP] Make helper functoin static. NFC.
llvm-svn: 246657
2015-09-02 15:31:05 +00:00
Douglas Katzman 15172619d4 [Shave]: pass through more clang options to moviCompile
llvm-svn: 246652
2015-09-02 13:42:43 +00:00
Douglas Katzman b76a3dfb7d [Sparc]: GCCInstallationDetector should not care if little-endian
llvm-svn: 246650
2015-09-02 13:33:42 +00:00
Aaron Ballman 7f0c25b6c9 Silence a -Wsign-compare warning; NFC.
llvm-svn: 246646
2015-09-02 12:50:12 +00:00
Vedant Kumar 2ea5393ca1 [Sema] Avoid crash on tag-type mismatch (Fixes PR24610)
Differential Revision: http://reviews.llvm.org/D12444

llvm-svn: 246618
2015-09-02 03:27:15 +00:00
Eric Christopher bb0cef6e9c Migrate the target attribute parsing code into an extension off of
the main attribute and cache the results so we don't have to parse
a single attribute more than once.

This reapplies r246596 with a fix for an uninitialized class member,
and a couple of cleanups and formatting changes.

llvm-svn: 246610
2015-09-02 00:12:02 +00:00
Hubert Tong 2cded44d82 Fix assertion failure in TransformOpaqueValueExpr
Summary:
`OpaqueValueExpr`s may not have a source expression (as in the case when
they are created due to a default argument error).
This can cause an assertion failure in `TransformOpaqueValueExpr` during
template instantiation.

This patch fixes the assertion failure.

Reviewers: hfinkel, rsmith

Subscribers: fraggamuffin, cfe-commits

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

Patch by Rachel Craik!

llvm-svn: 246600
2015-09-01 22:50:31 +00:00
Eric Christopher bf91fbab3a Revert "Migrate the target attribute parsing code into an extension off of"
This is failing in release mode. Revert while I figure out what's happening.

This reverts commit r246596.

llvm-svn: 246598
2015-09-01 22:37:03 +00:00
Eric Christopher 21213a7040 Migrate the target attribute parsing code into an extension off of
the main attribute and cache the results so we don't have to parse
a single attribute more than once.

llvm-svn: 246596
2015-09-01 22:03:58 +00:00
Eric Christopher b57804a134 Use hasAttr, not getAttr if we're just checking for presence.
llvm-svn: 246595
2015-09-01 22:03:56 +00:00
David Majnemer b8ed364d8a [MS ABI] Switch to the CRC implementation in LLVM
We now have an implementation of the CRC in LLVM's libSupport.  Let's
consolidate around that one.

llvm-svn: 246591
2015-09-01 21:24:07 +00:00
Nico Weber ee1cff5fab Make trunk release notes point to 3.7, not 3.6
llvm-svn: 246589
2015-09-01 21:13:14 +00:00
Richard Smith d88a7f1a92 Re-commit r246497 (and dependent changes r246524 and r246521), reverted in
r246546, with a workaround for an MSVC 2013 miscompile and an MSVC 2015
rejects-valid.

Original commit message:

[modules] Rework serialized DeclContext lookup table management. Instead of
walking the loaded ModuleFiles looking for lookup tables for the context, store
them all in one place, and merge them together if we find we have too many
(currently, more than 4). If we do merge, include the merged form in our
serialized lookup table, so that downstream readers never need to look at our
imports' tables.

This gives a huge performance improvement to builds with very large numbers of
modules (in some cases, more than a 2x speedup was observed).

llvm-svn: 246582
2015-09-01 20:35:42 +00:00
Eli Bendersky 8ea8b343c4 Fix typo in test
llvm-svn: 246573
2015-09-01 18:56:19 +00:00
Eric Christopher e9cdcaee7b Pull initFeatureMap out of line now that it's used in multiple places.
llvm-svn: 246565
2015-09-01 18:13:20 +00:00
Aaron Ballman 6924dcdf6f Add a new frontend warning for referencing members from the handler of a constructor or destructor function-try-block, which is UB in C++.
This corresponds to the CERT secure coding rule ERR53-CPP.

llvm-svn: 246548
2015-09-01 14:49:24 +00:00
Aaron Ballman 6a4a210126 Reverting r246497 (which requires also reverting r246524 and r246521 to avoid merge conflicts). It broke the build on MSVC 2015. It also broke an MSVC 2013 bot with testing issues.
llvm\tools\clang\lib\serialization\MultiOnDiskHashTable.h(117):
error C2065: 'Files': undeclared identifier

http://bb.pgr.jp/builders/ninja-clang-i686-msc18-R/builds/2917

llvm-svn: 246546
2015-09-01 13:24:39 +00:00
Richard Smith 6307849666 [modules] When emitting line tables, only emit filenames that are actually referenced by the entries that we emit.
llvm-svn: 246534
2015-09-01 07:41:55 +00:00
Richard Smith b5aaf5a57a Don't use fprintf to emit this diagnostic!
llvm-svn: 246526
2015-09-01 02:35:58 +00:00
Richard Smith 86f14e09a6 Use a more appropriate way of writing 1.
llvm-svn: 246524
2015-09-01 02:02:09 +00:00
David Majnemer 7f0674d6f0 [MS ABI] Cleanup get*ForUnnamedTagDecl
Use "lookup" instead of operator[], it will not perform unnecessary
insertions.  No functionality change is intended.

llvm-svn: 246523
2015-09-01 01:53:07 +00:00
Richard Smith 7fa450c6ae [modules] Preserve DeclID order when merging lookup tables to give a more
predictable diagnostic experience. The hash-of-DeclID order we were using
before gave different results on Win32 due to a different predefined
declaration of __builtin_va_list.

llvm-svn: 246521
2015-09-01 01:37:34 +00:00
Yaron Keren a8dde6c83f Fix path seperator for Windows.
llvm-svn: 246520
2015-09-01 01:29:13 +00:00
Hal Finkel 65e1e4dbe0 [PowerPC] Support __builtin_ppc_get_timebase
GCC 4.8+ has a PowerPC-specific intrinsic, __builtin_ppc_get_timebase, to do
what Clang's __builtin_readcyclecounter does. For compatibility with code that
uses GCC's spelling (including glibc), support it as well.

Partially fixes PR23681.

llvm-svn: 246510
2015-08-31 23:55:19 +00:00
Eric Christopher dec31befef Revert "Pull the target attribute parsing out of CGCall and onto TargetInfo."
This reverts commit r246468 while we figure out what to do about Basic and AST.

llvm-svn: 246508
2015-08-31 23:19:55 +00:00
Richard Smith fa715655ee [modules] Add some missing blockinfo records.
llvm-svn: 246504
2015-08-31 22:43:10 +00:00
Richard Smith 9ce2b45936 [modules] Rework serialized DeclContext lookup table management. Instead of
walking the loaded ModuleFiles looking for lookup tables for the context, store
them all in one place, and merge them together if we find we have too many
(currently, more than 4). If we do merge, include the merged form in our
serialized lookup table, so that downstream readers never need to look at our
imports' tables.

This gives a huge performance improvement to builds with very large numbers of
modules (in some cases, more than a 2x speedup was observed).

llvm-svn: 246497
2015-08-31 22:17:11 +00:00
Hans Wennborg 2151d12ec0 Fix CHECK directives that weren't checking.
llvm-svn: 246492
2015-08-31 21:48:52 +00:00
Gabor Horvath 742fd989b5 Revert r246345 until an assertion is fixed.
llvm-svn: 246479
2015-08-31 20:10:35 +00:00
Rafael Espindola c53c5b13be Stop hardcoding GCC paths in crt/ld.so lookup.
This patch refactors the code to use the GCC installation detector
(modified so that it works in Solaris), and uses
ToolChain::GetFilePath everywhere once it works.

Patch by Xan López <xan@igalia.com>!

llvm-svn: 246473
2015-08-31 19:17:51 +00:00