Commit Graph

59913 Commits

Author SHA1 Message Date
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
David Majnemer 0035052729 [MS ABI] Correctly mangle classes without names for linkage purposes
A class without a name for linkage purposes gets a name along the lines
of <unnamed-type-foo> where foo is either the name of a declarator which
defined it (like a variable or field) or a
typedef-name (like a typedef or alias-declaration).

We handled the declarator case correctly but it would fall down during
template instantiation if the declarator didn't share the tag's type.
We failed to handle the typedef-name case at all.

Instead, keep track of the association between the two and keep it up to
date in the face of template instantiation.

llvm-svn: 246469
2015-08-31 18:48:39 +00:00
Eric Christopher d40722e267 Pull the target attribute parsing out of CGCall and onto TargetInfo.
Also:
  - Add a typedef to make working with the result easier.
  - Update callers to use the new function.
  - Make initFeatureMap out of line.

llvm-svn: 246468
2015-08-31 18:39:22 +00:00
Eric Christopher a8a14c3d88 Pull out the ppc incompatible features check into a separate function.
llvm-svn: 246467
2015-08-31 18:39:16 +00:00
Jingyue Wu 2d69f9608e [CUDA] fix codegen for __nvvm_atom_min/max_gen_u*
Summary: Clang should emit "atomicrmw umin/umax" instead of "atomicrmw min/max".

Reviewers: eliben, tra

Subscribers: llvm-commits

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

llvm-svn: 246455
2015-08-31 17:25:51 +00:00
Benjamin Kramer ec5f51ffe4 [OpenMP] base specific_clause_iterator on iterator_adaptor_base.
Removes some boilerplate code. No functionality change intended.

llvm-svn: 246452
2015-08-31 16:45:35 +00:00
Andrey Bokhanko cab5858e1b PR17829: Proper diagnostic of mangled names conflicts
Proper diagnostic and resolution of mangled names conflicts between C++ methods
and C functions. This patch implements support for functions/methods only;
support for variables is coming separately.

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

llvm-svn: 246438
2015-08-31 13:20:44 +00:00
Igor Breger b5ba2319f6 AVX-512: Changed cnt parameter in valignq/d intrinsic from i8 to i32 according to the Intel Spec
Differential Revision: http://reviews.llvm.org/D12274

llvm-svn: 246430
2015-08-31 11:15:06 +00:00
Alexey Bataev d6fdc8b685 [OPENMP 4.0] Codegen for array sections.
Added codegen for array section in 'depend' clause of 'task' directive. It emits to pointers, one for the begin of array section and another for the end of array section. Size of the section is calculated as (end + 1 - start) * sizeof(basic_element_type).

llvm-svn: 246422
2015-08-31 07:32:19 +00:00
Alexey Bader f961e755b1 [OpenCL] Improve diagnostics detecting implicit vector conversion.
Reviewers: pekka.jaaskelainen

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

llvm-svn: 246393
2015-08-30 18:06:39 +00:00
Yaron Keren 2dbe3440d5 Fix test for Release builds, the label form is <label>:14, not <label>14.
llvm-svn: 246391
2015-08-30 17:46:43 +00:00
Yaron Keren 43e184ee0c Make test resistant to false matches of numbered (unnamed) labels inside other numbers.
In release builds labels are numbers. Matching just the number may result
in false matches where the label is contained in other numbers, such as
14 inside [114 x i8]. A stricter match requiring start of line or > character
before the label avoids these false matches.

llvm-svn: 246385
2015-08-30 15:24:46 +00:00
Benjamin Kramer fc600dc2ec [OpenMP] Make the filetered clause iterator a real iterator and type safe.
This replaces the filtered generic iterator with a type-specfic one based
on dyn_cast instead of comparing the kind enum. This allows us to use
range-based for loops and eliminates casts. No functionality change
intended.

llvm-svn: 246384
2015-08-30 15:12:28 +00:00
Chandler Carruth d96f37a772 Update for several APIs in LLVM that now use StringRefs rather than
const char pointers. In turn, push this through Clang APIs as well,
simplifying a number of bits of code that was handling the oddities of
nullptrs.

llvm-svn: 246375
2015-08-30 07:51:18 +00:00
Chandler Carruth aa0caeb431 Update for API change in LLVM: ARMTargetParser class is just the ARM
namespace.

llvm-svn: 246368
2015-08-30 02:16:36 +00:00
Simon Pilgrim e7708a84b9 [X86] Reapplied r246204, r246206, r246211, r246223
(Re)added debug codegen test for F16C, FMA4, XOP + 3DNow! intrinsics

Part of PR24590

llvm-svn: 246363
2015-08-29 17:13:40 +00:00
David Majnemer c378ca5043 [AST] Don't crash when comparing incomplete object
We cannot tell if an object is past-the-end if its type is incomplete.
Zero sized objects satisfy past-the-end criteria and our object might
turn out to be such an object.

This fixes PR24622.

llvm-svn: 246359
2015-08-29 08:32:55 +00:00
Eric Christopher a15a35e552 Add a check for a function we're not testing.
llvm-svn: 246355
2015-08-29 02:59:37 +00:00
Hans Wennborg a37b065e8f Follow-up to r246338: use getParentFunctionOrMethod
llvm-svn: 246348
2015-08-28 22:56:21 +00:00
Richard Smith d35cb054c9 PR24612: Don't bail out of checking a constexpr function before checking
whether it can ever produce a constant expression in the case where it has a
void return type and no return statements.

llvm-svn: 246347
2015-08-28 22:33:53 +00:00
Eric Christopher 007b0a0e27 Fold TargetInfo::handleUserFeatures into TargetInfo::initFeatureMap.
llvm-svn: 246346
2015-08-28 22:32:01 +00:00
Devin Coughlin 35d5dd2986 [analyzer] When memcpy'ing into a fixed-size array, do not invalidate entire region.
Change the analyzer's modeling of memcpy to be more precise when copying into fixed-size
array fields. With this change, instead of invalidating the entire containing region the
analyzer now invalidates only offsets for the array itself when it can show that the
memcpy stays within the bounds of the array.

This addresses false positive memory leak warnings of the kind reported by
krzysztof in https://llvm.org/bugs/show_bug.cgi?id=22954

A patch by Pierre Gousseau!

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

llvm-svn: 246345
2015-08-28 22:26:05 +00:00
Hans Wennborg 6eaa8323a8 Allow TLS vars in dllimport/export functions; only inline dllimport functions when safe (PR24593)
This patch does two things:

1) Don't error about dllimport/export on thread-local static local variables.
   We put those attributes on static locals in dllimport/export functions
   implicitly in case the function gets inlined. Now, for TLS variables this
   is a problem because we can't import such variables, but it's a benign
   problem becase:

2) Make sure we never inline a dllimport function TLS static locals. In fact,
   never inline a dllimport function that references a non-imported function
   or variable (because these are not defined in the importing library). This
   seems to match MSVC's behaviour.

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

llvm-svn: 246338
2015-08-28 21:47:01 +00:00
Aaron Ballman 6e14652550 Updating the AST matcher documentation with a new entry; NFC.
llvm-svn: 246324
2015-08-28 19:39:56 +00:00
Renato Golin b9365ae36a Revert "[X86][3DNow] Added debug codegen test for 3DNow! intrinsics"
This reverts commit r246223, as it broke all ARM/AArch64 bots.

llvm-svn: 246323
2015-08-28 19:39:29 +00:00