Commit Graph

64455 Commits

Author SHA1 Message Date
Craig Topper b3a4477b13 [X86] Replace 128-bit and 256 masked vpermilps/vpermilpd builtins with native IR.
llvm-svn: 274425
2016-07-02 05:36:43 +00:00
Richard Smith d9b9009c61 PR28394: For compatibility with c++11 and c++14, if a static constexpr data
member is redundantly redeclared outside the class definition in code built in
c++17 mode, ensure we emit a non-discardable definition of the data member for
c++11 and c++14 compilations to use.

llvm-svn: 274416
2016-07-02 01:32:16 +00:00
Pirama Arumuga Nainar 54a213d280 Add TargetInfo for 32-bit and 64-bit RenderScript
Summary:
The TargetInfo for 'renderscript32' and 'renderscript64' ArchTypes are
subclasses of ARMleTargetInfo and AArch64leTargetInfo respectively.

RenderScript32TargetInfo modifies the ARM ABI to set LongWidth and
LongAlign to be 64-bits.  Other than this modification, the underlying
TargetInfo base classes is initialized as if they have "armv7" and
"aarch64" architecture type respectively.

Reviewers: rsmith, echristo

Subscribers: aemerson, tberghammer, cfe-commits, danalbert, mehdi_amini, srhines

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

llvm-svn: 274409
2016-07-02 00:05:42 +00:00
David Majnemer bc5976ad58 [CodeView] Include MSVC style names for unnamed types
The CodeView printer expects to be able to generate fully qualified
names from the debug info graph.  This means that we need to include the
MSVC-style name in the debug info for anonymous types.

llvm-svn: 274401
2016-07-01 23:12:54 +00:00
Tim Shen 53547d95ca Removes CHECKs for symbolic label names (as Debug Clang will generate).
Differential Revision: http://reviews.llvm.org/D20499

llvm-svn: 274396
2016-07-01 22:50:00 +00:00
Manman Ren ebe8cf55ac C++14 init-capture: error out instead of crashing.
When we have template arguments, we have a function and a pattern, the variable
in init-capture belongs to the pattern decl when checking if the lhs of
"max = current" is modifiable:
  auto find = [max = init](auto current) {
    max = current;
  };

In function isReferenceToNonConstCapture, we handle the case where the decl
context for the variable is not part of the current context.

Instead of crashing, we emit an error message:
cannot assign to a variable captured by copy in a non-mutable lambda

rdar://26997922

llvm-svn: 274392
2016-07-01 22:27:16 +00:00
Tim Shen ff12edbff4 Remove unncessary CHECKs from r274385
llvm-svn: 274387
2016-07-01 21:16:58 +00:00
Tim Shen 421119fd89 [Temporary, Lifetime] Add lifetime marks for temporaries
With all MaterializeTemporaryExprs coming with a ExprWithCleanups, it's
easy to add correct lifetime.end marks into the right RunCleanupsScope.

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

llvm-svn: 274385
2016-07-01 21:08:47 +00:00
Vedant Kumar 2aac720adc [Driver] Delete some dead code (NFC)
llvm-svn: 274379
2016-07-01 19:41:20 +00:00
Argyrios Kyrtzidis e7c91045da [libclang] Sync-up the way top-level decls in an ASTUnit are handled with how decls in a DeclContext are handled.
rdar://19775013

llvm-svn: 274378
2016-07-01 19:10:54 +00:00
Matt Arsenault f652caea65 Emit more intrinsics for builtin functions
This is important for building libclc. Since r273039 tests are failing
due to now emitting calls to these functions instead of emitting the
DAG node. The libm function names are implemented for OpenCL, and should
call the locally defined versions, so -fno-builtin is used. The IR
Some functions use the __builtins and expect the intrinsics to be
emitted. Without this we end up with nobuiltin calls to intrinsics
or to unsupported library calls.

llvm-svn: 274370
2016-07-01 17:38:14 +00:00
Vassil Vassilev ccfadeb20f Revert r274348 and r274349 until the Windows failures are fixed.
llvm-svn: 274359
2016-07-01 16:07:57 +00:00
Saleem Abdulrasool 1f5ceb0b5d Driver: support -L for MSVC toolchain under the GNU driver
When not using clang in the CL emulation mode, honour the -L flags as additional
library paths to pass to the linker invocation.

llvm-svn: 274356
2016-07-01 15:36:31 +00:00
Kelvin Li fd8b5748f1 [OpenMP] Issue warning if a simd construct nested inside another simd
construct

llvm-svn: 274352
2016-07-01 14:30:25 +00:00
Vassil Vassilev 5acb3f2352 Add forgotten test to r274348.
llvm-svn: 274349
2016-07-01 13:30:08 +00:00
Vassil Vassilev 29abe10af9 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: 274348
2016-07-01 13:28:31 +00:00
Reid Kleckner 0358cbfc0a [DebugInfo] Set DISubprogram ThisAdjustment in the MS ABI
llvm-svn: 274326
2016-07-01 02:41:25 +00:00
Eric Fiselier 6ad68551c3 [Feature] Add a builtin for indexing into parameter packs. Patch by Louis Dionne.
This patch adds a __nth_element builtin that allows fetching the n-th type of a
parameter pack with very little compile-time overhead. The patch was inspired by
r252036 and r252115 by David Majnemer, which add a similar __make_integer_seq
builtin for efficiently creating a std::integer_sequence.

Reviewed as D15421. http://reviews.llvm.org/D15421

llvm-svn: 274316
2016-07-01 01:24:09 +00:00
Argyrios Kyrtzidis 5d8006d24d [CodeCompletion] Allow system headers providing private symbols with a single underscore.
rdar://24677150

llvm-svn: 274314
2016-07-01 01:17:02 +00:00
Erik Pilkington fc235eb780 [Sema] Implement C++14's DR1579: Prefer returning by converting move constructor
Fixes PR28096.

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

llvm-svn: 274291
2016-06-30 23:09:13 +00:00
Samuel Antao 1168d63cf9 [OpenMP] Use fopenmp prefix for all options introduced by the offloading implementation.
Summary: This patch changes the options used by offloading to start with -fopenmp instead of -fomp. This makes the option naming more consistent and materializes a suggestion by Richard Smith in http://reviews.llvm.org/D9888.

Reviewers: hfinkel, carlo.bertolli, arpith-jacob, ABataev

Subscribers: kkwli0, cfe-commits, caomhin

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

llvm-svn: 274283
2016-06-30 21:22:08 +00:00
Sanjay Patel 2f9303a53d fix typo; NFC
llvm-svn: 274278
2016-06-30 21:02:40 +00:00
Justin Lebar fb2efeb804 Fix ASTMatchersNodeTest to work on Windows.
It was failing because it had an explicit check for whether we're on
Windows.

There are a few other similar explicit checks in this file which I
didn't remove because they serve as reasonable documentation that the
test doesn't work with a Windows triple.

llvm-svn: 274269
2016-06-30 20:29:29 +00:00
Richard Smith b8c414ccd1 Fix typo-correction crash if a typo occurs within the operand of a
function-style cast to a non-dependent type which is then used in an invalid
way. We'd lose the "type dependent" bit here, and downstream Sema processing
would then discard the expression if it was used in a context where its type
rendered it invalid.

llvm-svn: 274267
2016-06-30 20:24:30 +00:00
Justin Lebar 27ee130e38 [CUDA] Give templated device functions internal linkage, templated kernels external linkage.
Summary:
This lets LLVM perform IPO over these functions.  In particular, it
allows LLVM to emit ld.global.nc for loads to __restrict pointers in
kernels that are never written to.

Reviewers: rsmith

Subscribers: cfe-commits, tra

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

llvm-svn: 274261
2016-06-30 18:41:33 +00:00
Richard Smith cc4bb63351 PR28373: fix crash-on-invalid if the condition of an if-statement fails typo-correction.
llvm-svn: 274260
2016-06-30 18:36:34 +00:00
Justin Lebar 8b08d2c5c8 Don't instantiate a full host toolchain in ASTMatchersTest.
Summary:
This test was stat()'ing large swaths of /usr/lib hundreds of times, as
every invocation of matchesConditionally*() created a new Linux
toolchain.

In addition to being slow, perf indicated this was causing substantial
contention in the kernel.

Something is...interesting in the kernel, as without this patch I
sometimes see ~11m spent in the kernel, and sometimes ~5m.  This
corresponds to bimodal ninja check-clang times of ~30s and ~20s.

It's not clear to me exactly what causes the bimodality.  In any case,
this change makes this test run in 2.5s, down from 17s, and it seems to
cause us to get the 20s ninja check-clang time unconditionally.

Reviewers: chandlerc

Subscribers: cfe-commits, klimek

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

llvm-svn: 274257
2016-06-30 18:12:25 +00:00
Reid Kleckner 31abd80fbe [codeview] Emit qualified display names if -gline-tables-only is on
When -gmlt is on, we don't emit namespace or class scope information,
and the CodeView emission code in LLVM can't compute the fully qualified
name. If we know LLVM won't be able to get the name right, go ahead and
emit the qualified name in the frontend.

We could change our -gmlt emission strategy to include those scopes when
emitting codeview, but that would increase memory usage and slow down
LTO and add more complexity to debug info emission.

The same problem exists when you debug a -gmlt binary with GDB, so we
should consider removing '&& EmitCodeView' from the condition here at
some point in the future after evaluating the impact on object file
size.

llvm-svn: 274246
2016-06-30 17:41:31 +00:00
Reid Kleckner 12e64d953f Port some more debug info tests on Windows
llvm-svn: 274245
2016-06-30 17:41:27 +00:00
Michael Zuckerman 5486eab385 [AVX512][BUILTIN][vpermilps][intrinsics] Fixing two incorrect IMM check.
Differential Revision: http://reviews.llvm.org/D21836

llvm-svn: 274224
2016-06-30 12:12:20 +00:00
Dmitry Polukhin 79e2673f25 Fix CodeGenCXX/mangle-abi-tag.cpp on clang-ppc64le-linux bot
llvm-svn: 274223
2016-06-30 11:15:52 +00:00
Dmitry Polukhin 90bb49e362 [GCC] PR23529 Mangler part of attrbute abi_tag support
Original patch by Stefan Bühler http://reviews.llvm.org/D12834

Difference between original and this one:
- fixed all failing tests
- fixed mangling for global variable outside namespace
- emit ABI tags for guards and local names
- clang-format + other stylistic changes
- significantly reworked patch according to Richard's suggestions

Sema part, committed before http://reviews.llvm.org/D17567

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

llvm-svn: 274222
2016-06-30 09:40:38 +00:00
Benjamin Kramer 0048964d84 Enable opencl driver tests, which never ran.
Then mark it as XFAIL because it always fails. I'll let OpenCL people
figure this out.

llvm-svn: 274221
2016-06-30 09:17:46 +00:00
Nikolay Haustov 8c6538b86d AMDGPU: Set amdgpu_kernel calling convention for OpenCL kernels.
Summary:
Summary:
Change Clang calling convention SpirKernel to OpenCLKernel.
Set calling convention OpenCLKernel for amdgcn as well.
Add virtual method .getOpenCLKernelCallingConv() to TargetCodeGenInfo
and use it to set target calling convention for AMDGPU and SPIR.
Update tests.

Reviewers: rsmith, tstellarAMD, Anastasia, yaxunl

Subscribers: kzhuravl, cfe-commits

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

llvm-svn: 274220
2016-06-30 09:06:33 +00:00
Michael Zuckerman 3f316abdce [Clang][Intrinsics][AVX512][BuiltIn] adding intrinsics for vrangesd instruction set
Differential Revision: http://reviews.llvm.org/D21734

llvm-svn: 274218
2016-06-30 08:05:46 +00:00
Haojian Wu e775de8171 [ASTMatcher] Add a node matcher for EnumType.
Reviewers: aaron.ballman

Subscribers: cfe-commits, klimek

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

llvm-svn: 274217
2016-06-30 07:50:01 +00:00
Michael Gottesman a1e6c6cabc [cmake] Remove stale comment. NFC.
llvm-svn: 274212
2016-06-30 05:51:18 +00:00
David Majnemer 02d57cc92c [MS ABI] Pick an inheritance model if we resolve an overload set
We didn't assign an inheritance model for 'Foo' if the event an
exrepssion like '&Foo::Bar' occured if 'Bar' could resolve to multiple
functions.

Once the overload set is resolved to a particular member, we enforce a
specific inheritance model.

This fixes PR28360.

llvm-svn: 274202
2016-06-30 03:02:03 +00:00
David Majnemer b4b671e4a8 [CodeView] Implement support for bitfields in Clang
Emit the underlying storage offset in addition to the starting bit
position of the field.

This fixes PR28162.

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

llvm-svn: 274201
2016-06-30 03:01:59 +00:00
Akira Hatanaka 3a94477625 Use the same type for adjacent bit field members.
MSVC doesn't pack the bit field members if different types are used.
This came up in a patch review.

http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160627/163107.html

llvm-svn: 274190
2016-06-30 00:07:17 +00:00
Siva Chandra 0ea80f883c [Tooling] Add optional argument to getFullyQualifiedName to prepend "::".
Reviewers: rsmith, saugustine, rnk

Subscribers: klimek, cfe-commits

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

llvm-svn: 274185
2016-06-29 22:38:59 +00:00
Michael Gottesman 5ba5270eb9 [ClangConfig] Store all of the targets exported in the variable CLANG_EXPORTED_TARGETS.
llvm-svn: 274180
2016-06-29 21:59:23 +00:00
Michael Gottesman ccc31a173e [ClangConfig] Unset some variables after we are done using them to configure ClangConfig.cmake.in files.
This ensures that the values do not bleed over in between computations. It may
make sense in the future to just refactor this code into functions to provide
"true scoping".

llvm-svn: 274179
2016-06-29 21:59:20 +00:00
Michael Gottesman 497e97ffe3 [ClangConfig] Instead of hard coding the ClangTargets location to /ClangTargets.cmake, follow LLVM's example and use a pre-computed cmake variable @CLANG_CONFIG_EXPORTS_FILE@.
This just makes ClangConfig more consistent with LLVMConfig.

llvm-svn: 274178
2016-06-29 21:59:19 +00:00
Michael Gottesman 1b87cd3974 [ClangConfig] Follow LLVM's example and only install Clang{Config,Target}.cmake when LLVM_INSTALL_TOOLCHAIN_ONLY is disabled.
llvm-svn: 274177
2016-06-29 21:59:15 +00:00
Michael Gottesman 905426e606 [cmake] Instead of just copying ClangConfig.cmake, configure it using ClangConfig.cmake.in.
This will allow for cmake to expand variables in ClangConfig.cmake for
downstream users.

llvm-svn: 274176
2016-06-29 21:59:14 +00:00
Richard Smith c7a05a9f4d P0305R1: Parsing support for init-statements in 'if' and 'switch' statements.
No semantic analysis yet.

This is a pain to disambiguate correctly, because the parsing rules for the
declaration form of a condition and of an init-statement are quite different --
for a token sequence that looks like a declaration, we frequently need to
disambiguate all the way to the ')' or ';'.

We could do better here in some cases by stopping disambiguation once we've
decided whether we've got an expression or not (rather than keeping going until
we know whether it's an init-statement declaration or a condition declaration),
by unifying our parsing code for the two types of declaration and moving the
syntactic checks into Sema; if this has a measurable impact on parsing
performance, I'll look into that.

llvm-svn: 274169
2016-06-29 21:17:59 +00:00
Michael Gottesman 03c38af109 [ClangConfig] Copy ClangConfig.cmake to ${CMAKE_BINARY_DIR}/${CLANG_INSTALL_PACKAGE_DIR} instead of to ${CLANG_BINARY_DIR}/${CLANG_INSTALL_PACKAGE_DIR}.
This is an obvious bug since ClangConfig.cmake looks for ClangTargets.cmake in
${CMAKE_CURRENT_LIST_DIR}. But ClangTargets.cmake is in
${CMAKE_BINARY_DIR}/${CLANG_INSTALL_PACKAGE_DIR}, so it will always fail with an
in tree build.

In the case where clang is built out of tree, this is still correct since
CMAKE_BINARY_DIR and CLANG_BINARY_DIR will be the same.

llvm-svn: 274168
2016-06-29 21:12:38 +00:00
Richard Smith 4556ebe62d Convert another case over to RevertingTentativeParsingAction.
llvm-svn: 274167
2016-06-29 21:12:37 +00:00
Richard Smith 91b73f2542 Switch to an RAII object to revert tentative parsing automatically.
llvm-svn: 274165
2016-06-29 21:06:51 +00:00