]> granicus.if.org Git - clang/log
clang
8 years agoSummary:
Martin Probst [Tue, 19 Apr 2016 14:59:16 +0000 (14:59 +0000)]
Summary:
clang-format: [JS] unit tests for type aliases.

Also adds a test for "foo as bar" casts.

Spec:
https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#3.10

These are already handled correctly.

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

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

8 years agoclang-format: [JS] simplify import/export.
Martin Probst [Tue, 19 Apr 2016 14:55:37 +0000 (14:55 +0000)]
clang-format: [JS] simplify import/export.

Summary:
Change `import` and `export` parsing to special case the renaming
syntax (`import x, {y as bar} ...`, `export {x}`) and otherwise just
parse a regular structural element.

This simplifies the code a bit and should be more correct - it's easier
to recognise the specific import syntax than to recognise arbitrary
expressions and declarations.

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

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

8 years agoD17487: [analyzer][scan-build-py] flag filter modification for compilation database...
Laszlo Nagy [Tue, 19 Apr 2016 12:03:03 +0000 (12:03 +0000)]
D17487: [analyzer][scan-build-py] flag filter modification for compilation database creation

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

8 years agoRevert "[OPENMP] Codegen for untied tasks."
Alexey Bataev [Tue, 19 Apr 2016 09:27:38 +0000 (09:27 +0000)]
Revert "[OPENMP] Codegen for untied tasks."

This reverts commit 266722.

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

8 years ago[OPENMP] Codegen for untied tasks.
Alexey Bataev [Tue, 19 Apr 2016 09:10:27 +0000 (09:10 +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@266722 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoWarn if function or variable cannot be implicitly instantiated
Serge Pavlov [Tue, 19 Apr 2016 06:19:52 +0000 (06:19 +0000)]
Warn if function or variable cannot be implicitly instantiated

With this patch compiler emits warning if it tries to make implicit instantiation
of a template but cannot find the template definition. The warning can be suppressed
by explicit instantiation declaration or by command line options
-Wundefined-var-template and -Wundefined-func-template. The implementation follows
the discussion of http://reviews.llvm.org/D12326.

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

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

8 years ago[CUDA] Add --no-cuda-noopt-debug, which disables --cuda-noopt-debug.
Justin Lebar [Tue, 19 Apr 2016 02:27:11 +0000 (02:27 +0000)]
[CUDA] Add --no-cuda-noopt-debug, which disables --cuda-noopt-debug.

Reviewers: tra

Subscribers: cfe-commits, jhen

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

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

8 years ago[CUDA] Add --cuda-compile-host-device, which overrides --cuda-host-only and --cuda...
Justin Lebar [Tue, 19 Apr 2016 02:27:07 +0000 (02:27 +0000)]
[CUDA] Add --cuda-compile-host-device, which overrides --cuda-host-only and --cuda-device-only.

Summary:
This completes the flag's tristate, letting you override it at will on
the command line.

Reviewers: tra

Subscribers: cfe-commits, jhen

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

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

8 years agoAdd a test case to check a member's default constructor is also run.
Akira Hatanaka [Tue, 19 Apr 2016 02:21:47 +0000 (02:21 +0000)]
Add a test case to check a member's default constructor is also run.

This is a follow-up to r266645.

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

8 years ago[ObjC++] Fix crash when emitting debug info for a block member capturing this.
Adrian Prantl [Mon, 18 Apr 2016 23:48:16 +0000 (23:48 +0000)]
[ObjC++] Fix crash when emitting debug info for a block member capturing this.

rdar://problem/23871824

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

8 years agoMark -Xclang as being a compilation-only option so that the clang driver
Richard Smith [Mon, 18 Apr 2016 23:12:59 +0000 (23:12 +0000)]
Mark -Xclang as being a compilation-only option so that the clang driver
doesn't warn if it's passed to a link action. This matches the behavior for
most other compilation-only options (including things like -f flags), and is
necessary to suppress warnings on systems like cmake that always pass all
compile flags to the linker.

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

8 years ago[modules] Remove some more unnecessary forwarding functions.
Richard Smith [Mon, 18 Apr 2016 21:54:58 +0000 (21:54 +0000)]
[modules] Remove some more unnecessary forwarding functions.

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

8 years ago[sanitizer-coverage] make sure coverage flags are not passed to clang if the driver...
Kostya Serebryany [Mon, 18 Apr 2016 21:30:17 +0000 (21:30 +0000)]
[sanitizer-coverage] make sure coverage flags are not passed to clang if the driver thinks they are unused

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

8 years ago[sanitizer-coverage] better docs for -fsanitize-coverage=trace-bb
Kostya Serebryany [Mon, 18 Apr 2016 21:28:37 +0000 (21:28 +0000)]
[sanitizer-coverage] better docs for -fsanitize-coverage=trace-bb

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

8 years ago[Hexagon] V60/HVX builtin definitions for clang
Krzysztof Parzyszek [Mon, 18 Apr 2016 21:27:59 +0000 (21:27 +0000)]
[Hexagon] V60/HVX builtin definitions for clang

The builtins already exist in LLVM, but are not exposed to the C/C++
programmers. This patch adds all the information about the builtins
needed for clang, as well as a test for all available intrinsics.

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

8 years agoBlock: Fix a crash when we have type attributes or qualifiers with omitted
Manman Ren [Mon, 18 Apr 2016 18:40:51 +0000 (18:40 +0000)]
Block: Fix a crash when we have type attributes or qualifiers with omitted
return type.

Emit a warning instead of crashing in IR generation.

rdar://22762981

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

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

8 years ago[Hexagon] Define macros __HVX__ and __HVXDBL__ when appropriate
Krzysztof Parzyszek [Mon, 18 Apr 2016 18:38:11 +0000 (18:38 +0000)]
[Hexagon] Define macros __HVX__ and __HVXDBL__ when appropriate

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

8 years ago[Parser][ObjC] Make sure c++11 in-class initialization is done when the
Akira Hatanaka [Mon, 18 Apr 2016 18:19:45 +0000 (18:19 +0000)]
[Parser][ObjC] Make sure c++11 in-class initialization is done when the
constructor's definition is in an implementation block.

Without this commit, ptr doesn't get initialized to null in the
following code:

struct S {
  S();
  void *ptr = nullptr;
};

@implementation I
  S::S() {}
@end

rdar://problem/25693624

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

8 years agoClarifying the wording of this diagnostic; it confused parameter and argument.
Aaron Ballman [Mon, 18 Apr 2016 18:10:53 +0000 (18:10 +0000)]
Clarifying the wording of this diagnostic; it confused parameter and argument.

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

8 years agoNFC: unify clang / LLVM atomic ordering
JF Bastien [Mon, 18 Apr 2016 18:01:49 +0000 (18:01 +0000)]
NFC: unify clang / LLVM atomic ordering

This makes the C11 / C++11 *ABI* atomic ordering accessible from LLVM,
as discussed in http://reviews.llvm.org/D18200#inline-151433

This re-applies r266574 which I had reverted in r266575.

Depends on http://reviews.llvm.org/D18875

Original review: http://reviews.llvm.org/D18876

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

8 years agoUpdate InstrProf pass creator API reference
Xinliang David Li [Mon, 18 Apr 2016 17:48:12 +0000 (17:48 +0000)]
Update InstrProf pass creator API reference

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

8 years ago[ARM] predefines __ELF__ macro for arm-none-eabi
Weiming Zhao [Mon, 18 Apr 2016 16:25:46 +0000 (16:25 +0000)]
[ARM] predefines __ELF__ macro for arm-none-eabi

Summary: predefines __ELF__ macro for arm-none-eabi

Reviewers: silviu.baranga, rengolin

Subscribers: aemerson, rengolin, cfe-commits

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

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

8 years agoclang-format: Improve heuristics to detect function declarations/definitions.
Daniel Jasper [Mon, 18 Apr 2016 11:31:21 +0000 (11:31 +0000)]
clang-format: Improve heuristics to detect function declarations/definitions.

Specifically understand ellipses in parameter lists and treat trailing
reference qualifiers and the "{" as signals.

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

8 years agoAdd missing include for StringRef (NFC)
Mehdi Amini [Mon, 18 Apr 2016 09:08:59 +0000 (09:08 +0000)]
Add missing include for StringRef (NFC)

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

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

8 years agoRevert "NFC: unify clang / LLVM atomic ordering"
JF Bastien [Sun, 17 Apr 2016 21:28:50 +0000 (21:28 +0000)]
Revert "NFC: unify clang / LLVM atomic ordering"

This reverts commit b0495df9eae2824bee830cc4c94f5441f0d4cbc9.

Same as for the corresponding LLVM revert, an assert seems to fire.

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

8 years agoNFC: unify clang / LLVM atomic ordering
JF Bastien [Sun, 17 Apr 2016 21:01:09 +0000 (21:01 +0000)]
NFC: unify clang / LLVM atomic ordering

Summary:
Depends on http://reviews.llvm.org/D18875

This makes the C11 / C++11 *ABI* atomic ordering accessible from LLVM, as discussed in http://reviews.llvm.org/D18200#inline-151433

Reviewers: jyknight, reames

Subscribers: cfe-commits

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

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

8 years agoImplement CWG 941 - explicit specializations of deleted function templates
Faisal Vali [Sun, 17 Apr 2016 17:32:04 +0000 (17:32 +0000)]
Implement CWG 941 - explicit specializations of deleted function templates

  template<class T> void f(T) = delete;
  template<> void f(int); // OK.

  f(3); // OK

Implementation strategy:

When an explicit specialization of a function template, a member function template or a member function of a class template is declared, clang first implicitly instantiates the declaration of a specialization from the templated-entity being explicitly specialized (since their signatures must be the same) and then links the explicit specialization being declared as a redeclaration of the aforementioned specialization.

The problem was that when clang 'implicitly instantiates' the initial specialization, it marks the corresponding FunctionDecl as deleted if the corresponding templated-entity was deleted, rather than waiting to see whether the explicit specialization being declared provides a non-deleted body. (The eager marking of delete has advantages during overload resolution I suppose, where we don't have to try and instantiate a definition of the function to see if it is deleted).

The present fix entails recognizing that when clang knows that an explicit specialization is being declared (for whichever templated-entity), the prior implicit instantiation should not inherit the 'deleted' status, and so we reset it to false.

I suppose an alternative fix (amongst others) could consider creating a new context (ExplicitSpecializationDeclarationSubstitution or some such) that is checked during template-argument-deduction and final substitution, and avoid inheriting the deleted status during declaration substitution.  But while conceptually cleaner, that would be a slightly more involved change (as could be some of the other alternatives: such as avoid tagging implicit specializations as deleted, and check their primary templates for the deleted status where needed), and so I chose a different path.  Hopefully it'll prove to not be a bad choice.

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

8 years agoDebugInfo: Make DICompositeTypes distinct most of the time
Duncan P. N. Exon Smith [Sun, 17 Apr 2016 07:45:08 +0000 (07:45 +0000)]
DebugInfo: Make DICompositeTypes distinct most of the time

Since elements of most kinds of DICompositeType have back references,
most are involved in uniquing cycles.  Except via the ODR 'identifier:'
field, which doesn't care about the storage type (see r266549),
they have no hope of being uniqued.

Distinct nodes are far more efficient, so use them for most kinds of
DICompositeType definitions (i.e., when DIType::isForwardDecl is false).
The exceptions:

  - DW_TAG_array_type, since their elements never have back-references
    and they never have ODR 'identifier:' fields;

  - DW_TAG_enumeration_type when there is no ODR 'identifier:' field,
    since their elements usually don't have back-references.

This breaks the last major uniquing cycle I'm aware of in the debug info
graph.  The impact won't be enormous for C++ because references to
ODR-uniqued nodes still use string-based DITypeRefs; but this should
prevent a regression in C++ when we drop the string-based references.

This wouldn't have been reasonable until r266549, when composite types
stopped relying on being uniqued by structural equivalence to prevent
blow-ups at LTO time.

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

8 years agoAdd missing headers (fix build after headers cleanup in LLVM)
Mehdi Amini [Sat, 16 Apr 2016 08:14:10 +0000 (08:14 +0000)]
Add missing headers (fix build after headers cleanup in LLVM)

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

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

8 years agoReplace hardcoded comment at 'lit.site.cfg.in'
Alex Denisov [Sat, 16 Apr 2016 06:54:46 +0000 (06:54 +0000)]
Replace hardcoded comment at 'lit.site.cfg.in'

At the moment almost every lit.site.cfg.in contains two lines comment:

  ## Autogenerated by LLVM/Clang configuration.
  # Do not edit!

The patch adds variable LIT_SITE_CFG_IN_HEADER, that is replaced from
configure_lit_site_cfg with the note and some useful information.

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

8 years ago[modules] Don't expose *intrin.h headers that cannot be included standalone as
Richard Smith [Sat, 16 Apr 2016 00:46:26 +0000 (00:46 +0000)]
[modules] Don't expose *intrin.h headers that cannot be included standalone as
separate modules. These cause build breakage with -fmodules-local-submodule-visibility.

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

8 years ago[CUDA] Raise an error if the CUDA install can't be found.
Justin Lebar [Sat, 16 Apr 2016 00:11:11 +0000 (00:11 +0000)]
[CUDA] Raise an error if the CUDA install can't be found.

Summary:
Without this change, we silently proceed on without including
__clang_cuda_runtime_wrapper.h.  This leads to very strange behavior --
you say you're compiling CUDA code, but e.g. __device__ is not defined!

Reviewers: tra

Subscribers: cfe-commits

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

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

8 years agoImprove diagnostic for the case when a non-defined function-like macro is used
Richard Smith [Sat, 16 Apr 2016 00:07:09 +0000 (00:07 +0000)]
Improve diagnostic for the case when a non-defined function-like macro is used
in a preprocessor constant expression.

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

8 years agoRevert 266186 as it breaks anything that includes type_traits on some platforms
Nemanja Ivanovic [Fri, 15 Apr 2016 18:04:13 +0000 (18:04 +0000)]
Revert 266186 as it breaks anything that includes type_traits on some platforms

Since this patch provided support for the __float128 type but disabled it
on all platforms by default, some platforms can't compile type_traits with
-std=gnu++11 since there is a specialization with __float128.
This reverts the patch until D19125 is approved (i.e. we know which platforms
need this support enabled).

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

8 years agoFix testcase for MSVC targets where the output ordering is different.
Adrian Prantl [Fri, 15 Apr 2016 16:21:23 +0000 (16:21 +0000)]
Fix testcase for MSVC targets where the output ordering is different.

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

8 years agoUpdate testcase to new debug info metadata format.
Adrian Prantl [Fri, 15 Apr 2016 16:05:13 +0000 (16:05 +0000)]
Update testcase to new debug info metadata format.

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

8 years agoUpdate to match LLVM changes for PR27284.
Adrian Prantl [Fri, 15 Apr 2016 15:55:45 +0000 (15:55 +0000)]
Update to match LLVM changes for PR27284.
(Reverse the ownership between DICompileUnit and DISubprogram.)

http://reviews.llvm.org/D19034
<rdar://problem/25256815>

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

8 years agoASTMatchers.h: Fix formatting. [-Wdocumentation]
NAKAMURA Takumi [Fri, 15 Apr 2016 15:42:27 +0000 (15:42 +0000)]
ASTMatchers.h: Fix formatting. [-Wdocumentation]

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

8 years agoRevert r266415, it broke parsing SDK headers (PR27367).
Nico Weber [Fri, 15 Apr 2016 14:35:06 +0000 (14:35 +0000)]
Revert r266415, it broke parsing SDK headers (PR27367).

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

8 years agoRemove include duplicate. NFC.
Alexey Bader [Fri, 15 Apr 2016 13:23:26 +0000 (13:23 +0000)]
Remove include duplicate. NFC.

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

8 years ago[MSVC Compat] Implementation of __unaligned (MS extension) as a type qualifier
Andrey Bokhanko [Fri, 15 Apr 2016 08:03:51 +0000 (08:03 +0000)]
[MSVC Compat] Implementation of __unaligned (MS extension) as a type qualifier

This patch implements __unaligned as a type qualifier; before that, it was
modeled as an attribute. Proper mangling of __unaligned is implemented as well.
Some OpenCL code/tests are tangenially affected, as they relied on existing
number and sizes of type qualifiers.

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

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

8 years agoclang-cl: Don't check for existence of linker inputs when /link is used
Hans Wennborg [Fri, 15 Apr 2016 01:12:32 +0000 (01:12 +0000)]
clang-cl: Don't check for existence of linker inputs when /link is used

There might be flags passed to the linker (e.g. /libpath), causing it
to search in paths the Clang driver doesn't know about.

PR27234

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

8 years agoclang-cl: Make /link accept an optional joined argument.
Hans Wennborg [Fri, 15 Apr 2016 00:24:15 +0000 (00:24 +0000)]
clang-cl: Make /link accept an optional joined argument.

For example, "cl.exe a.c /linkfoo bar" is a valid invocation and
forwards "foo" and "bar" to link.exe. This makes clang-cl handle
that kind of invocation.

Depends on LLVM r266394.

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

8 years agoLit C++11 Compatibility Patch #8
Charles Li [Thu, 14 Apr 2016 23:47:07 +0000 (23:47 +0000)]
Lit C++11 Compatibility Patch #8

24 tests have been updated for C++11 compatibility.

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

8 years agoAMDGPU: Add test for generic builtin behavior
Matt Arsenault [Thu, 14 Apr 2016 22:34:39 +0000 (22:34 +0000)]
AMDGPU: Add test for generic builtin behavior

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

8 years agoIn vector comparisons, handle scalar LHS just as we handle scalar RHS
Reid Kleckner [Thu, 14 Apr 2016 21:03:38 +0000 (21:03 +0000)]
In vector comparisons, handle scalar LHS just as we handle scalar RHS

Summary: Fixes PR27258

Reviewers: rsmith

Subscribers: cfe-commits

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

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

8 years agoMake this code less brittle. The benefits of a fixed-size array aren't worth the...
Richard Smith [Thu, 14 Apr 2016 19:45:19 +0000 (19:45 +0000)]
Make this code less brittle. The benefits of a fixed-size array aren't worth the maintenance cost.

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

8 years agoFix off-by-one error in worst-case number of offsets needed for an AST record.
Richard Smith [Thu, 14 Apr 2016 18:32:54 +0000 (18:32 +0000)]
Fix off-by-one error in worst-case number of offsets needed for an AST record.

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

8 years agoAdd typedefNameDecl() and typeAliasDecl() to the AST matchers; improves hasType(...
Aaron Ballman [Thu, 14 Apr 2016 16:05:45 +0000 (16:05 +0000)]
Add typedefNameDecl() and typeAliasDecl() to the AST matchers; improves hasType() to match on TypedefNameDecl nodes.

Patch by Clement Courbet.

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

8 years agoFix testcase for the LLVM_LIBDIR_SUFFIX=64 case. Fallout from r266108.
Ismail Donmez [Thu, 14 Apr 2016 15:32:24 +0000 (15:32 +0000)]
Fix testcase for the LLVM_LIBDIR_SUFFIX=64 case. Fallout from r266108.

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

8 years agoclang-format: Last line in incomplete block is indented incorrectly
Marianne Mailhot-Sarrasin [Thu, 14 Apr 2016 14:56:49 +0000 (14:56 +0000)]
clang-format: Last line in incomplete block is indented incorrectly

Indentation of the last line was reset to the initial indentation of the block when reaching EOF.

Patch by Maxime Beaulieu

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

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

8 years agoclang-format: Implemented tab usage for continuation and indentation
Marianne Mailhot-Sarrasin [Thu, 14 Apr 2016 14:52:26 +0000 (14:52 +0000)]
clang-format: Implemented tab usage for continuation and indentation

Use tabs to fill whitespace at the start of a line.

Patch by Maxime Beaulieu

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

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

8 years agoclang-format: Allow include of clangFormat.h in managed context
Marianne Mailhot-Sarrasin [Thu, 14 Apr 2016 14:47:37 +0000 (14:47 +0000)]
clang-format: Allow include of clangFormat.h in managed context

Including VirtualFileSystem.h in the clangFormat.h indirectly includes <atomic>.
This header is blocked when compiling with /clr.

Patch by Maxime Beaulieu

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

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

8 years ago[analyzer] Make it possible to query the function name from a CallDescription.
Gabor Horvath [Thu, 14 Apr 2016 11:56:28 +0000 (11:56 +0000)]
[analyzer] Make it possible to query the function name from a CallDescription.

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

8 years ago[ASTImporter] Implement some expression-related AST node import.
Artem Dergachev [Thu, 14 Apr 2016 11:51:27 +0000 (11:51 +0000)]
[ASTImporter] Implement some expression-related AST node import.

Introduce ASTImporter unit test framework.

Fix a memory leak introduced in cf8ccff5: an array is allocated
in ImportArray and never freed.

Support new node kinds:

- GCCAsmStmt

- AddrLabelExpr
- AtomicExpr
- CompoundLiteralExpr
- CXXBoolLiteralExpr
- CXXNullPtrLiteralExpr
- CXXThisExpr
- DesignatedInitExpr
- GNUNullExpr
- ImplicitValueInitExpr
- InitListExpr
- OpaqueValueExpr
- PredefinedExpr
- ParenListExpr
- StmtExpr
- VAArgExpr

- BinaryConditionalOperator
- ConditionalOperator

- FloatingLiteral
- StringLiteral

- InjectedClassNameType
- TemplateTypeParmType

- LabelDecl

Patch by Aleksei Sidorin!

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

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

8 years agoReapply r258505 after r266254, this time with a comment to make it more sticky.
Nico Weber [Thu, 14 Apr 2016 11:12:32 +0000 (11:12 +0000)]
Reapply r258505 after r266254, this time with a comment to make it more sticky.

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

8 years ago[MSVC] Fix check for wchar_t type in case of -fno-wchar
Dmitry Polukhin [Thu, 14 Apr 2016 09:52:06 +0000 (09:52 +0000)]
[MSVC] Fix check for wchar_t type in case of -fno-wchar

The example below should work identically with and without compiler native
wchar_t support.

void foo(wchar_t * t = L"");

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

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

8 years ago[Clang][AVX512][BUILTIN] Adding support for intrinsics of vpmov{d|q}{b|w|d}{128|256...
Michael Zuckerman [Thu, 14 Apr 2016 07:56:51 +0000 (07:56 +0000)]
[Clang][AVX512][BUILTIN] Adding support for intrinsics of vpmov{d|q}{b|w|d}{128|256|512} instruction set

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

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

8 years ago[Clang][AVX512][Builtin] Adding intrinsics of vpmovus{d|q}{b|w|d}{128|256|512} instru...
Michael Zuckerman [Thu, 14 Apr 2016 06:48:09 +0000 (06:48 +0000)]
[Clang][AVX512][Builtin] Adding intrinsics of vpmovus{d|q}{b|w|d}{128|256|512} instruction set

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

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

8 years agoMake sure the LLVMContext outlive the CompilerInstance
Mehdi Amini [Thu, 14 Apr 2016 05:37:41 +0000 (05:37 +0000)]
Make sure the LLVMContext outlive the CompilerInstance

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

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

8 years agoDo not use llvm:getGlobalContext() in unittests
Mehdi Amini [Thu, 14 Apr 2016 05:34:32 +0000 (05:34 +0000)]
Do not use llvm:getGlobalContext() in unittests

Currently trying to nuke this API from LLVM.

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

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

8 years ago[modules] Store the location of the lexical update record in a decl update as
Richard Smith [Thu, 14 Apr 2016 00:50:18 +0000 (00:50 +0000)]
[modules] Store the location of the lexical update record in a decl update as
an offset from the current record rather than as an absolute bit number. This
gives a minor .pcm file size reduction.

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

8 years agoReorder ASTNodeKind::AllKindInfo to match NodeKindId.
Alexander Kornienko [Thu, 14 Apr 2016 00:47:40 +0000 (00:47 +0000)]
Reorder ASTNodeKind::AllKindInfo to match NodeKindId.

Summary:
AllKindInfo is being indexed by NodeKindId, so the order must match.
Extended ASTTypeTraits tests to cover this.

Reviewers: sbenza

Subscribers: cfe-commits, klimek

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

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

8 years ago[modules] Remove CXX_BASE_SPECIFIERS_OFFSETS table. Instead of storing an ID of
Richard Smith [Thu, 14 Apr 2016 00:29:55 +0000 (00:29 +0000)]
[modules] Remove CXX_BASE_SPECIFIERS_OFFSETS table. Instead of storing an ID of
a table entry in the corresponding decl, store an offset from the current
record to the relevant CXX_BASE_SPECIFIERS record. This results in fewer
indirections and a minor .pcm file size reduction.

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

8 years agoObjC kindof: order the methods in global pool relative to availability.
Manman Ren [Wed, 13 Apr 2016 23:43:56 +0000 (23:43 +0000)]
ObjC kindof: order the methods in global pool relative to availability.

r265877 tries to put methods that are deprecated or unavailable to the
front of the global pool to emit diagnostics, but it breaks some of
our existing codes that depend on choosing a certain method for id
lookup.

This commit orders the methods with the same declaration with respect
to the availability, but do not order methods with different declaration.

rdar://25707511

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

8 years ago[CodeGen] Avoid ctor/dtor boilerplate with some C++11
Reid Kleckner [Wed, 13 Apr 2016 23:37:17 +0000 (23:37 +0000)]
[CodeGen] Avoid ctor/dtor boilerplate with some C++11

Non-owning pointers that cache LLVM types and constants can use
'nullptr' default member initializers so that we don't need to mention
them in the constructor initializer list.

Owning pointers should use std::unique_ptr so that we don't need to
manually delete them in the destructor. They also don't need to be
mentioned in the constructor at that point.

NFC

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

8 years ago[modules] Remove CXX_CTOR_INITIALIZERS_OFFSETS table. Instead of storing an ID
Richard Smith [Wed, 13 Apr 2016 21:57:08 +0000 (21:57 +0000)]
[modules] Remove CXX_CTOR_INITIALIZERS_OFFSETS table. Instead of storing an ID
of a table entry in the corresponding decl, store an offset from the current
record to the relevant CXX_CTOR_INITIALIZERS record. This results in fewer
indirections and a minor .pcm file size reduction.

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

8 years ago[SemaObjC] Properly handle mix between type arguments and protocols.
Bruno Cardoso Lopes [Wed, 13 Apr 2016 20:59:07 +0000 (20:59 +0000)]
[SemaObjC] Properly handle mix between type arguments and protocols.

Under certain conditions clang currently fails to properly diagnostic ObjectC
parameter list when type args and protocols are mixed in the same list. This
happens when the first item in the parameter list is a (1) protocol, (2)
unknown type or (3) a list of protocols/unknown types up to the first type
argument. Fix the problem to report the proper error, example:

NSArray<M, NSValue *, NSURL, NSArray <id <M>>> *foo = @[@"a"];
NSNumber *bar = foo[0];
NSLog(@"%@", bar);

$ clang ...
x.m:7:13: error: angle brackets contain both a type ('NSValue') and a protocol ('M')
        NSArray<M, NSValue *, NSURL, NSArray <id <M>>> *foo = @[@"a"];
                ~  ^

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

rdar://problem/22204367

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

8 years agoMake sure CheckDestructor gets called on dllimported classes if the vtable is used...
Hans Wennborg [Wed, 13 Apr 2016 20:21:15 +0000 (20:21 +0000)]
Make sure CheckDestructor gets called on dllimported classes if the vtable is used (PR27319)

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

8 years agoLit C++11 Compatibility Patch #7
Charles Li [Wed, 13 Apr 2016 20:00:45 +0000 (20:00 +0000)]
Lit C++11 Compatibility Patch #7

13 tests have been updated for C++11 compatibility.
Differential Revision: http://reviews.llvm.org/D19068

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

8 years ago[CrashReproducer] Add test to run the reproducer script + modules
Bruno Cardoso Lopes [Wed, 13 Apr 2016 19:28:24 +0000 (19:28 +0000)]
[CrashReproducer] Add test to run the reproducer script + modules

Now that we have basic support in place, make sure the reproducer script
works with modules for a simple testcase.

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

8 years ago[CrashReproducer] Setup 'use-external-names' in YAML files.
Bruno Cardoso Lopes [Wed, 13 Apr 2016 19:28:21 +0000 (19:28 +0000)]
[CrashReproducer] Setup 'use-external-names' in YAML files.

Hide the real paths when rebuilding from VFS by setting up the crash
reproducer to use 'use-external-names' = false. This way we avoid
module redifinition errors and consistently use the same paths against
all modules.

With this change on Darwin we are able to simulate a crash for a simple
application using "Foundation/Foundation.h" (which relies on a bunch of
different frameworks and headers) and successfully rebuild all the
modules by relying solely at the VFS overlay.

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

8 years ago[VFS] Move default values to in-class member initialization. NFC
Bruno Cardoso Lopes [Wed, 13 Apr 2016 19:28:16 +0000 (19:28 +0000)]
[VFS] Move default values to in-class member initialization. NFC

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

8 years agoRemove redundant null-check; NFC
Hubert Tong [Wed, 13 Apr 2016 18:41:03 +0000 (18:41 +0000)]
Remove redundant null-check; NFC

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

8 years agolibclang: Use early-return to reduce indentation.
David Blaikie [Wed, 13 Apr 2016 18:36:19 +0000 (18:36 +0000)]
libclang: Use early-return to reduce indentation.

& since I'll get blamed for all the lines anyway, remove some
else-after-return and otherwise tidy things up.

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

8 years agoSimplify memory management of CXEvalResultKind/ExprEvalResult using unique_ptr and...
David Blaikie [Wed, 13 Apr 2016 18:23:33 +0000 (18:23 +0000)]
Simplify memory management of CXEvalResultKind/ExprEvalResult using unique_ptr and a dtor

This doesn't seem to need to be a C type, C only handles a void*, so use
new/delete as usual to simplify allocation and cleanup.

Follow-up to r265994

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

8 years ago[analyzer] Nullability: Suppress diagnostic on bind with cast.
Devin Coughlin [Wed, 13 Apr 2016 17:59:24 +0000 (17:59 +0000)]
[analyzer] Nullability: Suppress diagnostic on bind with cast.

Update the nullability checker to allow an explicit cast to nonnull to
suppress a warning on an assignment of nil to a nonnull:

id _Nonnull x = (id _Nonnull)nil; // no-warning

This suppression as already possible for diagnostics on returns and
function/method arguments.

rdar://problem/25381178

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

8 years ago[OrderFiles] Don't allow lit to run dtrace multithreaded
Chris Bieneman [Wed, 13 Apr 2016 17:12:56 +0000 (17:12 +0000)]
[OrderFiles] Don't allow lit to run dtrace multithreaded

Dtrace is implemented to try and minimize performance impact on the process being traced. This results in dtrace dropping samples if it is taking too many CPU resources. Multi-threading dtrace increases the sample drop rate dramatically.

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

8 years agoAArch64: allow 64-bit access to sysregs.
Tim Northover [Wed, 13 Apr 2016 17:08:55 +0000 (17:08 +0000)]
AArch64: allow 64-bit access to sysregs.

Although all the registers are actually 32-bits, I think we have to assume the
high 32-bits could be RES0 (the ARM ARM is unclear). If so, reading as a 32-bit
register can require extra zero extension operations.

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

8 years agoARM: make Darwin's "-arch armv7em" default to hard-float.
Tim Northover [Wed, 13 Apr 2016 17:08:51 +0000 (17:08 +0000)]
ARM: make Darwin's "-arch armv7em" default to hard-float.

We've already paid the price for separate "armv7m" and "armv7em" slices
(support in other tools), it's silly to make them identical other than the
default CPU.

rdar://23055688

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

8 years ago[Clang][AVX512][Builtin] Adding support to intrinsics of pmovs{d|q}{b|w|d}{128|256...
Michael Zuckerman [Wed, 13 Apr 2016 15:02:04 +0000 (15:02 +0000)]
[Clang][AVX512][Builtin] Adding support to intrinsics of pmovs{d|q}{b|w|d}{128|256|512} instruction set

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

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

8 years agoReverting r266199; it causes build bot failures.
Aaron Ballman [Wed, 13 Apr 2016 14:53:52 +0000 (14:53 +0000)]
Reverting r266199; it causes build bot failures.

http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/3255
http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/3517

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

8 years agoAdd functions declared in ctype.h to builtin function database. All functions are...
Aaron Ballman [Wed, 13 Apr 2016 13:55:58 +0000 (13:55 +0000)]
Add functions declared in ctype.h to builtin function database. All functions are annotated with nothrow and pure attribute, which enables better optimization.

Patch by Taewook Oh.

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

8 years ago[OPENMP 4.0] Fixed DSA analysis for taskloop directives.
Alexey Bataev [Wed, 13 Apr 2016 13:36:48 +0000 (13:36 +0000)]
[OPENMP 4.0] Fixed DSA analysis for taskloop directives.

Patch make clang to perform analysis for task-based directives also for
taskloop-based directives.

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

8 years ago[Clang][AVX512][Builtin] Adding support for VBROADCAST and VPBROADCASTB/W/D/Q instruc...
Michael Zuckerman [Wed, 13 Apr 2016 12:58:01 +0000 (12:58 +0000)]
[Clang][AVX512][Builtin] Adding support for VBROADCAST and VPBROADCASTB/W/D/Q instruction set

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

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

8 years agoAdd AST Matchers for CXXConstructorDecl::isDelegatingConstructor and CXXMethodDecl...
Alexander Kornienko [Wed, 13 Apr 2016 11:13:08 +0000 (11:13 +0000)]
Add AST Matchers for CXXConstructorDecl::isDelegatingConstructor and CXXMethodDecl::isUserProvided.

Summary: Added two AST matchers: isDelegatingConstructor for CXXConstructorDecl::IsDelegatingConstructor; and isUserProvided corresponding to CXXMethodDecl::isUserProvided.

Reviewers: aaron.ballman, alexfh

Subscribers: klimek, cfe-commits

Patch by Michael Miller!

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

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

8 years ago[Clang][AVX512][Builtin] Adding supporting to intrinsics of cvt{b|d|q}2mask{128|256...
Michael Zuckerman [Wed, 13 Apr 2016 10:49:37 +0000 (10:49 +0000)]
[Clang][AVX512][Builtin] Adding supporting to intrinsics of cvt{b|d|q}2mask{128|256|512} and cvtmask2{b|d|q}{128|256|512} instruction set.

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

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

8 years ago[modules] Add OpenCLImageTypes.def to module map to fix the modules build.
Alexey Bader [Wed, 13 Apr 2016 09:54:47 +0000 (09:54 +0000)]
[modules] Add OpenCLImageTypes.def to module map to fix the modules build.

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

8 years agoEnable support for __float128 in Clang
Nemanja Ivanovic [Wed, 13 Apr 2016 09:49:45 +0000 (09:49 +0000)]
Enable support for __float128 in Clang

This patch corresponds to review:
http://reviews.llvm.org/D15120

It adds support for the __float128 keyword, literals and a target feature to
enable it. This support is disabled by default on all targets and any target
that has support for this type is free to add it.

Based on feedback that I've received from target maintainers, this appears to
be the right thing for most targets. I have not heard from the maintainers of
X86 which I believe supports this type. I will subsequently investigate the
impact of enabling this on X86.

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

8 years agoTry to use readability-identifier-naming check on Clang.
Alexander Kornienko [Wed, 13 Apr 2016 08:59:49 +0000 (08:59 +0000)]
Try to use readability-identifier-naming check on Clang.

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

8 years ago[clang-tidy] Disable misc-unused-parameters for clang.
Alexander Kornienko [Wed, 13 Apr 2016 08:47:42 +0000 (08:47 +0000)]
[clang-tidy] Disable misc-unused-parameters for clang.

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

8 years ago[OpenCL] Move OpenCLImageTypes.def from clangAST to clangBasic library.
Alexey Bader [Wed, 13 Apr 2016 08:33:41 +0000 (08:33 +0000)]
[OpenCL] Move OpenCLImageTypes.def from clangAST to clangBasic library.

Putting OpenCLImageTypes.def to clangAST library violates layering requirement: "It's not OK for a Basic/ header to include an AST/ header".
This fixes the modules build.

Differential revision: http://reviews.llvm.org/D18954
Reviewers: Richard Smith, Vassil Vassilev.

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

8 years agoconstexpr -> const to appease MSVC bots.
Richard Smith [Wed, 13 Apr 2016 07:47:38 +0000 (07:47 +0000)]
constexpr -> const to appease MSVC bots.

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

8 years agoASTWriterDecl.cpp: Prune a couple of \param(s), corresponding to r266160. [-Wdocument...
NAKAMURA Takumi [Wed, 13 Apr 2016 07:45:10 +0000 (07:45 +0000)]
ASTWriterDecl.cpp: Prune a couple of \param(s), corresponding to r266160. [-Wdocumentation]

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

8 years ago[modules] Add some missing blockinfo records. No functionality change except to llvm...
Richard Smith [Wed, 13 Apr 2016 07:41:35 +0000 (07:41 +0000)]
[modules] Add some missing blockinfo records. No functionality change except to llvm-bcanalyzer output.

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

8 years ago[PPC64][VSX] Add a couple of new data types for vec_vsx_ld and vec_vsx_st intrinsics...
Chuang-Yu Cheng [Wed, 13 Apr 2016 05:16:31 +0000 (05:16 +0000)]
[PPC64][VSX] Add a couple of new data types for vec_vsx_ld and vec_vsx_st intrinsics and fix incorrect testcases with minor refactoring

New added data types:
  vector double vec_vsx_ld (int, const double *);
  vector float vec_vsx_ld (int, const float *);
  vector bool short vec_vsx_ld (int, const vector bool short *);
  vector bool int vec_vsx_ld (int, const vector bool int *);
  vector signed int vec_vsx_ld (int, const signed int *);
  vector unsigned int vec_vsx_ld (int, const unsigned int *);

  void vec_vsx_st (vector double, int, double *);
  void vec_vsx_st (vector float, int, float *);
  void vec_vsx_st (vector bool short, int, vector bool short *);
  void vec_vsx_st (vector bool short, int, signed short *);
  void vec_vsx_st (vector bool short, int, unsigned short *);
  void vec_vsx_st (vector bool int, int, vector bool int *);
  void vec_vsx_st (vector bool int, int, signed int *);
  void vec_vsx_st (vector bool int, int, unsigned int *);

Also fix testcases which use non-vector argument version of vec_vsx_ld or
vec_vsx_st, but pass incorrect parameter.

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

8 years ago[modules] Refactor handling of cases where we write an offset to a prior record into...
Richard Smith [Wed, 13 Apr 2016 02:12:03 +0000 (02:12 +0000)]
[modules] Refactor handling of cases where we write an offset to a prior record into the bitstream and simplify a little, in preparation for doing this in more cases.

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

8 years ago[analyzer] Nullability: Treat nil _Nonnull ivar as invariant violation.
Devin Coughlin [Wed, 13 Apr 2016 00:41:54 +0000 (00:41 +0000)]
[analyzer] Nullability: Treat nil _Nonnull ivar as invariant violation.

Treat a _Nonnull ivar that is nil as an invariant violation in a similar
fashion to how a nil _Nonnull parameter is treated as a precondition violation.

This avoids warning on defensive returns of nil on defensive internal
checks, such as the following common idiom:

@class InternalImplementation
@interface PublicClass {
  InternalImplementation * _Nonnull _internal;
}
-(id _Nonnull)foo;
@end

@implementation PublicClass
-(id _Nonnull)foo {
  if (!_internal)
    return nil; // no-warning

  return [_internal foo];
}
@end

rdar://problem/24485171

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

8 years agoclang/test/Driver/cl-options.c: Fix an expression to recognize dos r'\\'.
NAKAMURA Takumi [Wed, 13 Apr 2016 00:22:25 +0000 (00:22 +0000)]
clang/test/Driver/cl-options.c: Fix an expression to recognize dos r'\\'.

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

8 years ago[ObjC] Pop all cleanups created in EmitObjCForCollectionStmt before
Akira Hatanaka [Tue, 12 Apr 2016 23:10:58 +0000 (23:10 +0000)]
[ObjC] Pop all cleanups created in EmitObjCForCollectionStmt before
exiting the for-in loop.

This commit fixes a bug where EmitObjCForCollectionStmt didn't pop
cleanups for captures.

For example, in the following for-in loop, a block which captures self
is passed to foo1:

for (id x in [self foo1:^{ use(self); }]) {
  use(x);
  break;
}

Previously, the code in EmitObjCForCollectionStmt wouldn't pop the
cleanup for the captured self before exiting the loop, which caused
code-gen to generate an IR in which objc_release was called twice on
the captured self.

This commit fixes the bug by entering a RunCleanupsScope before the
loop condition is evaluated and forcing its cleanup before exiting the
loop.

rdar://problem/16865751

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

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