]>
granicus.if.org Git - clang/log
David Majnemer [Tue, 12 Jul 2016 04:42:50 +0000 (04:42 +0000)]
[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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275154
91177308 -0d34-0410-b5e6-
96231b3b80d8
Wolfgang Pieb [Mon, 11 Jul 2016 23:27:19 +0000 (23:27 +0000)]
Correcting the previous fix for test submitted with r275115.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275128
91177308 -0d34-0410-b5e6-
96231b3b80d8
Wolfgang Pieb [Mon, 11 Jul 2016 23:20:28 +0000 (23:20 +0000)]
Fix test submitted with r275115 (failed on ppc64 buildbots).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275127
91177308 -0d34-0410-b5e6-
96231b3b80d8
Vedant Kumar [Mon, 11 Jul 2016 22:57:46 +0000 (22:57 +0000)]
[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).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275121
91177308 -0d34-0410-b5e6-
96231b3b80d8
Vedant Kumar [Mon, 11 Jul 2016 22:57:44 +0000 (22:57 +0000)]
[Coverage] Move logic to skip decl's into a helper (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275120
91177308 -0d34-0410-b5e6-
96231b3b80d8
Wolfgang Pieb [Mon, 11 Jul 2016 22:22:23 +0000 (22:22 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275115
91177308 -0d34-0410-b5e6-
96231b3b80d8
Erik Pilkington [Mon, 11 Jul 2016 20:00:48 +0000 (20:00 +0000)]
[NFC] Reorder fields of VersionTuple to reduce size
Differential revision: http://reviews.llvm.org/D19934
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275095
91177308 -0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Mon, 11 Jul 2016 17:09:56 +0000 (17:09 +0000)]
[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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275078
91177308 -0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Mon, 11 Jul 2016 17:03:16 +0000 (17:03 +0000)]
[man page] Document -gline-tables-only in the clang man page.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275076
91177308 -0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Mon, 11 Jul 2016 17:03:13 +0000 (17:03 +0000)]
[man page] Fix two sphinx build errors.
These options were referenced by other paragraphs, but never specified.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275075
91177308 -0d34-0410-b5e6-
96231b3b80d8
Eric Liu [Mon, 11 Jul 2016 13:53:12 +0000 (13:53 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275062
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anastasia Stulova [Mon, 11 Jul 2016 13:46:02 +0000 (13:46 +0000)]
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275061
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 11 Jul 2016 06:14:18 +0000 (06:14 +0000)]
[AVX512] Replace masked AND/OR/XOR intrinsics with native code and remove the builtins.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275049
91177308 -0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Mon, 11 Jul 2016 05:59:24 +0000 (05:59 +0000)]
[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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275047
91177308 -0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Mon, 11 Jul 2016 04:52:07 +0000 (04:52 +0000)]
Revert r275029 - Update Clang tests after adding inference for the returned argument attribute
The associated backend change is causing miscompiles from the AArch64 backend.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275043
91177308 -0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Mon, 11 Jul 2016 04:28:21 +0000 (04:28 +0000)]
[CodeGen] Treat imported static local variables as declarations
Imported variables cannot really be definitions for the purposes of
IR generation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275040
91177308 -0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Sun, 10 Jul 2016 23:24:36 +0000 (23:24 +0000)]
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!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275032
91177308 -0d34-0410-b5e6-
96231b3b80d8
Jan Vesely [Sun, 10 Jul 2016 22:38:04 +0000 (22:38 +0000)]
AMDGPU: Export workitem builtins
Reviewers: tstellardAMD
Differential Revision: http://reviews.llvm.org/D20299
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275030
91177308 -0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Sun, 10 Jul 2016 22:26:52 +0000 (22:26 +0000)]
Update Clang tests after adding inference for the returned argument attribute
Adjusting tests after r275027.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275029
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 10 Jul 2016 16:35:54 +0000 (16:35 +0000)]
[AVX512] Remove masked shufps/shudpd builtins. These are all handled with __builtin_shufflevector.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275018
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 10 Jul 2016 05:57:21 +0000 (05:57 +0000)]
[X86] Use __butilin_shufflevector for 512-bit shufps intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275012
91177308 -0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Sun, 10 Jul 2016 01:44:00 +0000 (01:44 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275006
91177308 -0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Sun, 10 Jul 2016 00:57:52 +0000 (00:57 +0000)]
Delete dead code.
We were just setting DisableUnitAtATime to its default value.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275005
91177308 -0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Sat, 9 Jul 2016 21:58:40 +0000 (21:58 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274992
91177308 -0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sat, 9 Jul 2016 21:49:16 +0000 (21:49 +0000)]
[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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274991
91177308 -0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sat, 9 Jul 2016 19:26:25 +0000 (19:26 +0000)]
[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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274984
91177308 -0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sat, 9 Jul 2016 19:26:19 +0000 (19:26 +0000)]
[AST] Tighten up some bitfields
Optimize the bitfield types to conserve space for the MSVC ABI.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274983
91177308 -0d34-0410-b5e6-
96231b3b80d8
Martin Probst [Sat, 9 Jul 2016 15:11:18 +0000 (15:11 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274977
91177308 -0d34-0410-b5e6-
96231b3b80d8
Martin Probst [Sat, 9 Jul 2016 15:09:22 +0000 (15:09 +0000)]
clang-format: [JS] support trailing commas in imports.
Reviewers: djasper
Subscribers: cfe-commits, klimek
Differential Revision: http://reviews.llvm.org/D22147
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274976
91177308 -0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 9 Jul 2016 12:16:58 +0000 (12:16 +0000)]
[analyzer] Older version of GCC 4.7 crash on lambdas in default arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274975
91177308 -0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 9 Jul 2016 11:16:56 +0000 (11:16 +0000)]
[analyzer] Rewrite manual erase loop using remove_if.
No functionality change intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274974
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 9 Jul 2016 05:30:41 +0000 (05:30 +0000)]
[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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274968
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 9 Jul 2016 04:38:17 +0000 (04:38 +0000)]
[X86] Uncomment the _mm_extract_ps test and add checks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274965
91177308 -0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Sat, 9 Jul 2016 01:59:51 +0000 (01:59 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274956
91177308 -0d34-0410-b5e6-
96231b3b80d8
Vassil Vassilev [Fri, 8 Jul 2016 21:09:08 +0000 (21:09 +0000)]
Teach -ast-print to print constexpr variables.
Patch reviewed by Richard Smith (D22168).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274930
91177308 -0d34-0410-b5e6-
96231b3b80d8
Yaxun Liu [Fri, 8 Jul 2016 20:28:29 +0000 (20:28 +0000)]
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274923
91177308 -0d34-0410-b5e6-
96231b3b80d8
Justin Lebar [Fri, 8 Jul 2016 17:59:24 +0000 (17:59 +0000)]
Fix flag name in comment in cuda-version-check.cu.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274897
91177308 -0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 8 Jul 2016 17:06:27 +0000 (17:06 +0000)]
CFGTests: Update libdeps.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274885
91177308 -0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 8 Jul 2016 16:52:36 +0000 (16:52 +0000)]
clang/unittests/Analysis/CFGTest.cpp: Appease msc targets with -fno-delayed-template-parsing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274879
91177308 -0d34-0410-b5e6-
96231b3b80d8
John Brawn [Fri, 8 Jul 2016 16:20:57 +0000 (16:20 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274871
91177308 -0d34-0410-b5e6-
96231b3b80d8
Vassil Vassilev [Fri, 8 Jul 2016 16:04:22 +0000 (16:04 +0000)]
Don't crash when printing auto variables.
Patch by Axel Naumann!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274859
91177308 -0d34-0410-b5e6-
96231b3b80d8
Alexey Bader [Fri, 8 Jul 2016 15:34:59 +0000 (15:34 +0000)]
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274858
91177308 -0d34-0410-b5e6-
96231b3b80d8
Alexander Kornienko [Fri, 8 Jul 2016 10:51:00 +0000 (10:51 +0000)]
[ASTMatchers] Add missing forEachArgumentWithParam() to code sample
Reviewers: klimek
Subscribers: cfe-commits, klimek
Patch by Martin Boehme!
Differential Revision: http://reviews.llvm.org/D21799
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274835
91177308 -0d34-0410-b5e6-
96231b3b80d8
Alexander Kornienko [Fri, 8 Jul 2016 10:50:51 +0000 (10:50 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274834
91177308 -0d34-0410-b5e6-
96231b3b80d8
Vassil Vassilev [Fri, 8 Jul 2016 08:33:56 +0000 (08:33 +0000)]
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."
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274830
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 8 Jul 2016 05:11:47 +0000 (05:11 +0000)]
[X86] Remove dead builtins that don't exist in the backend intrinsic file and don't have custom handling in CGBuiltins.cpp either.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274825
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 8 Jul 2016 02:17:35 +0000 (02:17 +0000)]
[CodeGen] Use llvm::Type::getVectorNumElements instead of casting to llvm::VectorType and calling getNumElements. This is equivalent and shorter.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274823
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 8 Jul 2016 01:57:24 +0000 (01:57 +0000)]
[X86] Reuse existing lambda and remove unnecessary argument from vector cmp builtin handling. NFC
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274821
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 8 Jul 2016 01:48:44 +0000 (01:48 +0000)]
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274820
91177308 -0d34-0410-b5e6-
96231b3b80d8
Devin Coughlin [Fri, 8 Jul 2016 00:53:18 +0000 (00:53 +0000)]
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274816
91177308 -0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Fri, 8 Jul 2016 00:37:31 +0000 (00:37 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274814
91177308 -0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Thu, 7 Jul 2016 23:22:39 +0000 (23:22 +0000)]
[CUDA] Pass correct option in test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274805
91177308 -0d34-0410-b5e6-
96231b3b80d8
Vedant Kumar [Thu, 7 Jul 2016 22:38:29 +0000 (22:38 +0000)]
[Lex] Speed up updateConsecutiveMacroArgTokens (NFC)
SM.isWrittenInSameFile() calls getFileID(), which can be expensive.
Move this check behind some cheaper filters.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274800
91177308 -0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 7 Jul 2016 22:32:26 +0000 (22:32 +0000)]
Update switch statement to match coding standards.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274799
91177308 -0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Thu, 7 Jul 2016 21:42:29 +0000 (21:42 +0000)]
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!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274797
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Thu, 7 Jul 2016 20:02:25 +0000 (20:02 +0000)]
[AArch64] Change the preferred alignment for char and short.
This reinstates commits r273280 and r273289.
Original Review: http://reviews.llvm.org/D21414.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274791
91177308 -0d34-0410-b5e6-
96231b3b80d8
Justin Lebar [Thu, 7 Jul 2016 18:24:28 +0000 (18:24 +0000)]
[CUDA] s/OPT_nocuda_version_chec/OPT_no_cuda_version_check/.
Fix build breakage.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274782
91177308 -0d34-0410-b5e6-
96231b3b80d8
Justin Lebar [Thu, 7 Jul 2016 18:17:52 +0000 (18:17 +0000)]
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274781
91177308 -0d34-0410-b5e6-
96231b3b80d8
Justin Lebar [Thu, 7 Jul 2016 18:15:03 +0000 (18:15 +0000)]
[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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274780
91177308 -0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Thu, 7 Jul 2016 16:41:08 +0000 (16:41 +0000)]
NVPTX: Use the nvvm builtins to read SRegs rather than the legacy ptx ones
The ptx spellings were removed from LLVM in r274769.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274770
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Thu, 7 Jul 2016 16:37:21 +0000 (16:37 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274767
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Thu, 7 Jul 2016 16:37:19 +0000 (16:37 +0000)]
Revert "[AArch64] Change the preferred alignment for char and short to word alignment"
This reverts commit r273280 as the change was not properly approved.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274766
91177308 -0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 7 Jul 2016 11:24:38 +0000 (11:24 +0000)]
Fix "not all control paths return a value" warning on MSVC
This time without causing a 'all enums handled' warning on other compilers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274748
91177308 -0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 7 Jul 2016 11:12:02 +0000 (11:12 +0000)]
Fix "not all control paths return a value" warning on MSVC
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274746
91177308 -0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Thu, 7 Jul 2016 11:04:06 +0000 (11:04 +0000)]
[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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274745
91177308 -0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Thu, 7 Jul 2016 04:43:11 +0000 (04:43 +0000)]
[AST] Tighten up the bitfield in TemplateSpecializationType
Optimize the bitfield types to conserve space for the MSVC ABI.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274733
91177308 -0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Thu, 7 Jul 2016 04:43:07 +0000 (04:43 +0000)]
[AST] Use ArrayRef in more interfaces
ArrayRef is a little better than passing around a pointer/length
pair.
No functional change is intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274732
91177308 -0d34-0410-b5e6-
96231b3b80d8
Justin Lebar [Thu, 7 Jul 2016 01:06:59 +0000 (01:06 +0000)]
[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.)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274713
91177308 -0d34-0410-b5e6-
96231b3b80d8
Adrian McCarthy [Wed, 6 Jul 2016 23:28:34 +0000 (23:28 +0000)]
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 .
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274706
91177308 -0d34-0410-b5e6-
96231b3b80d8
Adrian McCarthy [Wed, 6 Jul 2016 22:39:15 +0000 (22:39 +0000)]
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 .
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274698
91177308 -0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Wed, 6 Jul 2016 22:06:19 +0000 (22:06 +0000)]
Ensuring the bit-fields have the same type; MSVC will place the fields in different allocation units otherwise.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274695
91177308 -0d34-0410-b5e6-
96231b3b80d8
Devin Coughlin [Wed, 6 Jul 2016 21:52:55 +0000 (21:52 +0000)]
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274691
91177308 -0d34-0410-b5e6-
96231b3b80d8
Justin Lebar [Wed, 6 Jul 2016 21:45:44 +0000 (21:45 +0000)]
[CUDA] Add missing namespace qualification on CudaArch in Action.cpp.
Fix build breakage with MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274689
91177308 -0d34-0410-b5e6-
96231b3b80d8
Justin Lebar [Wed, 6 Jul 2016 21:21:43 +0000 (21:21 +0000)]
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274682
91177308 -0d34-0410-b5e6-
96231b3b80d8
Justin Lebar [Wed, 6 Jul 2016 21:21:39 +0000 (21:21 +0000)]
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274681
91177308 -0d34-0410-b5e6-
96231b3b80d8
Justin Lebar [Wed, 6 Jul 2016 21:21:14 +0000 (21:21 +0000)]
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274680
91177308 -0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 6 Jul 2016 21:07:53 +0000 (21:07 +0000)]
[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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274677
91177308 -0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Wed, 6 Jul 2016 19:52:32 +0000 (19:52 +0000)]
NVPTX: Rename __builtin_ptx_shfl -> __nvvm_shfl
To match "NVPTX: Make the llvm.nvvm.shfl intrinsics and builtin names
consistent" in LLVM.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274663
91177308 -0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Wed, 6 Jul 2016 18:33:01 +0000 (18:33 +0000)]
Ensuring the bit-fields have the same type; MSVC will place the fields in different allocation units otherwise.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274654
91177308 -0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Wed, 6 Jul 2016 18:25:16 +0000 (18:25 +0000)]
Add AST matchers for handling bit-fields and narrowing based on their width.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274652
91177308 -0d34-0410-b5e6-
96231b3b80d8
Bruno Cardoso Lopes [Wed, 6 Jul 2016 18:05:23 +0000 (18:05 +0000)]
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274646
91177308 -0d34-0410-b5e6-
96231b3b80d8
Adrian McCarthy [Wed, 6 Jul 2016 15:15:38 +0000 (15:15 +0000)]
Revert "Include debug info for nested structs and classes"
This reverts commit
0af5ee9631c7c167dc40498b415876553e314c95 .
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274633
91177308 -0d34-0410-b5e6-
96231b3b80d8
Adrian McCarthy [Wed, 6 Jul 2016 14:46:42 +0000 (14:46 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274628
91177308 -0d34-0410-b5e6-
96231b3b80d8
Roger Ferrer Ibanez [Wed, 6 Jul 2016 07:13:49 +0000 (07:13 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274610
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 6 Jul 2016 06:27:31 +0000 (06:27 +0000)]
[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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274608
91177308 -0d34-0410-b5e6-
96231b3b80d8
Kelvin Li [Wed, 6 Jul 2016 04:45:38 +0000 (04:45 +0000)]
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274604
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 6 Jul 2016 04:24:29 +0000 (04:24 +0000)]
[AVX512] Use the generic ctlz intrinsic to implement the vplzcntd/q builtins.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274603
91177308 -0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Wed, 6 Jul 2016 04:19:16 +0000 (04:19 +0000)]
[AST] Use ArrayRef in more interfaces
ArrayRef is a little better than passing around a pointer/length pair.
No functional change is intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274601
91177308 -0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 6 Jul 2016 03:25:17 +0000 (03:25 +0000)]
[AVX512] The 128 and 256-bit vplzcnt builtins require avx512cd in addition to avx512vl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274600
91177308 -0d34-0410-b5e6-
96231b3b80d8
Vedant Kumar [Wed, 6 Jul 2016 03:08:47 +0000 (03:08 +0000)]
Delete some dead code, NFC
Found using clang's code coverage tool.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274599
91177308 -0d34-0410-b5e6-
96231b3b80d8
Kelvin Li [Tue, 5 Jul 2016 21:38:53 +0000 (21:38 +0000)]
[OpenMP] remove outdated comment (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274577
91177308 -0d34-0410-b5e6-
96231b3b80d8
Erik Pilkington [Tue, 5 Jul 2016 17:57:24 +0000 (17:57 +0000)]
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274566
91177308 -0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Tue, 5 Jul 2016 17:54:40 +0000 (17:54 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274565
91177308 -0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Tue, 5 Jul 2016 16:14:58 +0000 (16:14 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274562
91177308 -0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Tue, 5 Jul 2016 16:06:12 +0000 (16:06 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274560
91177308 -0d34-0410-b5e6-
96231b3b80d8
Michael Zuckerman [Tue, 5 Jul 2016 15:56:03 +0000 (15:56 +0000)]
[Clang][Feature] Adding CLFLUSHOPT feature and intrinsic to clang
Differential Revision: http://reviews.llvm.org/D21792
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274559
91177308 -0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 5 Jul 2016 14:49:31 +0000 (14:49 +0000)]
[X86][AVX512] Remove vector BROADCAST builtins.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274554
91177308 -0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 5 Jul 2016 12:59:33 +0000 (12:59 +0000)]
[X86][AVX512] Converted the VBROADCAST intrinsics to generic IR
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274544
91177308 -0d34-0410-b5e6-
96231b3b80d8
Asaf Badouh [Tue, 5 Jul 2016 12:24:14 +0000 (12:24 +0000)]
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274542
91177308 -0d34-0410-b5e6-
96231b3b80d8
Asaf Badouh [Tue, 5 Jul 2016 11:36:21 +0000 (11:36 +0000)]
[AVX512] minor fix in sqrt{ss|sd} intrinsics arguments
Differential Revision: http://reviews.llvm.org/D21988
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274541
91177308 -0d34-0410-b5e6-
96231b3b80d8