]> granicus.if.org Git - clang/log
clang
8 years agoRevert r267691, it caused PR27535.
Nico Weber [Wed, 27 Apr 2016 17:26:08 +0000 (17:26 +0000)]
Revert r267691, it caused PR27535.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267744 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoModule debugging: Fix the DWO filename for PCH in a relative path.
Adrian Prantl [Wed, 27 Apr 2016 17:06:22 +0000 (17:06 +0000)]
Module debugging: Fix the DWO filename for PCH in a relative path.
PCH in a relative location had a redundant relative path on the DWO
filename and the DW_AT_compilation_dir.
This patch fixes this and adds testcases for PCH in the same directory,
in a relative, and an absolute location.

rdar://problem/25537947

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267740 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Clang][Builtin][AVX512] Adding intrisnics for the vpconflict{q|d} instruction set
Michael Zuckerman [Wed, 27 Apr 2016 15:35:13 +0000 (15:35 +0000)]
[Clang][Builtin][AVX512] Adding intrisnics for the vpconflict{q|d} instruction set

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267728 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoExpose cxx constructor and method properties through libclang and python bindings.
Jonathan Coe [Wed, 27 Apr 2016 12:48:25 +0000 (12:48 +0000)]
Expose cxx constructor and method properties through libclang and python bindings.

Summary:
I have exposed the following function through libclang and the clang.cindex python bindings:

clang_CXXConstructor_isConvertingConstructor,
clang_CXXConstructor_isCopyConstructor,
clang_CXXConstructor_isDefaultConstructor,
clang_CXXConstructor_isMoveConstructor,
clang_CXXMethod_isDefaulted

I need (some of) these methods for a C++ code model I am building in Python to drive a code generator.

Reviewers: compnerd, skalinichev

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267706 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Clang][BuiltIn][AVX512] Adding intrinsics without mask for VBROADCAST and VPBROADCAS...
Michael Zuckerman [Wed, 27 Apr 2016 11:43:14 +0000 (11:43 +0000)]
[Clang][BuiltIn][AVX512] Adding intrinsics without mask for VBROADCAST and VPBROADCAST instruction set .

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267696 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[OPENMP] Fix crash on initialization of classes with no init clause in
Alexey Bataev [Wed, 27 Apr 2016 11:38:05 +0000 (11:38 +0000)]
[OPENMP] Fix crash on initialization of classes with no init clause in
declare reductions.

If reduction clause is applied to instance of class with user-defined
reduction operation without initialization clause, it may cause a crash.
Patch fixes this issue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267695 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[modules] Fix Decl's Used invariant.
Vassil Vassilev [Wed, 27 Apr 2016 10:46:06 +0000 (10:46 +0000)]
[modules] Fix Decl's Used invariant.

The Decl::isUsed has a value for every decl. In non-module builds it is very
difficult (but possible) to break this invariant but when we walk up the redecl
chain we find the neccessary information.

When deserializing the decls from a module it is much more difficult to update
correctly this invariant. The patch centralizes the information whether a decl
is used in the canonical decl marking the entire entity as being used.

Fixes https://llvm.org/bugs/show_bug.cgi?id=27401

Patch by Cristina Cristescu and me.

Thanks to Richard Smith who helped to debug and understand the issue!

Reviewed by Richard Smith.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267691 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Clang][BuiltIn][AVX512]Adding intrinsics for vmovntdqa vmovntpd vmovntps instruction set
Michael Zuckerman [Wed, 27 Apr 2016 10:44:15 +0000 (10:44 +0000)]
[Clang][BuiltIn][AVX512]Adding intrinsics for vmovntdqa vmovntpd vmovntps instruction set

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267690 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[OPENMP] Fix for codegen of captured variables in inlined directives.
Alexey Bataev [Wed, 27 Apr 2016 07:56:03 +0000 (07:56 +0000)]
[OPENMP] Fix for codegen of captured variables in inlined directives.

Currently there is a problem with codegen of inlined directives inside
lambdas, it may cause a crash during codegen because of incorrect
capturing of variables. Patch fixes this problem.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267677 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoUpdated doxygen comments for intrinsics.
Ekaterina Romanova [Wed, 27 Apr 2016 07:14:02 +0000 (07:14 +0000)]
Updated doxygen comments for intrinsics.
(1) Removed \code.. \endcode tags around the instruction name. This matches the doxygen format for all other intrinsics.
(2) Did a better formatting for the comments (to fit into 80 columns more compactly).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267676 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoModule debugging: Add an assertion.
Adrian Prantl [Tue, 26 Apr 2016 23:42:43 +0000 (23:42 +0000)]
Module debugging: Add an assertion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267633 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoPR27513: When determining which declaration to put into an exported lookup
Richard Smith [Tue, 26 Apr 2016 23:40:43 +0000 (23:40 +0000)]
PR27513: When determining which declaration to put into an exported lookup
table for a module / PCH, never map from a normal declaration of a class to an
injected-class-name declaration (or vice versa). Those declarations live in
distinct lookup tables and should not be confused.

We really shouldn't be using a CXXRecordDecl to represent an
injected-class-name in the first place; I've filed PR27532 so we don't forget.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267632 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoModule debugging: Also correctly handle typedef'd foward-declared members.
Adrian Prantl [Tue, 26 Apr 2016 23:37:38 +0000 (23:37 +0000)]
Module debugging: Also correctly handle typedef'd foward-declared members.
Thanks again to Richard Smith for pointing this out.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267630 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoCheck 'r' and 'y specifiers of freebsd_kernel_printf format strings on PS4
Sunil Srivastava [Tue, 26 Apr 2016 23:19:00 +0000 (23:19 +0000)]
Check 'r' and 'y specifiers of freebsd_kernel_printf format strings on PS4

This is an addendum to r229921.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267625 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoModule debugging: Add testcase for member classes of class template specializations.
Adrian Prantl [Tue, 26 Apr 2016 21:58:23 +0000 (21:58 +0000)]
Module debugging: Add testcase for member classes of class template specializations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267612 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoModule debugging: Use the definition to determine module-defined types.
Adrian Prantl [Tue, 26 Apr 2016 21:58:18 +0000 (21:58 +0000)]
Module debugging: Use the definition to determine module-defined types.

Follow-up to r267464. Thanks to Richard Smith for pointing this out!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267611 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoTest commit
Erik Pilkington [Tue, 26 Apr 2016 20:55:48 +0000 (20:55 +0000)]
Test commit

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267604 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoTry to get at_file_missing.c passing after LLVM r267556.
Nico Weber [Tue, 26 Apr 2016 20:40:23 +0000 (20:40 +0000)]
Try to get at_file_missing.c passing after LLVM r267556.

r267556 made backslashes escape the next character
unconditionally in rsp files.  This test echos a path into
a rsp file, and paths contain backslashes on Windows. Since
it's not important for this test to get the filename from
the rsp file, just pass it regularly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267601 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[OpenCL] Add predefined macros.
Yaxun Liu [Tue, 26 Apr 2016 19:25:46 +0000 (19:25 +0000)]
[OpenCL] Add predefined macros.

OpenCL spec requires __OPENCL_C_VERSION__ to be defined based on -cl-std option. This patch implements that.

The patch also defines __FAST_RELAXED_MATH__ based on -cl-fast-relaxed-math option.

Also fixed a test using -std=c99 for OpenCL program. Limit allowed language standard of OpenCL to be OpenCL standards.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267590 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CMake] Use just-built clang and build iOS support when building stage2
Chris Bieneman [Tue, 26 Apr 2016 18:39:20 +0000 (18:39 +0000)]
[CMake] Use just-built clang and build iOS support when building stage2

The Apple stage2 build should include compiler-rt iOS libraries and be built with the stage2 compiler. This matches Apple's production clang builds.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267584 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SPIR] Remove an assert mandating SPIR for OpenCL sources only.
Anastasia Stulova [Tue, 26 Apr 2016 15:14:01 +0000 (15:14 +0000)]
[SPIR] Remove an assert mandating SPIR for OpenCL sources only.

SPIR target can be used for C/C++ inputs too (i.e. in OpenCL compatible mode for the libs creation).

Patch by Neil Henning!

Review: http://reviews.llvm.org/D19478

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267561 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[OpenMP] Improve mappable expressions Sema.
Samuel Antao [Tue, 26 Apr 2016 14:54:23 +0000 (14:54 +0000)]
[OpenMP] Improve mappable expressions Sema.

Summary:
This patch adds logic to save the components of mappable expressions in the clause that uses it, so that they don't have to be recomputed during codegen. Given that the mappable components are (will be) used in several clauses a new geneneric implementation `OMPMappableExprListClause` is used that extends the existing `OMPVarListClause`.

This patch does not add new tests. The goal is to preserve the existing functionality while storing more info in the clauses.

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

Subscribers: cfe-commits, caomhin

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267560 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoUpdate test after LLVM r267556.
Nico Weber [Tue, 26 Apr 2016 13:54:29 +0000 (13:54 +0000)]
Update test after LLVM r267556.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267557 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[MSVC] PR27337: allow static_cast from private base to derived for WTL
Dmitry Polukhin [Tue, 26 Apr 2016 09:21:17 +0000 (09:21 +0000)]
[MSVC] PR27337: allow static_cast from private base to derived for WTL

MSVC doesn't report even warning for cast from private base class to
derived.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267534 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agotrying to fix the windows build broken by r267496
Kostya Serebryany [Tue, 26 Apr 2016 01:53:49 +0000 (01:53 +0000)]
trying to fix the windows build broken by r267496

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267513 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoCGOpenMPRuntime.h: Prune '\param IfCond' in r267395. [-Wdocumentation]
NAKAMURA Takumi [Tue, 26 Apr 2016 00:45:00 +0000 (00:45 +0000)]
CGOpenMPRuntime.h: Prune '\param IfCond' in r267395. [-Wdocumentation]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267503 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Docs] Fix indentation error introduced by r267447.
George Burgess IV [Tue, 26 Apr 2016 00:31:29 +0000 (00:31 +0000)]
[Docs] Fix indentation error introduced by r267447.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267501 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[lanai] Update handling of structs in arguments to be passed in registers.
Jacques Pienaar [Tue, 26 Apr 2016 00:09:29 +0000 (00:09 +0000)]
[lanai] Update handling of structs in arguments to be passed in registers.

Previously aggregate types were passed byval, change the ABI to pass these in registers instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267496 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agodriver: Add a `--rsp-quoting` flag to pick response file quoting.
Nico Weber [Mon, 25 Apr 2016 21:15:49 +0000 (21:15 +0000)]
driver: Add a `--rsp-quoting` flag to pick response file quoting.

Currently, clang-cl always uses Windows style for unquoting, and clang always
uses POSIX style for unquoting.

With this flag, it's possible to change these defaults.

In general, response file quoting should match the shell the response file is
used in.  On Windows, it's possible to run clang-cl in a bash shell, or clang in
cmd.exe, so a flag for overriding the default behavior is natural there.

On non-Windows, Windows quoting probably never makes sense (except maybe in
Wine), but having clang-cl behave differently based on the host OS seems
strange too.  So require that people who want to use posix-style response
files with clang-cl on non-Windows pass --rsp-quoting=posix.

http://reviews.llvm.org/D19425

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267474 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoModule Debugging: Fix the condition for determining whether a template
Adrian Prantl [Mon, 25 Apr 2016 20:52:40 +0000 (20:52 +0000)]
Module Debugging: Fix the condition for determining whether a template
instantiation is in a module.

This patch fixes the condition for determining whether the debug info for a
template instantiation will exist in an imported clang module by:

- checking whether the ClassTemplateSpecializationDecl is complete and
- checking that the instantiation was in a module by looking at the first field.

I also added a negative check to make sure that a typedef to a forward-declared
template (with the definition outside of the module) is handled correctly.

http://reviews.llvm.org/D19443
rdar://problem/25553724

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267464 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoImplement support for conditional between xvalues of reference-compatible
Richard Smith [Mon, 25 Apr 2016 19:30:37 +0000 (19:30 +0000)]
Implement support for conditional between xvalues of reference-compatible
types. Patch by Erik Pilkington!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267454 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRefactor traversal of bases in deduction of template parameters from base
Richard Smith [Mon, 25 Apr 2016 19:28:08 +0000 (19:28 +0000)]
Refactor traversal of bases in deduction of template parameters from base
classes of an argument to use CXXRecordDecl::forallBases. Fix forallBases to
only visit each base class once.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267453 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Docs] Clarify what the object-size sanitizer does.
George Burgess IV [Mon, 25 Apr 2016 19:21:45 +0000 (19:21 +0000)]
[Docs] Clarify what the object-size sanitizer does.

Currently, the UBSan docs make it sound like the object-size sanitizer
will only detect out-of-bounds reads/writes. It also catches some
operations that don't necessarily access memory (invalid downcasts,
calls of methods on invalid pointers, ...). This patch adds a note
about this behavior in the docs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267447 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoWhen deducing template parameters from base classes of an argument type, don't
Richard Smith [Mon, 25 Apr 2016 19:09:05 +0000 (19:09 +0000)]
When deducing template parameters from base classes of an argument type, don't
preserve any deduced types from a failed deduction to a subsequent attempt at
deduction. Patch by Erik Pilkington!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267444 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Clang][Builtin][AVX512]Adding k-register logic intrinsics KAND, KANDN, KOR, KORTEST...
Michael Zuckerman [Mon, 25 Apr 2016 16:42:29 +0000 (16:42 +0000)]
[Clang][Builtin][AVX512]Adding k-register logic intrinsics KAND, KANDN, KOR, KORTEST, KXNOR, KXOR, KUNPACK instruction set.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267425 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdded Fixer implementation and fix() interface in clang-format for removing redundant...
Eric Liu [Mon, 25 Apr 2016 15:09:22 +0000 (15:09 +0000)]
Added Fixer implementation and fix() interface in clang-format for removing redundant code.

Summary:
After applying replacements, redundant code like extra commas or empty namespaces
might be introduced. Fixer can detect and remove any redundant code introduced by replacements.
The current implementation only handles redundant commas.

Reviewers: djasper, klimek

Subscribers: ioeric, mprobst, klimek, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267416 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Clang][Builtin][AVX512]Adding intrinsics for vfpclass{sd|ss} vfpclass{pd|ps} instruc...
Michael Zuckerman [Mon, 25 Apr 2016 14:48:23 +0000 (14:48 +0000)]
[Clang][Builtin][AVX512]Adding intrinsics for vfpclass{sd|ss} vfpclass{pd|ps} instruction set

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267414 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[analyzer] Let TK_PreserveContents span across the whole base region.
Artem Dergachev [Mon, 25 Apr 2016 14:44:25 +0000 (14:44 +0000)]
[analyzer] Let TK_PreserveContents span across the whole base region.

If an address of a field is passed through a const pointer,
the whole structure's base region should receive the
TK_PreserveContents trait and avoid invalidation.

Additionally, include a few FIXME tests shown up during testing.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267413 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Clang][AVX512][BUILTIN] Adding intrinsics for VSCATTERPF{1|0}{DPS|QPS|DPD|QPD} instr...
Michael Zuckerman [Mon, 25 Apr 2016 13:01:40 +0000 (13:01 +0000)]
[Clang][AVX512][BUILTIN] Adding intrinsics for VSCATTERPF{1|0}{DPS|QPS|DPD|QPD} instruction set

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267398 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[OPENMP 4.5] Codegen for 'taskloop' directive.
Alexey Bataev [Mon, 25 Apr 2016 12:22:29 +0000 (12:22 +0000)]
[OPENMP 4.5] Codegen for 'taskloop' directive.

The taskloop construct specifies that the iterations of one or more associated loops will be executed in parallel using OpenMP tasks. The iterations are distributed across tasks created by the construct and scheduled to be executed.
The next code will be generated for the taskloop directive:
    #pragma omp taskloop num_tasks(N) lastprivate(j)
        for( i=0; i<N*GRAIN*STRIDE-1; i+=STRIDE ) {
          int th = omp_get_thread_num();
          #pragma omp atomic
            counter++;
          #pragma omp atomic
            th_counter[th]++;
          j = i;
    }

Generated code:
task = __kmpc_omp_task_alloc(NULL,gtid,1,sizeof(struct
task),sizeof(struct shar),&task_entry);
psh = task->shareds;
psh->pth_counter = &th_counter;
psh->pcounter = &counter;
psh->pj = &j;
task->lb = 0;
task->ub = N*GRAIN*STRIDE-2;
task->st = STRIDE;
__kmpc_taskloop(
NULL,             // location
gtid,             // gtid
task,             // task structure
1,                // if clause value
&task->lb,        // lower bound
&task->ub,        // upper bound
STRIDE,           // loop increment
0,                // 1 if nogroup specified
2,                // schedule type: 0-none, 1-grainsize, 2-num_tasks
N,                // schedule value (ignored for type 0)
(void*)&__task_dup_entry // tasks duplication routine
);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267395 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Clang][AVX512][BuiltIn] Adding support to intrinsics of VPERMD and VPERMW instructio...
Michael Zuckerman [Mon, 25 Apr 2016 05:32:35 +0000 (05:32 +0000)]
[Clang][AVX512][BuiltIn] Adding support to intrinsics of VPERMD and VPERMW instruction set

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267380 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDebug info: Apply an empty debug location for global OpenMP destructors.
Adrian Prantl [Sun, 24 Apr 2016 22:22:29 +0000 (22:22 +0000)]
Debug info: Apply an empty debug location for global OpenMP destructors.
LLVM really wants a debug location on every inlinable call in a function
with debug info, because it otherwise cannot set up inlining debug info.

This change applies an artificial line 0 debug location (which is how
DWARF marks automatically generated code that has no corresponding
source code) to the .__kmpc_global_dtor_. functions to avoid the
LLVM Verifier complaining.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267369 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoclang-format: [JS] generator and async functions.
Martin Probst [Sun, 24 Apr 2016 22:05:09 +0000 (22:05 +0000)]
clang-format: [JS] generator and async functions.

For generators, see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_generators
async functions are not quite in the spec yet, but stage 3 and already widely used:
http://tc39.github.io/ecmascript-asyncawait/

Reviewers: djasper

Subscribers: klimek

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267368 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoImprove diagnostic checking for va_start to also warn on other instances of undefined...
Aaron Ballman [Sun, 24 Apr 2016 13:30:21 +0000 (13:30 +0000)]
Improve diagnostic checking for va_start to also warn on other instances of undefined behavior, such as a parameter declared with the register keyword in C, or a parameter of a type that undergoes default argument promotion.

This helps cover some more of the CERT secure coding rule EXP58-CPP. Pass an object of the correct type to va_start (https://www.securecoding.cert.org/confluence/display/cplusplus/EXP58-CPP.+Pass+an+object+of+the+correct+type+to+va_start).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267338 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMake thinlto clang test more robust against LLVM changes.
Mehdi Amini [Sun, 24 Apr 2016 03:44:55 +0000 (03:44 +0000)]
Make thinlto clang test more robust against LLVM changes.

We should just test the effect of the clang level option here, i.e.
that a summary is correctly emitted with -flto=thin

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267321 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix a couple assertions that can never fire because the condition ANDed with the...
Craig Topper [Sun, 24 Apr 2016 02:08:22 +0000 (02:08 +0000)]
Fix a couple assertions that can never fire because the condition ANDed with the string is just true or 1.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267313 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDebugInfo: DIGlobalVariables became 'distinct' in LLVM r267301
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 22:29:26 +0000 (22:29 +0000)]
DebugInfo: DIGlobalVariables became 'distinct' in LLVM r267301

Update testcases due to DIBuilder change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267302 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDebugInfo: Adapt to loss of DITypeRef in LLVM r267296
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 21:08:27 +0000 (21:08 +0000)]
DebugInfo: Adapt to loss of DITypeRef in LLVM r267296

LLVM stopped using MDString-based type references, and DIBuilder no
longer fills 'retainedTypes:' with every DICompositeType that has an
'identifier:' field.   There are just minor changes to keep the same
behaviour in CFE.

Leaving 'retainedTypes:' unfilled has a dramatic impact on the output
order of the IR though.  There are a huge number of testcase changes,
which were unfortunately not really scriptable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267297 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[profile] Fix another use of the driver.
Sean Silva [Sat, 23 Apr 2016 02:13:48 +0000 (02:13 +0000)]
[profile] Fix another use of the driver.

Follow-on to r267262.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267263 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[profile] Use cc1 in these tests instead of the driver.
Sean Silva [Sat, 23 Apr 2016 02:11:16 +0000 (02:11 +0000)]
[profile] Use cc1 in these tests instead of the driver.

I ran into this when seeing what tests would break if we make a
driver-level decision about whether FEPGO or IRPGO is the default.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267262 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert the bool portion of r267054
Richard Trieu [Fri, 22 Apr 2016 22:14:32 +0000 (22:14 +0000)]
Revert the bool portion of r267054

Remove the floating point to bool conversion warnings.  Some of these
conversions will be caught by -Wliteral-conversion and -Wfloat-conversion

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267234 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoPGO] PGOFuncName meta data if PGOFuncName is different from function's raw name
Rong Xu [Fri, 22 Apr 2016 21:19:05 +0000 (21:19 +0000)]
PGO] PGOFuncName meta data if PGOFuncName is different from function's raw name

Write out the PGOFuncName meta data if PGOFuncName is different from function's
raw name. This should only apply to internal linkage functions. This is to be
consumed by indirect-call promotion when called in LTO optimization pass.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267224 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix a bug involving deferred decl emission and PCH
Reid Kleckner [Fri, 22 Apr 2016 18:46:33 +0000 (18:46 +0000)]
Fix a bug involving deferred decl emission and PCH

For various reasons, involving dllexport and class linkage compuations,
we have to wait until after the semicolon after a class declaration to
emit inline methods. These are "deferred" decls. Before this change,
finishing the tag decl would trigger us to deserialize some PCH so that
we could make a "pretty" IR-level type. Deserializing the PCH triggered
calls to HandleTopLevelDecl, which, when done, checked the deferred decl
list, and emitted some dllexported decls that weren't ready.

Avoid this re-entrancy. Deferred decls should not get emitted when a tag
is finished, they should only be emitted after a real top level decl in
the main file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267186 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Hexagon] Add definitions for circular and bit-reverse loads/stores
Krzysztof Parzyszek [Fri, 22 Apr 2016 14:58:46 +0000 (14:58 +0000)]
[Hexagon] Add definitions for circular and bit-reverse loads/stores

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267159 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[clang][AVX512][Builtin] adding intrinsics for vf{n}madd{ss|sd} and vf{n}sub{ss|sd...
Michael Zuckerman [Fri, 22 Apr 2016 10:56:24 +0000 (10:56 +0000)]
[clang][AVX512][Builtin] adding intrinsics for vf{n}madd{ss|sd} and vf{n}sub{ss|sd} instruction set

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267135 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Clang][AVX512][BUILTIN] Adding scalar intrinsics for rsqrt14 ,rcp14, getexp and...
Michael Zuckerman [Fri, 22 Apr 2016 10:06:10 +0000 (10:06 +0000)]
[Clang][AVX512][BUILTIN] Adding scalar intrinsics for rsqrt14 ,rcp14, getexp and getmant instruction set

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267129 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[OPENMP] Fix for PR27463: Privatizing struct fields with array type
Alexey Bataev [Fri, 22 Apr 2016 09:05:03 +0000 (09:05 +0000)]
[OPENMP] Fix for PR27463: Privatizing struct fields with array type
causes code generation failure.

The codegen part of firstprivate clause for member decls used type of
original variable without skipping reference type from
OMPCapturedExprDecl. Patch fixes this problem.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267125 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[index] Add SymbolSubKinds for ObjC IB annotations.
Argyrios Kyrtzidis [Fri, 22 Apr 2016 07:21:16 +0000 (07:21 +0000)]
[index] Add SymbolSubKinds for ObjC IB annotations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267118 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[index] Add a SymbolSubKind for an ObjC unit test.
Argyrios Kyrtzidis [Fri, 22 Apr 2016 07:21:10 +0000 (07:21 +0000)]
[index] Add a SymbolSubKind for an ObjC unit test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267117 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[index] Change SymbolCXXTemplateKind to a 'SymbolSubKinds' bitset.
Argyrios Kyrtzidis [Fri, 22 Apr 2016 07:21:04 +0000 (07:21 +0000)]
[index] Change SymbolCXXTemplateKind to a 'SymbolSubKinds' bitset.

This provides a more general and flexible way to annotate special symbols.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267116 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[OPENMP] Fix for LCV in simd directives in explicit clauses.
Alexey Bataev [Fri, 22 Apr 2016 03:56:56 +0000 (03:56 +0000)]
[OPENMP] Fix for LCV in simd directives in explicit clauses.

If loop control variable for simd-based directives is explicitly marked
as linear/lastprivate in clauses, codegen for such construct would
crash. Patch fixes this problem.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267101 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoTry to get test passing on OS X (see comment at top of file).
Nico Weber [Fri, 22 Apr 2016 00:38:09 +0000 (00:38 +0000)]
Try to get test passing on OS X (see comment at top of file).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267089 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CUDA] removed unneeded __nvvm_reflect_anchor()
Artem Belevich [Thu, 21 Apr 2016 21:40:27 +0000 (21:40 +0000)]
[CUDA] removed unneeded __nvvm_reflect_anchor()

Since r265060 LLVM infers correct __nvvm_reflect attributes, so
explicit declaration of __nvvm_reflect() is no longer needed.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267062 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[esan] EfficiencySanitizer driver flags
Derek Bruening [Thu, 21 Apr 2016 21:32:04 +0000 (21:32 +0000)]
[esan] EfficiencySanitizer driver flags

Summary:
Adds a framework to enable the instrumentation pass for the new
EfficiencySanitizer ("esan") family of tools.  Adds a flag for esan's
cache fragmentation tool via -fsanitize=efficiency-cache-frag.
Adds appropriate tests for the new flag.

Reviewers: eugenis, vitalybuka, aizatsky, filcab

Subscribers: filcab, kubabrecka, llvm-commits, zhaoqin, kcc

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267059 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoSplit interesting warnings off from -Wfloat-conversion
Richard Trieu [Thu, 21 Apr 2016 21:04:55 +0000 (21:04 +0000)]
Split interesting warnings off from -Wfloat-conversion

Restructure the implict floating point to integer conversions so that
interesting sub-groups are under different flags.  Breakdown of warnings:

No warning:
Exact conversions from floating point to integer:
int x = 10.0;
int x = 1e10;

-Wliteral-conversion - Floating point literal to integer with rounding:
int x = 5.5;
int x = -3.4;

-Wfloat-conversion - All conversions not covered by the above two:
int x = GetFloat();
int x = 5.5 + 3.5;

-Wfloat-zero-conversion - The expression converted has a non-zero floating
point value that gets converted to a zero integer value, excluded the cases
falling under -Wliteral-conversion.  Subset of -Wfloat-conversion.
int x = 1.0 / 2.0;

-Wfloat-overflow-conversion - The floating point value is outside the range
of the integer type, exluding cases from -Wliteral conversion.  Subset of
-Wfloat-conversion.
char x = 500;
char x = -1000;

-Wfloat-bool-conversion - Any conversion of a floating point type to bool.
Subset of -Wfloat-conversion.
if (GetFloat()) {}
bool x = 5.0;

-Wfloat-bool-constant-conversion - Conversion of a compile time evaluatable
floating point value to bool.  Subset of -Wfloat-bool-conversion.
bool x = 1.0;
bool x = 4.0 / 20.0;

Also add EvaluateAsFloat to Sema, which is similar to EvaluateAsInt, but for
floating point values.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267054 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoclang-cl: Don't assert on using /Yc with non-source files, PR27450
Nico Weber [Thu, 21 Apr 2016 19:59:10 +0000 (19:59 +0000)]
clang-cl: Don't assert on using /Yc with non-source files, PR27450

Move phase handling after input type validation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267040 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[x86] Force mixes asm syntax test to check for x86
Renato Golin [Thu, 21 Apr 2016 14:40:06 +0000 (14:40 +0000)]
[x86] Force mixes asm syntax test to check for x86

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266993 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Hexagon] Define architecture version macros for hexagonv55
Krzysztof Parzyszek [Thu, 21 Apr 2016 14:30:04 +0000 (14:30 +0000)]
[Hexagon] Define architecture version macros for hexagonv55

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266989 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoClarify memory ownership semantics; NFC.
Aaron Ballman [Thu, 21 Apr 2016 13:51:07 +0000 (13:51 +0000)]
Clarify memory ownership semantics; NFC.

Patch by Clement Courbet

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266986 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Clang][AVX512][BuiltIn] Adding intrinsics of VGATHER{DPS|DPD} , VPGATHER{QD|QQ|DD...
Michael Zuckerman [Thu, 21 Apr 2016 12:47:27 +0000 (12:47 +0000)]
[Clang][AVX512][BuiltIn] Adding intrinsics of VGATHER{DPS|DPD} , VPGATHER{QD|QQ|DD|DQ} and VGATHERPF{0|1}{DPS|QPS|DPD|QPD} instruction set .

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266983 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoCorrectly parse GCC-style asm line following MS-style asm line.
Denis Zobnin [Thu, 21 Apr 2016 10:59:18 +0000 (10:59 +0000)]
Correctly parse GCC-style asm line following MS-style asm line.

Quit parsing MS-style inline assembly if the following statement has GCC style.
Enables compilation of code like

void f() {
  __asm mov ebx, ecx
  __asm__("movl %ecx, %edx");
}

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266976 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoBack out the test case for r266973 for now.
Benjamin Kramer [Thu, 21 Apr 2016 10:46:14 +0000 (10:46 +0000)]
Back out the test case for r266973 for now.

It breaks on windows, need to investigate. It's not testing the
important part of that change anyways.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266975 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Tooling] Inject -resource-dir instead of overwriting argv[0].
Benjamin Kramer [Thu, 21 Apr 2016 10:18:18 +0000 (10:18 +0000)]
[Tooling] Inject -resource-dir instead of overwriting argv[0].

This allows using a different standard library (the one from argv[0] in
the compilation database) with the correct builtins.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266973 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoCompilation for Intel MCU (Part 1/3)
Andrey Turetskiy [Thu, 21 Apr 2016 10:16:48 +0000 (10:16 +0000)]
Compilation for Intel MCU (Part 1/3)

Add -miamcu option which:
  * Sets IAMCU triple
  * Sets IAMCU ABI
  * Enforces static compilation

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266972 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[modules] Make the tweak to avoid circular inclusion of emmintrin.h and
Richard Smith [Thu, 21 Apr 2016 01:46:37 +0000 (01:46 +0000)]
[modules] Make the tweak to avoid circular inclusion of emmintrin.h and
xmmintrin.h a bit more directed. If for whatever reason modules are enabled but
we textually include one of these headers, don't deploy the special case for
modules. To make this work cleanly, extend __building_module to be defined
even when modules is disabled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266945 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRemove the (ignored) -Wreceived-is-weak diagnostic.
Bob Wilson [Thu, 21 Apr 2016 00:11:24 +0000 (00:11 +0000)]
Remove the (ignored) -Wreceived-is-weak diagnostic.

We kept this around for a while since Xcode 6 and earlier had a build
setting for this warning. It was removed in Xcode 7 so there should be
no need for this warning now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266938 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoModule Debugging: Emit the canonical debug info for Objective-C classes
Adrian Prantl [Wed, 20 Apr 2016 23:59:32 +0000 (23:59 +0000)]
Module Debugging: Emit the canonical debug info for Objective-C classes
in the compile unit that contains their implementation even if their
interface is declared in a module.

The private @implementation of an @interface may have additional
hidden ivars so we should not defer to the public version of the
type that is found in the module.

<rdar://problem/25541798>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266937 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Tooling] Fix getting fully qualified names of template alias types.
Chaoren Lin [Wed, 20 Apr 2016 22:12:07 +0000 (22:12 +0000)]
[Tooling] Fix getting fully qualified names of template alias types.

Reviewers: rsmith, rnk

Subscribers: cfe-commits, klimek

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266925 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd warning about CR+LF line endings on Windows.
Adrian McCarthy [Wed, 20 Apr 2016 16:43:34 +0000 (16:43 +0000)]
Add warning about CR+LF line endings on Windows.

s/checkout/check out/ when used as a verb.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266887 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[OPENMP] Codegen for untied tasks.
Alexey Bataev [Wed, 20 Apr 2016 04:01:36 +0000 (04:01 +0000)]
[OPENMP] Codegen for untied tasks.

If the untied clause is present on a task construct, any thread in the
team can resume the task region after a suspension. Patch adds proper
codegen for untied tasks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266853 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoEnable ODR uniquing of DITypes for ThinLTO backends
Teresa Johnson [Wed, 20 Apr 2016 02:23:52 +0000 (02:23 +0000)]
Enable ODR uniquing of DITypes for ThinLTO backends

Summary:
This is a follow-on to apply Duncan's new DIType ODR uniquing from
r266549 and r266713 in more places.

When invoking ThinLTO backend compiles via clang (for a distributed
build), invoke enableDebugTypeODRUniquing() before parsing the module.

Reviewers: dexonsmith, joker.eph

Subscribers: llvm-commits, joker.eph

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266852 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Clang] Remove unwanted --check-prefix=CHECK from unit tests. NFC.
Mandeep Singh Grang [Wed, 20 Apr 2016 01:02:18 +0000 (01:02 +0000)]
[Clang] Remove unwanted --check-prefix=CHECK from unit tests. NFC.

Summary:
    Removed unwanted --check-prefix=CHECK from the following unit tests:
      test/CXX/special/class.copy/implicit-move-def.cpp
      test/CodeGen/cleanup-destslot-simple.c
      test/CodeGen/inline-asm-immediate-ubsan.c
      test/CodeGen/mips-interrupt-attr.c
      test/CodeGenCXX/cfi-stats.cpp
      test/CodeGenCXX/copy-constructor-elim.cpp
      test/CodeGenCXX/microsoft-templ-uuidof.cpp
      test/CodeGenCXX/vtable-linkage.cpp
      test/CodeGenObjC/messages-2.m
      test/Driver/noinline.c
      test/Index/remap-load.c
      test/Index/retain-comments-from-system-headers.c
      test/OpenMP/task_if_codegen.cpp
      test/Preprocessor/comment_save_macro.c

Patch by:  Mandeep Singh Grang (mgrang)

Reviewers: rafael, ABataev, rengolin

Projects: #clang-c

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266843 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMarkEOLs should only be true for clang-cl.exe.
Stephen Hines [Wed, 20 Apr 2016 00:33:06 +0000 (00:33 +0000)]
MarkEOLs should only be true for clang-cl.exe.

Summary:
https://llvm.org/bugs/show_bug.cgi?id=27396

This fixes an issue in response files where "\r\n" was being interpreted
as two EOL markers (i.e. we consumed the '\r' as terminating the
previous token, and then parsed the '\n' as a significant EOL). This
breaks response files where joined arguments get split across multiple
lines (like "-x\r\nc"). I also fixed an accidental issue in the
response-file.c test, where the response file is appended to, instead of
being overwritten.

Reviewers: rnk

Subscribers: danalbert, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266840 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Parse] Reuse OptionUnroll rather than matching it again. NFC
Adam Nemet [Tue, 19 Apr 2016 22:29:24 +0000 (22:29 +0000)]
[Parse] Reuse OptionUnroll rather than matching it again. NFC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266829 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Parse] Use StringSwitch to improve readability. NFC
Adam Nemet [Tue, 19 Apr 2016 22:17:45 +0000 (22:17 +0000)]
[Parse] Use StringSwitch to improve readability. NFC

A subsequent patch will propose a "distribute" loop hint.  Similarly to
unroll, this does not have a "assume_safety" argument either so this
condition will get more complex.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266827 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AArch64] Fix D19098 fallout.
Marcin Koscielnicki [Tue, 19 Apr 2016 20:51:00 +0000 (20:51 +0000)]
[AArch64] Fix D19098 fallout.

The intrinsic is now called llvm.thread.pointer, not
llvm.aarch64.thread.pointer.  Also, the code handling it in CGBuiltin.cpp
is dead - it's already covered by GCCBuiltin.  Remove it.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266817 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agocc1as: Don't crash when CIE is requested and no DWARF version is specified.
Adrian Prantl [Tue, 19 Apr 2016 20:31:19 +0000 (20:31 +0000)]
cc1as: Don't crash when CIE is requested and no DWARF version is specified.
This patch changes the default DWARF version for cc1as from invalid 0 to 2,
which should be the lowest common denominator on all platforms.

rdar://problem/24735813

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266814 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ARM NEON] Define vfms_f32 on ARM, and all vfms using vfma.
Ahmed Bougacha [Tue, 19 Apr 2016 19:44:45 +0000 (19:44 +0000)]
[ARM NEON] Define vfms_f32 on ARM, and all vfms using vfma.

r259537 added vfma/vfms to armv7, but the builtin was only lowered
on the AArch64 side. Instead of supporting it on ARM, get rid of it.

The vfms builtin lowered to:
  %nb = fsub float -0.0, %b
  %r = @llvm.fma.f32(%a, %nb, %c)

Instead, define the operation in terms of vfma, and swap the
multiplicands. It now lowers to:
  %na = fsub float -0.0, %a
  %r = @llvm.fma.f32(%na, %b, %c)

This matches the instruction more closely, and lets current LLVM
generate the "natural" operand ordering:
  fmls.2s v0, v1, v2
instead of the crooked (but equivalent):
  fmls.2s v0, v2, v1
Except for theses changes, assembly is identical.

LLVM accepts both commutations, and the LLVM tests in:
  test/CodeGen/AArch64/arm64-fmadd.ll
  test/CodeGen/AArch64/fp-dp3.ll
  test/CodeGen/AArch64/neon-fma.ll
  test/CodeGen/ARM/fusedMAC.ll
already check either the new one only, or both.

Also verified against the test-suite unittests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266807 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFixed a bug in AnnotatedLine::startsWith when there are comments in the line.
Eric Liu [Tue, 19 Apr 2016 19:25:33 +0000 (19:25 +0000)]
Fixed a bug in AnnotatedLine::startsWith when there are comments in the line.

Summary: When there are comments in the line, one token may be checked multiple times.

Reviewers: mprobst, djasper

Subscribers: ioeric, cfe-commits, klimek

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266803 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoObjC Class Property: don't emit class properties on old deployment targets.
Manman Ren [Tue, 19 Apr 2016 19:05:03 +0000 (19:05 +0000)]
ObjC Class Property: don't emit class properties on old deployment targets.

For old deployment targets, emit nil for all class property lists.

rdar://25616128

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266800 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix PR26999 better- RenderDebugEnablingArgs() once only
Douglas Katzman [Tue, 19 Apr 2016 18:55:53 +0000 (18:55 +0000)]
Fix PR26999 better- RenderDebugEnablingArgs() once only

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266797 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CUDA] Add a test for r266496 (raise an error if a CUDA installation isn't found)
Justin Lebar [Tue, 19 Apr 2016 18:52:28 +0000 (18:52 +0000)]
[CUDA] Add a test for r266496 (raise an error if a CUDA installation isn't found)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266796 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoreuse mustBeJSIdent for interface detection
Martin Probst [Tue, 19 Apr 2016 18:19:06 +0000 (18:19 +0000)]
reuse mustBeJSIdent for interface detection

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266790 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoclang-format: [JS] support `interface` as a free standing identifier.
Martin Probst [Tue, 19 Apr 2016 18:18:59 +0000 (18:18 +0000)]
clang-format: [JS] support `interface` as a free standing identifier.

Summary:
`interface` can be used as a fee standing identifier in JavaScript/TypeScript.
This change uses the heuristic of whether it's followed by another identifier
as an indication.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266789 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[builtin_expect] tighten checks, add test, add comments
Sanjay Patel [Tue, 19 Apr 2016 18:17:34 +0000 (18:17 +0000)]
[builtin_expect] tighten checks, add test, add comments

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266788 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoreduce indentation; NFCI
Sanjay Patel [Tue, 19 Apr 2016 18:06:33 +0000 (18:06 +0000)]
reduce indentation; NFCI

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266787 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CodeGen] Widen non-power-of-2 vector HFA base types.
Ahmed Bougacha [Tue, 19 Apr 2016 17:54:29 +0000 (17:54 +0000)]
[CodeGen] Widen non-power-of-2 vector HFA base types.

Currently, for the ppc64--gnu and aarch64 ABIs, we recognize:
  typedef __attribute__((__ext_vector_type__(3))) float v3f32;
  typedef __attribute__((__ext_vector_type__(16))) char v16i8;
  struct HFA {
    v3f32 a;
    v16i8 b;
  };

as an HFA. Since the first type encountered is used as the base type,
we pass the HFA as:
    [2 x <3 x float>]
Which leads to incorrect IR (relying on padding values) when the
second field is used.

Instead, explicitly widen the vector (after size rounding) in
isHomogeneousAggregate.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266784 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CodeGen] Fix whitespace. NFC.
Ahmed Bougacha [Tue, 19 Apr 2016 17:54:24 +0000 (17:54 +0000)]
[CodeGen] Fix whitespace. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266783 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoPass dwarf-version to cc1as.
Douglas Katzman [Tue, 19 Apr 2016 17:43:54 +0000 (17:43 +0000)]
Pass dwarf-version to cc1as.

Fix PR26999 - crashing in cc1as with any '*bsd' target.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266775 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoreduce indentation; NFCI
Sanjay Patel [Tue, 19 Apr 2016 17:13:14 +0000 (17:13 +0000)]
reduce indentation; NFCI

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266765 91177308-0d34-0410-b5e6-96231b3b80d8