Commit Graph

64908 Commits

Author SHA1 Message Date
Davide Italiano b99fabd4ec [CodeGen] Handle recursion in LLVMIRGeneration Timer.
This can happen when emitting a local decl, which triggers
loading a decl imported from an AST file, which we then
hand to the AST consumer. Timer is not allowed to recurse
so an assertion fire. Keep a reference counter to avoid this
problem. LGTM'd by Richard Smith on IRC.

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

llvm-svn: 276242
2016-07-21 06:28:48 +00:00
George Burgess IV 92b43a462e [Sema] Fix PR28623.
In atomic builtins, we assumed that the LValue conversion on the first
argument would succeed. So, we would crash given code like:

```
void ovl(char);
void ovl(int);
__atomic_store_n(ovl, 0, 0);
```

This patch makes us not assume that said conversion is successful. :)

llvm-svn: 276232
2016-07-21 03:28:13 +00:00
Xinliang David Li 7cd5e38d75 [Profile] Document new profile file name modifiers
Differential Revision: http://reviews.llvm.org/D22593

llvm-svn: 276207
2016-07-20 23:32:50 +00:00
Kelvin Li 986330c190 [OpenMP] Sema and parsing for 'target simd' pragma
This patch is to implement sema and parsing for 'target simd' pragma.

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

llvm-svn: 276203
2016-07-20 22:57:10 +00:00
Richard Smith 423f46f2d8 Fix memory leak introduced in r276159.
llvm-svn: 276188
2016-07-20 21:38:26 +00:00
John McCall 4c7718d51b When copying an array into a lambda, destroy temporaries from
the copy-constructor immediately and enter a partial array
cleanup for previously-copied elements.

Fixes PR28595.

llvm-svn: 276180
2016-07-20 21:02:43 +00:00
Kelvin Li ad9ecbab42 [OpenMP] Allow negative lower bound in array sections based on pointers
OpenMP 4.5 removed the restriction that array section lower bound must be non negative.
This change is to allow negative values for array section based on pointers.
For array section based on array type there is still a restriction: "The array section must be a subset of the original array."

Patch by David S.

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

llvm-svn: 276177
2016-07-20 20:45:29 +00:00
Kelvin Li 4f161cf1c2 [OpenMP] Ignore parens in atomic capture
Clang misdiagnoses atomic captures cases that contains parens.
i.e.

  int v, int *p;
#pragma omp atomic capture
{ v = (*p); (*p)++; }

Patch by David S.

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

llvm-svn: 276167
2016-07-20 19:41:17 +00:00
Yaxun Liu 37ceedeabd [OpenCL] AMDGCN target will generate images in constant address space
Allows AMDGCN target to generate images (such as %opencl.image2d_t) in constant address space.
Images will still be generated in global address space by default.

Added tests to existing opencl-types.cl in test\CodeGenOpenCL.

Patch by Aaron En Ye Shi.

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

llvm-svn: 276161
2016-07-20 19:21:11 +00:00
Richard Smith dc1f042171 [modules] Don't emit initializers for VarDecls within a module eagerly whenever
we first touch any part of that module. Instead, defer them until the first
time that module is (transitively) imported. The initializer step for a module
then recursively initializes modules that its own headers imported.

For example, this avoids running the <iostream> global initializer in programs
that don't actually use iostreams, but do use other parts of the standard
library.

llvm-svn: 276159
2016-07-20 19:10:16 +00:00
Richard Smith 3b24b808a7 Fix modules self-host: add missing include and forward-decl.
llvm-svn: 276152
2016-07-20 18:28:19 +00:00
Reid Kleckner 8ad06d6546 [MS] Improve VPtrInfo field names and doc comments
'ReusingBase' was a terrible name. It might actually refer to the most
derived class, which is not a base. 'BaseWithVPtr' was also bad, since
again, it could refer to the most derived class. It was actually the
first base to introduce the vptr, so now it is 'IntroducingObject'.

llvm-svn: 276120
2016-07-20 14:40:25 +00:00
Simon Pilgrim e3b9ee0645 [X86][SSE] Reimplement SSE fp2si conversion intrinsics instead of using generic IR
D20859 and D20860 attempted to replace the SSE (V)CVTTPS2DQ and VCVTTPD2DQ truncating conversions with generic IR instead.

It turns out that the behaviour of these intrinsics is different enough from generic IR that this will cause problems, INF/NAN/out of range values are guaranteed to result in a 0x80000000 value - which plays havoc with constant folding which converts them to either zero or UNDEF. This is also an issue with the scalar implementations (which were already generic IR and what I was trying to match).

This patch changes both scalar and packed versions back to using x86-specific builtins.

It also deals with the other scalar conversion cases that are runtime rounding mode dependent and can have similar issues with constant folding.

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

llvm-svn: 276102
2016-07-20 10:18:01 +00:00
Akira Hatanaka 73118fd10e [Sema] Compute the nullability of a conditional expression based on the
nullabilities of its operands.

This patch defines a function to compute the nullability of conditional
expressions, which enables Sema to precisely detect implicit conversions
of nullable conditional expressions to nonnull pointers.

rdar://problem/25166556

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

llvm-svn: 276076
2016-07-20 01:48:11 +00:00
Hubert Tong 286547a337 Revert r276069: MSVC bots not happy
llvm-svn: 276074
2016-07-20 01:05:31 +00:00
Hubert Tong 9aa955b3ae Fix r276069: add default argument for new parameter
llvm-svn: 276073
2016-07-20 00:57:56 +00:00
Hubert Tong 58dda5a716 Fix r276069: use LLVM_CONSTEXPR
llvm-svn: 276071
2016-07-20 00:41:30 +00:00
Hubert Tong 24ee98e4a5 Concepts: Create space for requires-clause in TemplateParameterList; NFC
Summary:
Space for storing the //constraint-expression// of the
//requires-clause// associated with a `TemplateParameterList` is
arranged by taking a bit out of the `NumParams` field for the purpose
of determining whether there is a //requires-clause// or not, and by
adding to the trailing objects tied to the `TemplateParameterList`. An
accessor is provided.

An appropriate argument is supplied to `TemplateParameterList::Create`
at the various call sites.

Serialization changes will addressed as the Concepts implementation
becomes more solid.

Drive-by fix:
This change also replaces the custom
`FixedSizeTemplateParameterListStorage` implementation with one that
follows the interface provided by `llvm::TrailingObjects`.

Reviewers: aaron.ballman, faisalv, rsmith

Subscribers: cfe-commits, nwilson

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

llvm-svn: 276069
2016-07-20 00:30:15 +00:00
Bruno Cardoso Lopes 1383ddc40b [SemaObjC] Improve ObjCDictionaryLiteral and ObjCArryLiteral diagnostics
Sema actions on ObjCDictionaryLiteral and ObjCArryLiteral are currently
done as a side-effect of Sema upon parent expressions, which incurs of
delayed typo corrections for such literals to be performed by TypoTransforms
upon the ObjCDictionaryLiteral and ObjCArryLiteral themselves instead of
its elements individually.

This is specially bad because it was not designed to act on several
elements; searching through all possible combinations of corrections for
several elements is very expensive. Additionally, when one of the
elements has no correction candidate, we still explore all options and
at the end emit no typo corrections whatsoever.

Do the proper sema actions by acting on each element alone during appropriate
literal parsing time to get proper diagonistics and decent compile time
behavior.

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

rdar://problem/21046678

llvm-svn: 276020
2016-07-19 20:21:18 +00:00
David Majnemer 24547108d6 Let FuncAttrs infer the 'returned' argument attribute
This reverts commit r275756.

llvm-svn: 276014
2016-07-19 19:59:24 +00:00
Yaxun Liu f2e8ab2566 [OpenCL] Fixes bug of missing OCL version metadata on the AMDGCN target
Added the opencl.ocl.version metadata to be emitted with amdgcn. Created a static function emitOCLVerMD which is shared between triple spir and target amdgcn.

Also added new testcases to existing test file, spir_version.cl inside test/CodeGenOpenCL.

Patch by Aaron En Ye Shi.

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

llvm-svn: 276010
2016-07-19 19:39:45 +00:00
Sylvestre Ledru d3078e7d06 Add support of the latest Ubuntu (Yakkety Yak - 16.10)
llvm-svn: 275975
2016-07-19 14:00:57 +00:00
Dmitry Polukhin 4a29007748 Fix for failing bot sanitizer-x86_64-linux-fast after r275970
More info http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/14774/steps/check-clang%20msan/logs/stdio

llvm-svn: 275974
2016-07-19 13:35:15 +00:00
Dmitry Polukhin ba57f02720 Deprecated (legacy) string literal conversion to 'char *' causes strange overloading resolution
It's a patch for PR28050. Seems like overloading resolution wipes out
the first standard conversion sequence (before user-defined conversion)
in case of deprecated string literal conversion.

Differential revision: https://reviews.llvm.org/D21228

Patch by Alexander Makarov

llvm-svn: 275970
2016-07-19 11:29:16 +00:00
Daniel Sanders 6a73883c48 [mips] Correct label prefixes for N32 and N64.
Summary:
N32 and N64 follow the standard ELF conventions (.L) whereas O32 uses its own
($).

This fixes the majority of object differences between -fintegrated-as and
-fno-integrated-as.

Reviewers: sdardis

Subscribers: dsanders, sdardis, llvm-commits

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

llvm-svn: 275967
2016-07-19 10:49:03 +00:00
Simon Atanasyan 603018af40 [driver][mips] Support MIPS targets in modern Android NDK
Initial patch provided by Duane Sand.

llvm-svn: 275949
2016-07-19 07:09:48 +00:00
Alexey Bataev e397812dcb [OPENMP] Removed loop statement as its body executes at most once, NFC.
Removed not required loop statement, addressing comments from Richard
Smith.

llvm-svn: 275947
2016-07-19 05:06:39 +00:00
Alexey Bataev 5140e748b5 [OPENMP] Improved processing of 'priority' clause, NFC.
Removed some old comments + improved handling of 'priority' clause value
during codegen after comments from Richard Smith.

llvm-svn: 275945
2016-07-19 04:21:09 +00:00
Samuel Antao b101838244 Append clang system include path for offloading tool chains.
Summary:
This patch adds clang system include path when offloading tool chains, e.g. CUDA, are used in the current compilation.

This fixes an issue detected by @rsmith in response to r275645.

Reviewers: rsmith, tra

Subscribers: rsmith, cfe-commits

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

llvm-svn: 275931
2016-07-19 00:01:12 +00:00
Samuel Antao dab51bbd48 [OpenMP] Remove dead code in conditional of mappable expressions SEMA.
llvm-svn: 275930
2016-07-18 23:22:11 +00:00
Kelvin Li 9f645ae63b [OpenMP] Fix incorrect diagnostics in map clause
Having the following code pattern will result in incorrect diagnostic

int main() {
  int arr[10];
#pragma omp target data map(arr[:])
#pragma omp target map(arr)
  {}
}

t.cpp:4:24: error: original storage of expression in data environment is shared
      but data environment do not fully contain mapped expression storage
#pragma omp target map(arr)
                       ^~~
t.cpp:3:29: note: used here
#pragma omp target data map(arr[:])
                            ^~~~~~
1 error generated.


Patch by David S.

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

llvm-svn: 275926
2016-07-18 22:49:16 +00:00
Richard Smith cb2ba5a5a7 Fix some minor issues found by Coverity.
llvm-svn: 275925
2016-07-18 22:37:35 +00:00
Vedant Kumar d04929d875 [Coverage] Remove '..' from filenames *after* getting an absolute path
Failure to do this breaks relative paths which begin with '..'.

This issue was caught by the (still nascent) coverage bot.

llvm-svn: 275924
2016-07-18 22:32:02 +00:00
Vedant Kumar 14f8fb6864 [Coverage] Normalize '..' out of filename strings
This fixes the issue of having duplicate entries for the same file in a
coverage report s.t none of the entries actually displayed the correct
coverage information.

llvm-svn: 275913
2016-07-18 21:01:27 +00:00
Bruno Cardoso Lopes d9b7dfe4a4 [Sema] Create a separate group for incompatible function pointer warning
Give incompatible function pointer warning its own diagnostic group
but still leave it as a subgroup of incompatible-pointer-types. This is in
preparation to promote -Wincompatible-function-pointer-types to error on
darwin.

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

rdar://problem/12907612

llvm-svn: 275907
2016-07-18 20:37:06 +00:00
Mehdi Amini 320a5a615b Add missing header in ClangFuzzer (after r275882 cleanup)
llvm-svn: 275906
2016-07-18 20:33:09 +00:00
Bob Wilson 4cf27c4d6f Allow iOS and tvOS version numbers with 2-digit major version numbers.
rdar://problem/26921601

llvm-svn: 275905
2016-07-18 20:29:14 +00:00
Vedant Kumar bf51e703cf [Driver] Compute effective target triples once per job (NFCI)
Compute an effective target triple exactly once in ConstructJob(), and
then simply pass around references to it. This eliminates wasteful
re-computation of effective triples (e.g in getARMFloatABI()).

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

llvm-svn: 275895
2016-07-18 19:56:38 +00:00
Vedant Kumar f2030b931c [Driver] Make Driver::DefaultTargetTriple private (NFCI)
No in-tree targets access this `DefaultTargetTriple` directly, and usage
of default triples is generally discouraged. Make the field private.

This is part of en effort to make the clang driver use effective triples
more pervasively.

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

llvm-svn: 275894
2016-07-18 19:56:33 +00:00
Mehdi Amini 9670f847b8 [NFC] Header cleanup
Summary: Removed unused headers, replaced some headers with forward class declarations

Patch by: Eugene <claprix@yandex.ru>

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

llvm-svn: 275882
2016-07-18 19:02:11 +00:00
Devin Coughlin d2387432bb Revert "[analyzer] Add checker modeling potential C++ self-assignment"
This reverts commit r275820. It is failing on the bots.

llvm-svn: 275880
2016-07-18 18:57:50 +00:00
Yunzhong Gao fc611138eb Support -masm= flag for x86 assembly targets.
For assembly files without .intel_syntax or .att_syntax directives, allow the
-masm= flag to supply a default assembly dialect. For example,

C:\TMP> type intel.s
.text
mov al,0

C:\TMP> clang -masm=intel -c intel.s

Without this patch, one would need to pass an "-mllvm -x86-asm-syntax=" flag
directly to the backend.
C:\TMP> clang -mllvm --x86-asm-syntax=intel -c intel.s

Differentials Review: http://reviews.llvm.org/D22285

llvm-svn: 275877
2016-07-18 18:44:51 +00:00
Hans Wennborg 7e8f01adff docs/conf.py: update version to 4.0
llvm-svn: 275848
2016-07-18 18:13:08 +00:00
Hans Wennborg 60d06bfc4f Trunk release notes are now for 4.0.0
The 3.9 release are on the 3.9 branch.

llvm-svn: 275844
2016-07-18 18:05:19 +00:00
Reid Kleckner 0b6773e189 [clang-cl] Reinstate -gline-tables-only as a CoreOption while we sort out the fate of /Zd
llvm-svn: 275826
2016-07-18 17:49:40 +00:00
Devin Coughlin eea0737a34 [analyzer] Add checker modeling potential C++ self-assignment
This checker checks copy and move assignment operators whether they are
protected against self-assignment. Since C++ core guidelines discourages
explicit checking for `&rhs==this` in general we take a different approach: in
top-frame analysis we branch the exploded graph for two cases, where &rhs==this
and &rhs!=this and let existing checkers (e.g. unix.Malloc) do the rest of the
work. It is important that we check all copy and move assignment operator in top
frame even if we checked them already since self-assignments may happen
undetected even in the same translation unit (e.g. using random indices for an
array what may or may not be the same).

A patch by Ádám Balogh!

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

llvm-svn: 275820
2016-07-18 17:23:30 +00:00
Paul Robinson f9ede1c2fa Release note for 'nodebug' on variables
llvm-svn: 275817
2016-07-18 17:19:12 +00:00
Kelvin Li 2cf4845a5f [OpenMP] update test cases for -std=c++11 compile
target_parallel_for_simd_collapse_messages.cpp and target_parallel_for_simd_ordered_messages.cpp give different diagnostic messages in compiling with -std=c++11. The test cases are updated to make it compatible.

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

llvm-svn: 275805
2016-07-18 16:09:53 +00:00
NAKAMURA Takumi 966bde50c3 Revert r275678, "Revert "Revert r275027 - Let FuncAttrs infer the 'returned' argument attribute""
This reverts also r275029, "Update Clang tests after adding inference for the returned argument attribute"

It broke LTO build. Seems miscompilation.

llvm-svn: 275756
2016-07-18 03:23:25 +00:00
Saleem Abdulrasool f7e0e26d99 test: add missing triple to test
The test was relying on the default triple which may not be correct.  Explicitly
provide it a triple.  Should repair the windows on Linux builder.

llvm-svn: 275738
2016-07-17 22:54:42 +00:00
Saleem Abdulrasool 7093e21ea5 CodeGen: honour dllstorage on ObjC types
Add support for ObjC types to respect the DLLImport/DLLExport storage
annotations.  This only effects COFF output.  This would allow usage with
clang/C2, but not with clang/LLVM due to hard coded section names.

llvm-svn: 275737
2016-07-17 22:27:44 +00:00
Saleem Abdulrasool a088ad9721 CodeGen: whitespace, formatting cleanups, NFC
Format some code which was oddly formatted.  Use a bit of auto to make the code
more legible.  NFC.

llvm-svn: 275736
2016-07-17 22:27:41 +00:00
Saleem Abdulrasool e5f3eae854 CodeGen: whitespace cleanup, StringRef usage in ObjC EH type construction
Clean up some formatting issues and use a bit more StringRef based operations
instead of SmallStrings.  NFC.

llvm-svn: 275735
2016-07-17 22:27:38 +00:00
Richard Smith 5eb7e1bf18 Attempt to work around MSVC rejects-valid, round 2.
llvm-svn: 275730
2016-07-17 20:00:59 +00:00
Richard Smith a662e0f738 PR28589: attempt to work around MSVC rejects-valid.
llvm-svn: 275727
2016-07-17 19:24:51 +00:00
David Majnemer 58ed0f3a5c [CodeGen] Some assorted cleanups
No functional change, just some cleanups:
- Use auto when it is appropriate.
- There were some strange static_casts which were superfluous.
- Use range-based for loops when appropriate.
- The dyn_cast_or_null construct was used when null was impossible.

llvm-svn: 275699
2016-07-17 00:39:12 +00:00
Saleem Abdulrasool 10fd1ff56a CodeGen: use StringRefs more in ObjC class generation, NFC
Rather than building up a number of SmallString-s in order to construct a
std::string, use more StringRefs and construct the string once before use.  This
avoids unnecessary string constructions.  NFC.

llvm-svn: 275697
2016-07-16 22:42:06 +00:00
Saleem Abdulrasool bc2d9998ea CodeGen: simplify using a local variable, NFC
Add a couple of local variables for the class interface and the super class
interface.  This allows for the repeated access of the information to be cached
and makes the code simpler to understand.  NFC.

llvm-svn: 275696
2016-07-16 22:42:04 +00:00
Hal Finkel 81cdef31e6 Revert "Revert r275029 - Update Clang tests after adding inference for the returned argument attribute"
This reverts commit r275043 after reapplying the underlying LLVM commit.

llvm-svn: 275679
2016-07-16 07:22:09 +00:00
Sean Silva a834ff260a [Driver] Add flags for enabling both types of PGO Instrumentation
The flags:
Enable IR-level instrumentation -fprofile-generate or -fprofile-generate=
When applying profile data: -fprofile-use=/path/to/profdata

Patch by Jake VanAdrighem!

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

llvm-svn: 275668
2016-07-16 02:54:58 +00:00
Eric Christopher 2a7248f06b Remove extra semi-colon. Fixes warning and Werror bots.
llvm-svn: 275655
2016-07-16 00:58:34 +00:00
Erik Pilkington 29099ded0c [ObjC] Implement @available in the Parser and AST
This patch adds a new AST node: ObjCAvailabilityCheckExpr, and teaches the
Parser and Sema to generate it. This node represents an availability check of
the form:

  @available(macos 10.10, *);

Which will eventually compile to a runtime check of the host's OS version. This
is the first patch of the feature I proposed here:
http://lists.llvm.org/pipermail/cfe-dev/2016-July/049851.html

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

llvm-svn: 275654
2016-07-16 00:35:23 +00:00
Richard Smith 21b3a032af Reimplement ExternalSemaSource delegation in terms of
MultiplexExternalSemaSource to remove one of the places that needs updating
every time the ExternalSemaSource interface changes.

llvm-svn: 275653
2016-07-16 00:35:14 +00:00
Samuel Antao 2f7b339731 Use std::string instead of StringRef when generating the auxiliar triple in the frontend tool.
llvm-svn: 275651
2016-07-16 00:15:56 +00:00
Samuel Antao 2fd32138ef Attempt to fix breakage caused by r275645 for Windows bots.
llvm-svn: 275650
2016-07-15 23:51:21 +00:00
Samuel Antao d06239d359 [CUDA][OpenMP] Create generic offload action
Summary:
This patch replaces the CUDA specific action by a generic offload action. The offload action may have multiple dependences classier in “host” and “device”. The way this generic offloading action is used is very similar to what is done today by the CUDA implementation: it is used to set a specific toolchain and architecture to its dependences during the generation of jobs.

This patch also proposes propagating the offloading information through the action graph so that that information can be easily retrieved at any time during the generation of commands. This allows e.g. the "clang tool” to evaluate whether CUDA should be supported for the device or host and ptas to easily retrieve the target architecture.

This is an example of how the action graphs would look like (compilation of a single CUDA file with two GPU architectures)
```
0: input, "cudatests.cu", cuda, (host-cuda)
1: preprocessor, {0}, cuda-cpp-output, (host-cuda)
2: compiler, {1}, ir, (host-cuda)
3: input, "cudatests.cu", cuda, (device-cuda, sm_35)
4: preprocessor, {3}, cuda-cpp-output, (device-cuda, sm_35)
5: compiler, {4}, ir, (device-cuda, sm_35)
6: backend, {5}, assembler, (device-cuda, sm_35)
7: assembler, {6}, object, (device-cuda, sm_35)
8: offload, "device-cuda (nvptx64-nvidia-cuda:sm_35)" {7}, object
9: offload, "device-cuda (nvptx64-nvidia-cuda:sm_35)" {6}, assembler
10: input, "cudatests.cu", cuda, (device-cuda, sm_37)
11: preprocessor, {10}, cuda-cpp-output, (device-cuda, sm_37)
12: compiler, {11}, ir, (device-cuda, sm_37)
13: backend, {12}, assembler, (device-cuda, sm_37)
14: assembler, {13}, object, (device-cuda, sm_37)
15: offload, "device-cuda (nvptx64-nvidia-cuda:sm_37)" {14}, object
16: offload, "device-cuda (nvptx64-nvidia-cuda:sm_37)" {13}, assembler
17: linker, {8, 9, 15, 16}, cuda-fatbin, (device-cuda)
18: offload, "host-cuda (powerpc64le-unknown-linux-gnu)" {2}, "device-cuda (nvptx64-nvidia-cuda)" {17}, ir
19: backend, {18}, assembler
20: assembler, {19}, object
21: input, "cuda", object
22: input, "cudart", object
23: linker, {20, 21, 22}, image
```
The changes in this patch pass the existent regression tests (keeps the existent functionality) and resulting binaries execute correctly in a Power8+K40 machine.

Reviewers: echristo, hfinkel, jlebar, ABataev, tra

Subscribers: guansong, andreybokhanko, tcramer, mkuron, cfe-commits, arpith-jacob, carlo.bertolli, caomhin

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

llvm-svn: 275645
2016-07-15 23:13:27 +00:00
Argyrios Kyrtzidis d9849a972b [index] Create different USR if a property is a class property.
Avoids USR conflicts between class & instance properties of the same name.

llvm-svn: 275630
2016-07-15 22:18:19 +00:00
Richard Smith 13fb860c78 Revert r275481, r275490. This broke modules bootstrap.
llvm-svn: 275624
2016-07-15 21:33:46 +00:00
Matt Arsenault c7536a5d60 AMDGPU: Remove legacy ldexp builtin
llvm-svn: 275623
2016-07-15 21:33:06 +00:00
Matt Arsenault c86671da09 AMDGPU: Update for rsq intrinsic changes
llvm-svn: 275622
2016-07-15 21:33:02 +00:00
Richard Smith 3cbf3f1f59 Push alias-declarations and alias-template declarations into scope even if
they're redeclarations. This is necessary in order for name lookup to correctly
find the most recent declaration of the name (which affects default template
argument lookup and cross-module merging, among other things).

llvm-svn: 275612
2016-07-15 20:53:25 +00:00
Saleem Abdulrasool 511f2e5a89 Sema: support __declspec(dll*) on ObjC interfaces
Extend the __declspec(dll*) attribute to cover ObjC interfaces.  This was
requested by Microsoft for their ObjC support.  Cover both import and export.
This only adds the semantic analysis portion of the support, code-generation
still remains outstanding.  Add some basic initial documentation on the
attributes that were previously empty.  Tweak the previous tests to use the
relative expected-warnings to make the tests easier to read.

llvm-svn: 275610
2016-07-15 20:41:10 +00:00
Argyrios Kyrtzidis 4278047f64 [test/objcmt] Add a follow-up test case for r275600.
llvm-svn: 275609
2016-07-15 20:40:24 +00:00
Argyrios Kyrtzidis 88737a5aa5 [objcmt] Fix a buffer overflow crash than can occur while modernizing enums.
Note that due to the nature of the crash it requires libgmalloc or asan for it to crash consistently.

rdar://19932927

llvm-svn: 275600
2016-07-15 19:22:34 +00:00
Argyrios Kyrtzidis d798c05526 [AST] Keep track of the left brace source location of a tag decl.
This is useful for source modification tools. There will be a follow-up commit using it.

llvm-svn: 275590
2016-07-15 18:11:33 +00:00
Argyrios Kyrtzidis e59b770518 [objcmt] Don't add an #import of Foundation unnecessarily, if the NS_ENUM macro is already defined.
llvm-svn: 275589
2016-07-15 18:11:27 +00:00
Wei Ding ea41f356bb AMDGPU: Add Clang Builtin for v_lerp_u8
Differential Revision: http://reviews.llvm.org/D22380

llvm-svn: 275577
2016-07-15 16:43:03 +00:00
Dean Michael Berris 57ac95b0a6 XRay: Remove duplicate checks for xray instrumentation flags
llvm-svn: 275570
2016-07-15 15:46:39 +00:00
Aaron Ballman 51fb031a36 Removing a few more :option: tags that we do not have corresponding .. option directives for; these are causing the sphinx bot to fail (http://lab.llvm.org:8011/builders/clang-sphinx-docs/builds/15214/steps/docs-clang-html/logs/stdio).
llvm-svn: 275560
2016-07-15 13:13:45 +00:00
Aaron Ballman 05efec8b84 Removing a few more :option: tags that we do not have corresponding .. option directives for; these are causing the sphinx bot to fail (http://lab.llvm.org:8011/builders/clang-sphinx-docs/builds/15213/steps/docs-clang-html/logs/stdio).
llvm-svn: 275558
2016-07-15 12:55:47 +00:00
Kelvin Li c560949f5c [OpenMP] add check for both simdlen and safelen clauses specified
This patch adds the check for specifying both simdlen and safelen clauses on the 'distribute simd' or 'distribute parallel for simd' constructs.

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

llvm-svn: 275529
2016-07-15 04:39:07 +00:00
Peter Collingbourne 03f8907f65 Frontend: Simplify ownership model for clang's output streams.
This changes the CompilerInstance::createOutputFile function to return
a std::unique_ptr<llvm::raw_ostream>, rather than an llvm::raw_ostream
implicitly owned by the CompilerInstance. This in most cases required that
I move ownership of the output stream to the relevant ASTConsumer.

The motivation for this change is to allow BackendConsumer to be a client
of interfaces such as D20268 which take ownership of the output stream.

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

llvm-svn: 275507
2016-07-15 00:55:40 +00:00
Ben Langmuir 6ecd773202 Remove the new module cache from the index-module test
Forgot to add the new cache to the `rm -rf` line. This broke some bots
when trying to load a module built with an older compiler.

llvm-svn: 275496
2016-07-14 22:53:23 +00:00
Paul Robinson 4e0ff9c46b C does not have inline variables.
Add a few missing tests for related C++ diagnostics.

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

llvm-svn: 275493
2016-07-14 22:22:58 +00:00
Richard Smith 6b016c1575 Add test inputs missed by r275481.
llvm-svn: 275490
2016-07-14 22:15:06 +00:00
Richard Smith 6c35b2dea4 [modules] Don't pass interesting decls to the consumer for a module file that's
passed on the command line but never actually used. We consider a (top-level)
module to be used if any part of it is imported, either by the current
translation unit, or by any part of a top-level module that is itself used.

(Put another way, a module is used if an implicit modules build would have
loaded its .pcm file.)

llvm-svn: 275481
2016-07-14 21:50:09 +00:00
Argyrios Kyrtzidis 6f10b74be0 [arcmt/objcmt] Fix ParentMap crash with invalid code.
rdar://22489560

llvm-svn: 275466
2016-07-14 20:21:16 +00:00
Ben Langmuir 5cd6abdd23 Attempt to workaround Windows bots after my previous commit
For some reason it seems the second invocation is getting DMOD_OTHER_H
set to a path with/forward/slashes, but one of the use sites
has\back\slashes. There should be no difference with what was already
there, but for now try to avoid checking those paths.

llvm-svn: 275464
2016-07-14 20:08:43 +00:00
Roger Ferrer Ibanez 58b8e483f0 Reverting 275417
This change has triggered unexpected failures.

llvm-svn: 275462
2016-07-14 20:05:30 +00:00
Sean Callanan 488f861b83 When importing classes and structs with anonymous structs, it is critical that
distinct anonymous structs remain distinct despite having similar layout.

This is already ensured by distinguishing based on their placement in the parent
struct, using the function `findAnonymousStructOrUnionIndex`.

The problem is that this function only handles anonymous structs, like
```
class Foo { struct { int a; } }
```
and not untagged structs like
```
class Foo { struct { int a; } var; }
```
Both need to be handled, and this patch fixes that.  The test case ensures that this functionality doesn't regress.

Thanks to Manman Ren for review.

https://reviews.llvm.org/D22270

llvm-svn: 275460
2016-07-14 19:53:44 +00:00
Ben Langmuir 6aed6b4f01 [index] Index system ImportDecls even when there is a DeclarationsOnly filter
Whether we call an ImportDecl a decl or a reference symbol role is
somewhat academic, but in practice it's more like a declaration because
it is interesting even to consumers who wouldn't care about references.
Most importantly, we want to report the module dependencies of system
modules even when we have declaration-only filtering.

rdar://problem/27134855

llvm-svn: 275454
2016-07-14 18:51:55 +00:00
Aaron Ballman 4f6b3ecfd2 Despite there being an option, it seems that Sphinx has decided that "=123" is part of the option directive name, and so having "=0" in the option tag is problematic. Since the option tag is part of the option directive definition, it's superfluous, and so I've removed it.
llvm-svn: 275440
2016-07-14 17:15:06 +00:00
Aaron Ballman dea435261d Removing a few more :option: tags that we do not have corresponding .. option directives for; these are causing the sphinx bot to fail (http://lab.llvm.org:8011/builders/clang-sphinx-docs/builds/15197/steps/docs-clang-html/logs/stdio).
llvm-svn: 275430
2016-07-14 15:32:11 +00:00
Benjamin Kramer 09a9c5537d [OpenCL] In test/Driver/opencl.cl, don't require name of Clang binary to contain "clang"
The test currently fails if the name of the Clang binary doesn't contain "clang".

This patch removes that requirement, as some environments may choose to run the test with a differently named binary. This shouldn't make the test any less strict -- the only place where the flags we're searching for can really occur is the Clang command line.

Patch by Martin Böhme!

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

llvm-svn: 275428
2016-07-14 15:06:57 +00:00
Roger Ferrer Ibanez 585ea9ddce Diagnose taking address and reference binding of packed members
This patch implements PR#22821.

Taking the address of a packed member is dangerous since the reduced
alignment of the pointee is lost. This can lead to memory alignment
faults in some architectures if the pointer value is dereferenced.

This change adds a new warning to clang emitted when taking the address
of a packed member. A packed member is either a field/data member
declared as attribute((packed)) or belonging to a struct/class
declared as such. The associated flag is -Waddress-of-packed-member.
Conversions (either implicit or via a valid casting) to pointer types
with lower or equal alignment requirements (e.g. void* or char*)
silence the warning.

This change also adds a new error diagnostic when the user attempts to
bind a reference to a packed member, regardless of the alignment.

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

llvm-svn: 275417
2016-07-14 14:10:43 +00:00
Aaron Ballman 34be2a0a61 Removing more :option: tags that we do not have corresponding .. option directives for; these are causing the sphinx bot to fail (http://lab.llvm.org:8011/builders/clang-sphinx-docs/builds/15195/steps/docs-clang-html/logs/stdio).
llvm-svn: 275416
2016-07-14 14:07:37 +00:00
Pierre Gousseau e3014fc144 The test added in r275267 does not work on read-only checkouts because of the use of touch -m -t.
Following Tom Rybka suggestion, the test files are now copied to a temporary directory first.

llvm-svn: 275415
2016-07-14 13:58:27 +00:00
Benjamin Kramer 56a46bc680 Upgrade all the .arcconfigs to https.
llvm-svn: 275409
2016-07-14 13:15:37 +00:00
Aaron Ballman c337fafa36 This is a malformed :option: tag -- we don't have an option directive that matches it, so turning it actual text instead of a markup tag. This will hopefully fix the clang docs build (http://lab.llvm.org:8011/builders/clang-sphinx-docs/builds/15194/steps/docs-clang-html/logs/stdio)
llvm-svn: 275407
2016-07-14 13:01:00 +00:00
Benjamin Kramer 69c476ccd2 [OpenCL] Actually activate Frontend/opencl.cl test and fix test bugs
rL275318 added the test Frontend/opencl.cl test, but that test was never actually run because Frontend/lit.local.cfg doesn't contain the '.cl' file suffix.

Once the test is activated, it fails with (unintended) compile errors in the newly added CHECK_INVALID_OPENCL_VERSION checks.

This patch adds the '.cl' file suffix to Frontend/lit.local.cfg to activate the test and fixes the test bug by adding '-fblocks' to the relevant command lines.

Patch by Martin Böhme!

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

llvm-svn: 275405
2016-07-14 12:56:21 +00:00
Aaron Ballman 745e752725 Correct the attribute documentation for the new XRay attributes. Fixes the documentation build.
llvm-svn: 275404
2016-07-14 12:35:00 +00:00
Asaf Badouh a0b6f8fb56 [X86][AVX512F] minor fix of the parameter names
add "__" prefix

llvm-svn: 275384
2016-07-14 08:40:30 +00:00
Dean Michael Berris 25a1564e6c Use hasFlag instead of hasArg
Summary: Fix the build to use hasFlag instead of hasArg for checking some flags.

Reviewers: echristo

Subscribers: mehdi_amini, cfe-commits

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

llvm-svn: 275377
2016-07-14 06:37:46 +00:00
Dean Michael Berris 39baab9326 Add C++ dependencies to xray runtime
Summary:
Depends on D21982 which implements the in-memory logging implementation of the
XRay runtime. These additional changes also depends on D20352 which adds the
bulk of XRay flags/dependencies when using the `-fxray-instrument` flag from
Clang.

Reviewers: echristo, rnk, aaron.ballman

Subscribers: mehdi_amini, cfe-commits

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

llvm-svn: 275368
2016-07-14 04:58:44 +00:00
Kelvin Li a579b9196c [OpenMP] Sema and parsing for 'target parallel for simd' pragma
This patch is to implement sema and parsing for 'target parallel for simd' pragma.

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

llvm-svn: 275365
2016-07-14 02:54:56 +00:00
Adrian Prantl 284652beec Add a comment mirroring the one in LLVM's Dwarf.h
llvm-svn: 275356
2016-07-14 00:42:53 +00:00
Richard Smith 63497c6492 www/cxx_status: give more precise links to initialization order wording
llvm-svn: 275351
2016-07-14 00:14:59 +00:00
Richard Smith a547eb27fa P0305R0: Semantic analysis and code generation for C++17 init-statement for 'if' and 'switch':
if (stmt; condition) { ... }

Patch by Anton Bikineev! Some minor formatting and comment tweets by me.

llvm-svn: 275350
2016-07-14 00:11:03 +00:00
Aaron Ballman 7d2aecbc76 Add XRay flags to Clang. We implement two flags to control the XRay behaviour:
-fxray-instrument: enables XRay annotation of IR
-fxray-instruction-threshold: configures the threshold for function size (looking at IR instructions), and allow LLVM to decide whether to add the nop sleds later on in the process.

Also implements the related xray_always_instrument and xray_never_instrument function attributes.

Patch by Dean Michael Berris.

llvm-svn: 275330
2016-07-13 22:32:15 +00:00
Argyrios Kyrtzidis 150dcbabbc [test] Add 'env' to fix test failures in windows bots.
llvm-svn: 275324
2016-07-13 22:03:47 +00:00
Kelvin Li 70a12c5dd1 [OpenMP] remove duplicate code in ActOnOpenMPRegionStart
This patch is to remove duplicate code in ActOnOpenMPRegionStart. (NFC)

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

llvm-svn: 275323
2016-07-13 21:51:49 +00:00
Yaxun Liu 02c3979e22 [OpenCL] Fixes failures in test/Driver/opencl.cl.
Also fixes strict-aliasing option to only be allowed when OpenCL Version 1.0. Added testcase in test/Frontend/opencl-blocks.cl.

Patch by Aaron En Ye Shi.

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

llvm-svn: 275318
2016-07-13 21:21:05 +00:00
Kelvin Li 02c15da062 [OpenMP] add more tests for 'distribute parallel for simd' pragma
This patch is to add two additional tests for testing 'distribute parallel for simd' pragma with disallowed clauses and loops.

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

llvm-svn: 275315
2016-07-13 20:40:32 +00:00
Argyrios Kyrtzidis 70ec1c7e62 [PCH/preamble] Make sure that if the preamble/PCH was serialized with errors that we set diagnostic engine state appropriately.
Otherwise there can be a crash with CFG analysis warnings doing work on invalid AST.

Fixes crash of rdar://26224134

llvm-svn: 275313
2016-07-13 20:35:26 +00:00
Kelvin Li 5e00adef36 [OpenMP] add more tests for 'distribute simd' pragma
This patch is to add two additional tests for testing 'distribute simd' pragma with disallowed clauses and loops.

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

llvm-svn: 275306
2016-07-13 19:16:56 +00:00
Yaron Keren 18c3d0674e Implement FunctionDecl::getDefinition() to be consistent with
VarDecl, TagDecl, EnumDecl, RecordDecl, CXXRecordDecl.

Use getDefinition in two locations to make the code more readable.

llvm-svn: 275303
2016-07-13 19:04:51 +00:00
Artem Dergachev 50aece03cb [analyzer] Implement a methond to discover origin region of a symbol.
This encourages checkers to make logical decisions depending on
value of which region was the symbol under consideration
introduced to denote.

A similar technique is already used in a couple of checkers;
they were modified to call the new method.

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

llvm-svn: 275290
2016-07-13 18:07:26 +00:00
Carlo Bertolli 70594e9282 [OpenMP] Initial implementation of parse+sema for OpenMP clause 'is_device_ptr' of target
http://reviews.llvm.org/D22070

llvm-svn: 275282
2016-07-13 17:16:49 +00:00
Carlo Bertolli 2404b17192 [OpenMP] Initial implementation of parse+sema for clause use_device_ptr of 'target data'
http://reviews.llvm.org/D21904

This patch is similar to the implementation of 'private' clause: it adds a list of private pointers to be used within the target data region to store the device pointers returned by the runtime.
Please refer to the following document for a full description of what the runtime witll return in this case (page 10 and 11):
https://github.com/clang-omp/OffloadingDesign

I am happy to answer any question related to the runtime interface to help reviewing this patch.

llvm-svn: 275271
2016-07-13 15:37:16 +00:00
Pierre Gousseau 533a893fa1 [PCH] Add a fno-pch-timestamp option to cc1 to disable inclusion of timestamps in PCH files.
This is to allow distributed build systems, that do not preserve time stamps, to use PCH files.

Second and last part of the patch proposed at:

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

llvm-svn: 275267
2016-07-13 14:21:11 +00:00
Pierre Gousseau 6b2fcef271 [PCH] Fix timestamp check on windows hosts.
On Linux, if the timestamp of a header file, included in the pch, is modified, then including the pch without regenerating it causes a fatal error, which is reasonable.
On Windows the check is ifdefed out, allowing the compilation to continue in a broken state.
The root of the broken state is that, if timestamps dont match, the preprocessor will reparse a header without discarding the pch data.
This leads to "#pragma once" header to be included twice.
The reason behind the ifdefing of the check lacks documentation, and was done 6 years ago.
This change tentatively removes the ifdefing.

First part of patch proposed at:

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

llvm-svn: 275261
2016-07-13 11:58:28 +00:00
Alexey Bader 10e9e59898 [OpenCL] Fix code generation of kernel pipe parameters.
Improved test with user define structure pipe type case.

Reviewers: Anastasia, pxli168
Subscribers: yaxunl, cfe-commits

Differential revision: http://reviews.llvm.org/D21744

llvm-svn: 275259
2016-07-13 10:28:13 +00:00
Etienne Bergeron 14ef11c110 fix missing whitespace in sphinx doc
llvm-svn: 275256
2016-07-13 06:37:39 +00:00
Saleem Abdulrasool 4f515a6e80 CodeGen: minor cleanup, NFC
Initialise more members in initializer lists.  Invert the condition that had
grown to be pretty confusing.  The `_objc_empty_vtable` is only used on macOS
<10.9.  This simplifies the code.  NFC.

llvm-svn: 275241
2016-07-13 02:58:44 +00:00
Justin Lebar e71c08f84c [CUDA] Use the multi-element remove function in EraseUnwantedCUDAMatches.
Summary:
Bug pointed out by Benjamin Kramer in r264008.  I think the bug is
benign because by the time this is called, we should only have at most
two overloads to consider (either a host and a device overload, or a
host+device overload, but not all three).

Reviewers: tra

Subscribers: cfe-commits, bkramer

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

llvm-svn: 275233
2016-07-12 23:23:13 +00:00
Justin Lebar 4c2c6fd1c4 [CUDA] Add additional testcases for EraseUnwantedCUDAMatches.
Summary:
Specifically, this patch adds testcases for all three calls to
EraseUnwantedCUDAMatches.  The addr-of-overloaded-fn test I accidentally
neutered in r264207, which moved much of
CodeGenCUDA/function-overload.cu into SemaCUDA/function-overload.cu.
The coverage from overloaded-delete test is new.

Reviewers: tra

Subscribers: cfe-commits

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

llvm-svn: 275232
2016-07-12 23:23:12 +00:00
Justin Lebar d35f706cc2 [CUDA] Don't assume that destructors can't be overloaded.
Summary:
You can overload a destructor in CUDA, and SemaOverload needs to be
tweaked not to crash when it sees an explicit call to an overloaded
destructor.

Reviewers: rsmith

Subscribers: cfe-commits, tra

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

llvm-svn: 275231
2016-07-12 23:23:01 +00:00
Tim Northover 00dc68dff6 AArch64: fix return type of vqmovun_high_*.
These should be returning an unsigned quantity.

llvm-svn: 275195
2016-07-12 17:38:50 +00:00
David Majnemer f763b6711e Fix for the mingw builder
llvm-svn: 275191
2016-07-12 16:56:33 +00:00
David Majnemer 6d2b60a2be [ItaniumMangle] Correctly mangle BuiltinTemplateDecls
A BuiltinTemplateDecl has no underlying templated decl and as such they
cannot be relied upon for mangling.  The ItaniumMangler had some bugs
here which lead to crashes.

This fixes PR28519.

llvm-svn: 275190
2016-07-12 16:48:17 +00:00
Daniel Jasper d9d8da2821 clang-format: [JS] Allow top-level conditionals again.
I am not sure exactly which test breakage Martin was trying to fix in
r273694. For now, fix the behavior for top-level conditionals, which
(surprisingly) are actually used somewhat commonly.

llvm-svn: 275183
2016-07-12 15:45:53 +00:00
Michael Zuckerman 3378653f8d [Clang][AVX512] Making cosmetic changes
llvm-svn: 275169
2016-07-12 12:42:27 +00:00
Clement Courbet 425175934e [ASTMatchers] isSignedInteger() and isUnsignedInteger()
Complementary to isInteger(), these match signed and unsigned integers
respectively.

Review: http://reviews.llvm.org/D21989
llvm-svn: 275157
2016-07-12 06:36:00 +00:00
David Majnemer 526793d14c [MS ABI] Support throwing/catching __unaligned types
We need to mark the appropriate bits in ThrowInfo and HandlerType so
that the personality routine can correctly handle qualification
conversions.

llvm-svn: 275154
2016-07-12 04:42:50 +00:00
Wolfgang Pieb 002df71dd3 Correcting the previous fix for test submitted with r275115.
llvm-svn: 275128
2016-07-11 23:27:19 +00:00
Wolfgang Pieb c72930dba5 Fix test submitted with r275115 (failed on ppc64 buildbots).
llvm-svn: 275127
2016-07-11 23:20:28 +00:00
Vedant Kumar 93205af066 [Coverage] Do not map regions from system headers
Do not assign source regions located within system headers file ID's,
and do not construct counter mapping regions out of them.

This makes coverage reports less cluttered and less mysterious. E.g
using the "assert" macro doesn't cause assert.h to appear in reports,
and it no longer shows the "assertion failed" branch as an uncovered
region.

It also makes coverage mapping sections a bit smaller (e.g a 1%
reduction in a stage2 build of bin/llvm-as).

llvm-svn: 275121
2016-07-11 22:57:46 +00:00
Vedant Kumar c468bb8b29 [Coverage] Move logic to skip decl's into a helper (NFC)
llvm-svn: 275120
2016-07-11 22:57:44 +00:00
Wolfgang Pieb 5675c96987 Prevent the creation of empty (forwarding) blocks resulting from nested ifs.
Summary:
Nested if statements can generate empty BBs whose terminator branches 
unconditionally to its successor. These branches are not eliminated
to help generate better line number information in some cases, but there
is no reason to keep the empty blocks that result from nested ifs.

Reviewers: mehdi_amini, dblaikie, echristo

Subscribers: mehdi_amini, cfe-commits

Differential review: http://reviews.llvm.org/D11360
 

llvm-svn: 275115
2016-07-11 22:22:23 +00:00
Erik Pilkington f1996e567a [NFC] Reorder fields of VersionTuple to reduce size
Differential revision: http://reviews.llvm.org/D19934

llvm-svn: 275095
2016-07-11 20:00:48 +00:00
David Majnemer c2406d46b8 [Sema] Don't artificially forbid BuiltinTemplateDecls in CheckTemplateArgument
After thinking about it, we don't really need to forbid
BuiltinTemplateDecls explicitly.  The restriction doesn't really buy us
anything.

llvm-svn: 275078
2016-07-11 17:09:56 +00:00
Adrian Prantl 59a6e24d8d [man page] Document -gline-tables-only in the clang man page.
llvm-svn: 275076
2016-07-11 17:03:16 +00:00
Adrian Prantl 6e7300bdd0 [man page] Fix two sphinx build errors.
These options were referenced by other paragraphs, but never specified.

llvm-svn: 275075
2016-07-11 17:03:13 +00:00
Eric Liu 4f8d99433d Make tooling::applyAllReplacements return llvm::Expected<string> instead of empty string to indicate potential error.
Summary:
return llvm::Expected<> to carry error status and error information.
This is the first step towards introducing "Error" into tooling::Replacements.

Reviewers: djasper, klimek

Subscribers: ioeric, klimek, cfe-commits

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

llvm-svn: 275062
2016-07-11 13:53:12 +00:00
Anastasia Stulova 4d85003964 [OpenCL] Improved diagnostics of OpenCL types.
- Changes diagnostics for Blocks to be implicitly
const qualified OpenCL v2.0 s6.12.5.

 - Added and unified diagnostics of some OpenCL special types:
blocks, images, samplers, pipes. These types are intended for use
with the OpenCL builtin functions only and, therefore, most regular
uses are not allowed including assignments, arithmetic operations,
pointer dereferencing, etc.

Review: http://reviews.llvm.org/D21989
llvm-svn: 275061
2016-07-11 13:46:02 +00:00
Craig Topper 4d61a3c2d8 [AVX512] Replace masked AND/OR/XOR intrinsics with native code and remove the builtins.
llvm-svn: 275049
2016-07-11 06:14:18 +00:00
David Majnemer f580dd98cb [Sema] Disallow __make_integer_seq from showing up in __make_integer_seq
We hit over stringent asserts when trying to diagnose.  Loosen them as
appropriate.

This fixes PR28494.

llvm-svn: 275047
2016-07-11 05:59:24 +00:00
Hal Finkel 9a17d7ac6e Revert r275029 - Update Clang tests after adding inference for the returned argument attribute
The associated backend change is causing miscompiles from the AArch64 backend.

llvm-svn: 275043
2016-07-11 04:52:07 +00:00
David Majnemer 60e5bdc470 [CodeGen] Treat imported static local variables as declarations
Imported variables cannot really be definitions for the purposes of
IR generation.

llvm-svn: 275040
2016-07-11 04:28:21 +00:00
Saleem Abdulrasool 37bf71828b Reapply SVN r274797.
Original Commit Message

    Driver: Stop linking to C++ when using sanitizers on Darwin

    Sanitizers on Darwin are built as dynamic libraries, not static libraries.
    Sanitizers will have their C++ dependency satisfied internally (LC_LOAD_DYLIB)
    in the libclang_rt dylib. As long as the sanitizers stay dynamic and not static,
    linking against C++ when enabling a sanitizer becomes over linkage.

    Patch by Dave Lee!

llvm-svn: 275032
2016-07-10 23:24:36 +00:00
Jan Vesely d7e03a5bd9 AMDGPU: Export workitem builtins
Reviewers: tstellardAMD

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

llvm-svn: 275030
2016-07-10 22:38:04 +00:00
Hal Finkel 617c962752 Update Clang tests after adding inference for the returned argument attribute
Adjusting tests after r275027.

llvm-svn: 275029
2016-07-10 22:26:52 +00:00
Craig Topper 8a62061e37 [AVX512] Remove masked shufps/shudpd builtins. These are all handled with __builtin_shufflevector.
llvm-svn: 275018
2016-07-10 16:35:54 +00:00
Craig Topper 6e76fb61a7 [X86] Use __butilin_shufflevector for 512-bit shufps intrinsics.
llvm-svn: 275012
2016-07-10 05:57:21 +00:00
Michael Gottesman eb396a6cbf Add CLANG_BUILD_TOOLS as a clang counterpart for LLVM_BUILD_TOOLS
LLVM_BUILD_TOOLS is a boolean variable that controls whether or not generated
targets for llvm tools are built by the "all" target. CLANG_BUILD_TOOLS is an
analogous variable for clang targets.

This is useful functionality for selectively disabling the building of clang
targets by default to speed up builds.

In terms of implementation, I just followed the model of LLVM's implementation
of this functionality.

llvm-svn: 275006
2016-07-10 01:44:00 +00:00
Sean Silva 9ac6ae2a99 Delete dead code.
We were just setting DisableUnitAtATime to its default value.

llvm-svn: 275005
2016-07-10 00:57:52 +00:00
Michael Gottesman ca589ccb02 Move add_clang_* entry points from the main clang CMakeLists.txt to cmake/modules/AddClang.cmake.
This matches how LLVM has its cmake files organized and is cleaner than just
shoving this business logic into the main CMakeLists.txt.

llvm-svn: 274992
2016-07-09 21:58:40 +00:00
David Majnemer 58fab355e2 [clang-cl] Add support for /Zd
MASM (ML.exe and ML64.exe) and older versions of MSVC (CL.exe) support a
flag called /Zd which is more-or-less -gline-tables-only.

It seems nicer to support this flag instead of exposing
-gline-tables-only.

llvm-svn: 274991
2016-07-09 21:49:16 +00:00
David Majnemer 177553511d [MS ABI] Some code cleanups
Don't create unnecessary truncations if the result will not be used.
Also prefer preforming math before the truncation, it makes it a little
easier to reason about.

llvm-svn: 274984
2016-07-09 19:26:25 +00:00
David Majnemer 97d0517078 [AST] Tighten up some bitfields
Optimize the bitfield types to conserve space for the MSVC ABI.

llvm-svn: 274983
2016-07-09 19:26:19 +00:00
Martin Probst 2a19454a86 clang-format: [JS] Sort imports case insensitive.
Summary: ASCII case sorting does not help finding imported symbols quickly, and it is common to have e.g. class Foo and function fooFactory exported/imported from the same file.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 274977
2016-07-09 15:11:18 +00:00
Martin Probst a8c9d154b8 clang-format: [JS] support trailing commas in imports.
Reviewers: djasper

Subscribers: cfe-commits, klimek

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

llvm-svn: 274976
2016-07-09 15:09:22 +00:00
Benjamin Kramer 6ec90ec2ab [analyzer] Older version of GCC 4.7 crash on lambdas in default arguments.
llvm-svn: 274975
2016-07-09 12:16:58 +00:00
Benjamin Kramer 951a6287c7 [analyzer] Rewrite manual erase loop using remove_if.
No functionality change intended.

llvm-svn: 274974
2016-07-09 11:16:56 +00:00
Craig Topper 95b61b0544 [X86] Use __builtin_ia32_vec_ext_v4hi and __builtin_ia32_vec_set_v4hi to implement pextrw/pinsertw MMX intrinsics instead of trying to use native IR.
Without this we end up generating code that doesn't use mmx registers and probably doesn't work well with other mmx intrinsics.

llvm-svn: 274968
2016-07-09 05:30:41 +00:00
Craig Topper 83c65d7889 [X86] Uncomment the _mm_extract_ps test and add checks.
llvm-svn: 274965
2016-07-09 04:38:17 +00:00
Saleem Abdulrasool 0295f8ce39 CodeGen: tweak CFString section for COFF, ELF
Place the structure data into `cfstring`.  This both isolates the structures to
permit coalescing in the future (by the linker) as well as ensures that it
doesnt get marked as read-only data.  The structures themselves are not
read-only, only the string contents.

llvm-svn: 274956
2016-07-09 01:59:51 +00:00
Vassil Vassilev 1002373946 Teach -ast-print to print constexpr variables.
Patch reviewed by Richard Smith (D22168).

llvm-svn: 274930
2016-07-08 21:09:08 +00:00
Yaxun Liu 79c99fb7eb [OpenCL] Add missing -cl-no-signed-zeros option into driver
Add OCL option -cl-no-signed-zeros to driver options.

Also added to opencl.cl testcases.

Patch by Aaron En Ye Shi.

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

llvm-svn: 274923
2016-07-08 20:28:29 +00:00
Justin Lebar 3e2576f968 Fix flag name in comment in cuda-version-check.cu.
llvm-svn: 274897
2016-07-08 17:59:24 +00:00
NAKAMURA Takumi 097a2b9c88 CFGTests: Update libdeps.
llvm-svn: 274885
2016-07-08 17:06:27 +00:00
NAKAMURA Takumi ab8685e946 clang/unittests/Analysis/CFGTest.cpp: Appease msc targets with -fno-delayed-template-parsing.
llvm-svn: 274879
2016-07-08 16:52:36 +00:00
John Brawn a4403c9708 Explicitly export symbols from the sample analyzer plugin
This is done so that it will work when built using MSVC if
LLVM_EXPORT_SYMBOLS_FOR_PLUGINS=ON.

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

llvm-svn: 274871
2016-07-08 16:20:57 +00:00
Vassil Vassilev cdaa31fe84 Don't crash when printing auto variables.
Patch by Axel Naumann!

llvm-svn: 274859
2016-07-08 16:04:22 +00:00
Alexey Bader c813c8113d [OpenCL] Fix access qualifiers handling for typedefs
OpenCL s6.6: "Access qualifier must be used with image object arguments
of kernels and of user-defined functions [...] If no qualifier is
provided, read_only is assumed".

This does not define the behavior for image types used in typedef
declaration, but following the spec logic, we should allow access
qualifiers specification in typedefs, e.g.:

  typedef write_only image1d_t img1d_wo;

Unlike cv-qualifiers, user cannot add access qualifier to a typedef
type, i.e. this is not allowed:

  typedef image1d_t img1d; // note: previously declared 'read_only' here
  void foo(write_only img1d im) {} // error: multiple access qualifier

Patch by Andrew Savonichev.
Reviewers: Anastasia Stulova.

Differential revision: http://reviews.llvm.org/D20948

llvm-svn: 274858
2016-07-08 15:34:59 +00:00
Alexander Kornienko 67d5821695 [ASTMatchers] Add missing forEachArgumentWithParam() to code sample
Reviewers: klimek

Subscribers: cfe-commits, klimek

Patch by Martin Boehme!

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

llvm-svn: 274835
2016-07-08 10:51:00 +00:00
Alexander Kornienko ff2046a93e CFGBuilder: Fix crash when visiting a range-based for over a dependent type
Summary:
CFG generation is expected to fail in this case, but it should not crash.

Also added a test that reproduces the crash.

Reviewers: klimek

Subscribers: cfe-commits

Patch by Martin Boehme!

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

llvm-svn: 274834
2016-07-08 10:50:51 +00:00
Vassil Vassilev 7baef47065 Recommit r274348 and r274349. The Windows failures should be fixed.
Original commit message:
"Add postorder traversal support to the RecursiveASTVisitor.

This feature needs to be explicitly enabled by overriding shouldTraversePostOrder()
as it has performance drawbacks for the iterative Stmt-traversal.

Patch by Raphael Isemann!

Reviewed by Richard Smith and Benjamin Kramer."

llvm-svn: 274830
2016-07-08 08:33:56 +00:00
Craig Topper a1bee4398c [X86] Remove dead builtins that don't exist in the backend intrinsic file and don't have custom handling in CGBuiltins.cpp either.
llvm-svn: 274825
2016-07-08 05:11:47 +00:00
Craig Topper f2f1a099a7 [CodeGen] Use llvm::Type::getVectorNumElements instead of casting to llvm::VectorType and calling getNumElements. This is equivalent and shorter.
llvm-svn: 274823
2016-07-08 02:17:35 +00:00
Craig Topper 0160063aeb [X86] Reuse existing lambda and remove unnecessary argument from vector cmp builtin handling. NFC
llvm-svn: 274821
2016-07-08 01:57:24 +00:00
Craig Topper 925ef0a135 [X86] Remove a couple calls to create V2F64 and V4F32 types for builtin handling. Just get the type from the operand of the builtin instead. NFC
llvm-svn: 274820
2016-07-08 01:48:44 +00:00
Devin Coughlin cad622742e [analyzer] Add rudimentary handling of AtomicExpr.
This proposed patch adds crude handling of atomics to the static analyzer.
Rather than ignore AtomicExprs, as we now do, this patch causes the analyzer
to escape the arguments. This is imprecise -- and we should model the
expressions fully in the future -- but it is less wrong than ignoring their
effects altogether.

This is rdar://problem/25353187

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

llvm-svn: 274816
2016-07-08 00:53:18 +00:00
Saleem Abdulrasool c61723f73e Revert "Driver: Stop linking to C++ when using sanitizers on Darwin"
This reverts SVN r274797.  It broke the Green Dragon bot.  Revert it until the
failure can be addressed.

llvm-svn: 274814
2016-07-08 00:37:31 +00:00
Michael Kuperstein 123ae0f26b [CUDA] Pass correct option in test.
llvm-svn: 274805
2016-07-07 23:22:39 +00:00
Vedant Kumar 3339c568c4 [Lex] Speed up updateConsecutiveMacroArgTokens (NFC)
SM.isWrittenInSameFile() calls getFileID(), which can be expensive.
Move this check behind some cheaper filters.

llvm-svn: 274800
2016-07-07 22:38:29 +00:00
Simon Pilgrim 13dff57849 Update switch statement to match coding standards.
llvm-svn: 274799
2016-07-07 22:32:26 +00:00
Saleem Abdulrasool a1a36c85df Driver: Stop linking to C++ when using sanitizers on Darwin
Sanitizers on Darwin are built as dynamic libraries, not static libraries.
Sanitizers will have their C++ dependency satisfied internally (LC_LOAD_DYLIB)
in the libclang_rt dylib. As long as the sanitizers stay dynamic and not static,
linking against C++ when enabling a sanitizer becomes over linkage.

Patch by Dave Lee!

llvm-svn: 274797
2016-07-07 21:42:29 +00:00
Chad Rosier 4c077aaabb [AArch64] Change the preferred alignment for char and short.
This reinstates commits r273280 and r273289.

Original Review: http://reviews.llvm.org/D21414.

llvm-svn: 274791
2016-07-07 20:02:25 +00:00
Justin Lebar f39977112a [CUDA] s/OPT_nocuda_version_chec/OPT_no_cuda_version_check/.
Fix build breakage.

llvm-svn: 274782
2016-07-07 18:24:28 +00:00
Justin Lebar c43ad9ee5a [CUDA] Check that our CUDA install supports the requested architectures.
Summary:
Raise an error if you're using a CUDA installation that's too old for
the requested architectures.  In practice, this means that you need a
CUDA 8 install to compile for sm_6*.

Reviewers: tra

Subscribers: cfe-commits

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

llvm-svn: 274781
2016-07-07 18:17:52 +00:00
Justin Lebar 495f1a22af [CUDA] Rename the __nvvm_bar0 builtin back to __syncthreads.
The builtin was renamed in r274770.  But __syncthreads is part of our
user-facing API, so we need to keep the name as-is.

Patch by Justin Bogner.

llvm-svn: 274780
2016-07-07 18:15:03 +00:00
Justin Bogner 2d5de7e568 NVPTX: Use the nvvm builtins to read SRegs rather than the legacy ptx ones
The ptx spellings were removed from LLVM in r274769.

llvm-svn: 274770
2016-07-07 16:41:08 +00:00
Chad Rosier 5ba1d11b5c Revert "[aarch64] Update datalayout for aarch64 tests"
This reverts commit r273289, which was a follow to r273280, which was
reverted because the change was not properly approved.

llvm-svn: 274767
2016-07-07 16:37:21 +00:00
Chad Rosier 3e68af8f3d Revert "[AArch64] Change the preferred alignment for char and short to word alignment"
This reverts commit r273280 as the change was not properly approved.

llvm-svn: 274766
2016-07-07 16:37:19 +00:00
Simon Pilgrim 474c642172 Fix "not all control paths return a value" warning on MSVC
This time without causing a 'all enums handled' warning on other compilers.

llvm-svn: 274748
2016-07-07 11:24:38 +00:00
Simon Pilgrim c6db895ece Fix "not all control paths return a value" warning on MSVC
llvm-svn: 274746
2016-07-07 11:12:02 +00:00
Alexey Bataev be8b8b5bca [OPENMP] Do not create helper expressions in dependent contexts, NFC.
OpenMP relies on some helper expressions generated during semantic
analysis. But they are required only for codegen and not required in
dependent contexts. Patch removes generation of some of helper
expressions.

llvm-svn: 274745
2016-07-07 11:04:06 +00:00
David Majnemer 8aaf372bdf [AST] Tighten up the bitfield in TemplateSpecializationType
Optimize the bitfield types to conserve space for the MSVC ABI.

llvm-svn: 274733
2016-07-07 04:43:11 +00:00
David Majnemer 6fbeee307e [AST] Use ArrayRef in more interfaces
ArrayRef is a little better than passing around a pointer/length
pair.

No functional change is intended.

llvm-svn: 274732
2016-07-07 04:43:07 +00:00
Justin Lebar d9bc485cfe [CUDA] Fix "control reaches end of non-void function" warnings in Cuda.cpp.
Some compilers are too dumb to realize that the switch statement covers
all cases.

(Don't use a "default" label, because we explicitly want to get a warning
if our switch doesn't cover all the cases.)

llvm-svn: 274713
2016-07-07 01:06:59 +00:00
Adrian McCarthy 20128d94e5 Revert "Retry "Include debug info for nested structs and classes""
Reverting because it causes a test failure on build bots (Modules/ModuleDebugInfo.cpp).  Failure does not reproduce locally.

svn revision: rL274698

This reverts commit 3c5ed6599b086720aab5b8bd6941149d066806a6.

llvm-svn: 274706
2016-07-06 23:28:34 +00:00
Adrian McCarthy 0a8cb648c9 Retry "Include debug info for nested structs and classes"
This should work now that the LLVM-side of the change has landed successfully.

Original Differential Revision: http://reviews.llvm.org/D21705

This reverts commit a30322e861c387e1088f47065d0438c6bb019879.

llvm-svn: 274698
2016-07-06 22:39:15 +00:00
Aaron Ballman c1c6823976 Ensuring the bit-fields have the same type; MSVC will place the fields in different allocation units otherwise.
llvm-svn: 274695
2016-07-06 22:06:19 +00:00
Devin Coughlin 0a53fdf00c [analyzer] Suppress false positives in std::shared_ptr
The analyzer does not model C++ temporary destructors completely and so
reports false alarms about leaks of memory allocated by the internals of
shared_ptr:

  std::shared_ptr<int> p(new int(1));
  p = nullptr; // 'Potential leak of memory pointed to by field __cntrl_'

This patch suppresses all diagnostics where the end of the path is inside
a method in std::shared_ptr.

It also reorganizes the tests for suppressions in the C++ standard library
to use a separate simulated header for library functions with bugs
that were deliberately inserted to test suppression. This will prevent
other tests from using these as models.

rdar://problem/23652766

llvm-svn: 274691
2016-07-06 21:52:55 +00:00
Justin Lebar 4b926a29fd [CUDA] Add missing namespace qualification on CudaArch in Action.cpp.
Fix build breakage with MSVC.

llvm-svn: 274689
2016-07-06 21:45:44 +00:00
Justin Lebar 710c13167f [CUDA] Rename member variables in CudaInstallationDetector.
Summary:
Remove the "Cuda" prefix from these variables -- it's clear that they
related to CUDA given their containing type.

Reviewers: tra

Subscribers: cfe-commits

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

llvm-svn: 274682
2016-07-06 21:21:43 +00:00
Justin Lebar 629076178a [CUDA] Add utility functions for dealing with CUDA versions / architectures.
Summary:
Currently our handling of CUDA architectures is scattered all around
clang.  This patch centralizes it.

A key advantage of this centralization is that you can now write a C++
switch on e.g. CudaArch and get a compile error if you don't handle one
of the enum values.

Reviewers: tra

Subscribers: cfe-commits

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

llvm-svn: 274681
2016-07-06 21:21:39 +00:00
Justin Lebar ef1aaac3cc [CUDA] Add support for CUDA 8 and sm_60-62.
Summary: Also add sm_32, which was missing.

Reviewers: tra

Subscribers: cfe-commits

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

llvm-svn: 274680
2016-07-06 21:21:14 +00:00
David Majnemer 36a6e00d6e [CodeGen, DebugInfo] Use hasLocalLinkage instead of hasInternalLinkage
For the purpose of emitting debug info, entities with private linkage
should be treated the same as internal linkage.  While this doesn't
change anything in practice, it makes the code a little less confusing.

llvm-svn: 274677
2016-07-06 21:07:53 +00:00
Justin Bogner 2f8de9fb4f NVPTX: Rename __builtin_ptx_shfl -> __nvvm_shfl
To match "NVPTX: Make the llvm.nvvm.shfl intrinsics and builtin names
consistent" in LLVM.

llvm-svn: 274663
2016-07-06 19:52:32 +00:00
Aaron Ballman affa1c30c2 Ensuring the bit-fields have the same type; MSVC will place the fields in different allocation units otherwise.
llvm-svn: 274654
2016-07-06 18:33:01 +00:00
Aaron Ballman 5c574341f5 Add AST matchers for handling bit-fields and narrowing based on their width.
llvm-svn: 274652
2016-07-06 18:25:16 +00:00
Bruno Cardoso Lopes 2ebe18b609 [SemaExpr] Support assignments from vector to scalars with same size
Before r266366, clang used to support constructs like:

  typedef __attribute__((vector_size(8))) double float64x1_t;
  typedef __attribute__((vector_size(16))) double float64x2_t;
  float64x1_t vget_low_f64(float64x2_t __p0);

  double y = 3.0 + vget_low_f64(v);

But it would reject:

  double y = vget_low_f64(v) + 3.0;

It also always rejected assignments:

  double y = vget_low_f64(v);

This patch: (a) revivies the behavior of `3.0 + vget_low_f64(v)` prior to
r266366, (b) add support for `vget_low_f64(v) + 3.0` and (c) add support for
assignments.

These vector semantics have never really been tied up but it seems
odd that we used to support some binop froms but do not support
assignment. If we did support scalar for the purposes of arithmetic, we
should probably be able to reinterpret as scalar for the purposes of
assignment too.

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

rdar://problem/26093791

llvm-svn: 274646
2016-07-06 18:05:23 +00:00
Adrian McCarthy 743f7f1aff Revert "Include debug info for nested structs and classes"
This reverts commit 0af5ee9631c7c167dc40498b415876553e314c95.

llvm-svn: 274633
2016-07-06 15:15:38 +00:00
Adrian McCarthy 73d726a6cc Include debug info for nested structs and classes
This includes nested types in the member list, even if there are no members of that type. Note that structs and classes have themselves as an "implicit struct" as the first member, so we skip implicit ones.

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

llvm-svn: 274628
2016-07-06 14:46:42 +00:00
Roger Ferrer Ibanez c487614bc0 Add negative test for TBAA
Revision r178818 added tests for TBAA but was missing negative tests to ensure
that TBAA markers are not emitted when TBAA is off.

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

llvm-svn: 274610
2016-07-06 07:13:49 +00:00
Craig Topper 425d02d33e [X86] Use native IR for immediate values 0-7 of packed fp cmp builtins. This makes them the same as what is done when using the SSE builtins for these same encodings.
llvm-svn: 274608
2016-07-06 06:27:31 +00:00
Kelvin Li 787f3fcc6b [OpenMP] Sema and parsing for 'distribute simd' pragma
Summary: This patch is an implementation of sema and parsing for the OpenMP composite pragma 'distribute simd'.

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

llvm-svn: 274604
2016-07-06 04:45:38 +00:00
Craig Topper 46e7555d4b [AVX512] Use the generic ctlz intrinsic to implement the vplzcntd/q builtins.
llvm-svn: 274603
2016-07-06 04:24:29 +00:00
David Majnemer dfecf1a6ca [AST] Use ArrayRef in more interfaces
ArrayRef is a little better than passing around a pointer/length pair.

No functional change is intended.

llvm-svn: 274601
2016-07-06 04:19:16 +00:00
Craig Topper c304d80cec [AVX512] The 128 and 256-bit vplzcnt builtins require avx512cd in addition to avx512vl.
llvm-svn: 274600
2016-07-06 03:25:17 +00:00
Vedant Kumar 1d137f54a3 Delete some dead code, NFC
Found using clang's code coverage tool.

llvm-svn: 274599
2016-07-06 03:08:47 +00:00
Kelvin Li 0cd68276a1 [OpenMP] remove outdated comment (NFC)
llvm-svn: 274577
2016-07-05 21:38:53 +00:00
Erik Pilkington f1bd000f71 [Sema] Fix a bug where pack expansion was not expanded in type alias
The problem is that the parameter pack in a function type type alias is not
reexpanded after being transformed. Also remove an incorrect comment in a
similar function. Fixes PR26017.

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

llvm-svn: 274566
2016-07-05 17:57:24 +00:00
Justin Bogner 2a15ffa2bf Re-apply "test: Use add_lit_testsuites so that subsets of tests can be specified"
This version should actually remove the empty directories I removed
all of the files from. Thanks to tstellar for pointing out git-svn's
--rmdir flag.

Original message:

This creates make/ninja targets like check-clang-codegen and
check-clang-unit, much like LLVM already has. I had to move some input
files into Input directories so they weren't picked up as test
directories.

llvm-svn: 274565
2016-07-05 17:54:40 +00:00
Justin Bogner a73e81c53b Revert "test: Use add_lit_testsuites so that subsets of tests can be specified"
This reverts r274560. It's breaking a bunch of bots due to a directory
with a space in the name. Doesn't repro locally for some reason.

llvm-svn: 274562
2016-07-05 16:14:58 +00:00
Justin Bogner 2976e014fc test: Use add_lit_testsuites so that subsets of tests can be specified
This creates make/ninja targets like check-clang-codegen and
check-clang-unit, much like LLVM already has. I had to move some input
files into Input directories so they weren't picked up as test
directories.

llvm-svn: 274560
2016-07-05 16:06:12 +00:00
Michael Zuckerman b920665493 [Clang][Feature] Adding CLFLUSHOPT feature and intrinsic to clang
Differential Revision: http://reviews.llvm.org/D21792

llvm-svn: 274559
2016-07-05 15:56:03 +00:00
Simon Pilgrim 73ac160dd8 [X86][AVX512] Remove vector BROADCAST builtins.
llvm-svn: 274554
2016-07-05 14:49:31 +00:00
Simon Pilgrim f5a8837e1b [X86][AVX512] Converted the VBROADCAST intrinsics to generic IR
llvm-svn: 274544
2016-07-05 12:59:33 +00:00
Asaf Badouh 136332888a [X86][AVX512F] add float/double abs intrinsics
add abs intrinsics that use native LLVM-IR.
change _mm512_mask[z]_and_epi{32|64} to use select intrinsic

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

llvm-svn: 274542
2016-07-05 12:24:14 +00:00
Asaf Badouh f9cdb8de7a [AVX512] minor fix in sqrt{ss|sd} intrinsics arguments
Differential Revision: http://reviews.llvm.org/D21988

llvm-svn: 274541
2016-07-05 11:36:21 +00:00
Anastasia Stulova db7a31cce7 [OpenCL] An implementation of device side enqueue (DSE) from OpenCL v2.0 s6.13.17.
- Added new Builtins: enqueue_kernel, get_kernel_work_group_size
and get_kernel_preferred_work_group_size_multiple.

These Builtins use custom check to diagnose parameters of the passed Blocks
i. e. variable number of 'local void*' type params, and check different
overloads specified in Table 6.31 of OpenCL v2.0.

- IR is generated as an internal library call for each OpenCL Builtin,
reusing ObjC Block implementation.

Review: http://reviews.llvm.org/D20249
llvm-svn: 274540
2016-07-05 11:31:24 +00:00
Michael Zuckerman a72b49efe4 ntrinsics _mm256_permutexvar_epi64 doesn't accept three parameters as specify bellow.
I deleted the extra mask parameter.

__m256i _mm256_permutexvar_epi64 (__m256i idx, __m256i a)
#include "immintrin.h"
Instruction: vpermq
CPUID Flags: AVX512VL + AVX512F
Description
Shuffle 64-bit integers in a across lanes using the corresponding index in idx, and store the results in dst.
Operation
FOR j := 0 to 3
  i := j*64
    id := idx[i+1:i]*64
      dst[i+63:i] := a[id+63:id]
      ENDFOR
      dst[MAX:256] := 0
      dst[MAX:256] := 0
      
(From: Intel intrinsics guide)        

llvm-svn: 274539
2016-07-05 11:30:31 +00:00
Michael Zuckerman 7dac6fbdf8 [Clang][BuiltIn][AVX512] adding _mm{|256|512}_mask_cvt{s|us|}epi16_storeu_epi8 intrinsics
Differential Revision: http://reviews.llvm.org/D21729

llvm-svn: 274532
2016-07-05 08:08:01 +00:00
Clement Courbet 6ecaec83ba [ASTMatchers] New forEachOverriden matcher.
Matches methods overridden by the given method.

llvm-svn: 274531
2016-07-05 07:49:31 +00:00
Kelvin Li 4a39add05e [OpenMP] Sema and parse for 'distribute parallel for simd'
Summary: This patch is an implementation of sema and parsing for the OpenMP composite pragma 'distribute parallel for simd'.

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

llvm-svn: 274530
2016-07-05 05:00:15 +00:00
Craig Topper 2a383c9273 [X86] Use undefined instead of setzero in shufflevector based intrinsics when the second source is unused. Rewrite immediate extractions in shuffle intrinsics to be in ((c >> x) & y) form instead of ((c & z) >> x). This way only x varies between each use instead of having to vary x and z.
llvm-svn: 274525
2016-07-04 22:18:01 +00:00
Simon Pilgrim 427154db2a [X86][AVX512] Converted the VSHUFPD intrinsics to generic IR
llvm-svn: 274523
2016-07-04 21:30:47 +00:00
Craig Topper 79008a3cc4 [AVX512] Remove VPERMD/VPERMQ/VPERMILPS/VPERMILPD builtins. These were made unused in r274492 and r274502.
llvm-svn: 274516
2016-07-04 19:27:50 +00:00
Anastasia Stulova 7f8d6dc0ef [OpenCL] Make OpenCL Builtins added according to the right version.
Currently we only have OpenCL 2.0 Builtins i.e. pipes or address space conversions.

They have to be added only in the version 2.0 compilation mode to make the identifiers
available for use in the other versions.

Review: http://reviews.llvm.org/D20249
llvm-svn: 274509
2016-07-04 16:07:18 +00:00
Simon Pilgrim 30db811526 [X86][AVX512] Converted the VPERMPD/VPERMQ intrinsics to generic IR
llvm-svn: 274502
2016-07-04 13:34:44 +00:00
Simon Pilgrim 17388f2569 [X86][AVX512] Converted the VPERMILPD/VPERMILPS intrinsics to generic IR
llvm-svn: 274492
2016-07-04 11:06:15 +00:00
Jacob Baungard Hansen 1bf12828be [Sparc] Allow LEON cpu models to be selected with -mcpu
Summary: This change exposes the recently added LEON CPUs (D19359) in the LLVM Sparc backend to Clang, allowing the cpu's to be selected using the -mcpu flag.

Reviewers: jyknight, lero_chris

Subscribers: jyknight, cfe-commits

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

llvm-svn: 274487
2016-07-04 08:56:08 +00:00
Craig Topper ac1823f6e9 [AVX512] Modify what indices we emit for the zero vector we use for zero extension of the result of a v2i1 or v4i1 masked compare. This way we emit something that the backend easily interprets as a concatenation rather than a true shuffle. This delivers slightly better codegen with the current backend capabilities.
llvm-svn: 274484
2016-07-04 07:09:46 +00:00
David Majnemer 3b568aa4ed [Sema] A flexible array member must not be the only named member
We didn't correctly detect situations where a flexible array member was
the only named member in a record.

This fixes PR28407.

llvm-svn: 274477
2016-07-04 00:24:59 +00:00
David Majnemer 8b62269391 [AST] Use ArrayRef in more interfaces
ArrayRef is a little better than passing around a pointer/length pair.

No functional change is intended.

llvm-svn: 274475
2016-07-03 21:17:51 +00:00
Faisal Vali e690b7a3c6 [Refactor NFC] Rename the (non-CCE, fold-failure) Diag during constant expression evaluation as FFDiag.
Currently, we have CCEDiags (C++11 core constant expression diags) and Fold failure diagnostics [I don't claim to yet fully understand exactly why we need the difference].  This patch explicitly replaces Info.Diag (whose use always represents a fold failure diag within the file) with Info.FFDiag.  This makes it more easily greppable in the file, and just like the name Info.CCEDiag, it gives the reader slight further insight into the nature of the diagnostic (as opposed to Info.Diag).

This patch is a preliminary refactoring step in an effort to allow support for compatibility-warnings and extensions (such as constexpr lambda) during constant expression evaluation.

All regressions pass.

llvm-svn: 274454
2016-07-02 22:34:24 +00:00
Sylvestre Ledru c0a3d717c7 fix two typos in the doc
llvm-svn: 274447
2016-07-02 19:17:58 +00:00